/* ═══════════════════════════════════════════
   STANDARD REPUESTOS GT — Estilos
   ═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

/* ─── RESET ──────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: #F4F2EE;
  color: #1C1C1C;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── VARIABLES ──────────────────────────── */
:root {
  --brand: #E8520A;
  --brand-dark: #C03E06;
  --brand-light: #FFF0E8;
  --dark: #1C1C1C;
  --dark2: #2A2A2A;
  --mid: #6B6B6B;
  --light: #F4F2EE;
  --white: #FFFFFF;
  --border: #E2DFD8;
  --success: #1B7F45;
  --warning: #B45309;
  --danger: #B91C1C;
  --info: #1D4ED8;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg: 0 4px 24px rgba(0,0,0,.12);
}

/* ─── NAVBAR ─────────────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--dark);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  height: 60px;
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.navbar-brand {
  font-family: 'Syne', sans-serif;
  font-weight: 800; font-size: 17px;
  color: var(--white);
  letter-spacing: .5px;
  line-height: 1.1;
}
.navbar-brand span { color: var(--brand); }
.navbar-brand small { display: block; font-size: 9px; font-weight: 400; color: #999; letter-spacing: 2px; text-transform: uppercase; }
.nav-links {
  display: flex; gap: 4px; align-items: center;
}
.nav-link {
  color: #AAA; text-decoration: none; font-size: 13px; font-weight: 500;
  padding: 6px 12px; border-radius: 8px; transition: all .2s; cursor: pointer;
  background: none; border: none;
}
.nav-link:hover, .nav-link.active { color: var(--white); background: rgba(255,255,255,.1); }
.nav-link.btn-nav {
  background: var(--brand); color: var(--white); margin-left: 4px;
}
.nav-link.btn-nav:hover { background: var(--brand-dark); }
.hamburger {
  display: none; background: none; border: none; color: var(--white);
  font-size: 24px; cursor: pointer; padding: 4px;
}

/* ─── MOBILE MENU ────────────────────────── */
.mobile-menu {
  display: none; position: fixed; top: 60px; left: 0; right: 0; bottom: 0;
  background: var(--dark2); z-index: 99; flex-direction: column;
  padding: 20px;
  gap: 4px;
}
.mobile-menu.open { display: flex; }
.mobile-menu .nav-link { font-size: 16px; padding: 14px 16px; }

/* ─── PAGES ──────────────────────────────── */
.page { display: none; padding-top: 60px; min-height: 100vh; }
.page.active { display: block; }

/* ─── LANDING ────────────────────────────── */
.hero {
  background: var(--dark);
  padding: 56px 20px 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(232,82,10,.18) 0%, transparent 70%);
  pointer-events: none;
}
.hero-label {
  display: inline-block;
  background: rgba(232,82,10,.15);
  color: var(--brand);
  font-size: 11px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase;
  padding: 6px 14px; border-radius: 20px;
  border: 1px solid rgba(232,82,10,.3);
  margin-bottom: 20px;
}
.hero h1 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(28px, 7vw, 48px);
  font-weight: 800; color: var(--white); line-height: 1.1;
  margin-bottom: 16px;
}
.hero h1 span { color: var(--brand); }
.hero p {
  color: #AAA; font-size: 16px; line-height: 1.6;
  max-width: 500px; margin: 0 auto 32px;
}
.hero-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ─── HOW IT WORKS ───────────────────────── */
.how {
  padding: 56px 20px;
  background: var(--white);
}
.section-title {
  font-family: 'Syne', sans-serif;
  font-size: 24px; font-weight: 800;
  text-align: center; margin-bottom: 8px;
}
.section-sub { color: var(--mid); text-align: center; margin-bottom: 40px; font-size: 15px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; max-width: 900px; margin: 0 auto; }
.step {
  background: var(--light);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  border: 1px solid var(--border);
}
.step-num {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--brand); color: var(--white);
  font-family: 'Syne', sans-serif; font-weight: 800; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.step h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.step p { font-size: 13px; color: var(--mid); line-height: 1.5; }

/* ─── PRICING ────────────────────────────── */
.pricing { padding: 56px 20px; background: var(--light); }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; max-width: 900px; margin: 0 auto; }
.plan {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  position: relative;
  transition: transform .2s, box-shadow .2s;
}
.plan:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.plan.featured { border-color: var(--brand); }
.plan-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--brand); color: var(--white);
  font-size: 11px; font-weight: 600; padding: 4px 12px; border-radius: 20px; white-space: nowrap;
}
.plan-name { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 16px; margin-bottom: 8px; }
.plan-price { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 32px; color: var(--brand); margin-bottom: 4px; }
.plan-price small { font-size: 14px; font-weight: 400; color: var(--mid); }
.plan-desc { font-size: 13px; color: var(--mid); margin-bottom: 16px; line-height: 1.5; }
.plan-feature { font-size: 13px; color: var(--dark); padding: 5px 0; display: flex; gap: 8px; align-items: flex-start; }
.plan-feature::before { content: '✓'; color: var(--success); font-weight: 700; flex-shrink: 0; }

/* ─── BUTTONS ────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 13px 24px; border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif; font-weight: 600; font-size: 15px;
  cursor: pointer; border: none; text-decoration: none;
  transition: all .2s; white-space: nowrap;
}
.btn-primary { background: var(--brand); color: var(--white); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline { background: transparent; color: var(--white); border: 2px solid rgba(255,255,255,.3); }
.btn-outline:hover { background: rgba(255,255,255,.1); border-color: var(--white); }
.btn-dark { background: var(--dark); color: var(--white); }
.btn-dark:hover { background: var(--dark2); }
.btn-ghost { background: var(--light); color: var(--dark); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--border); }
.btn-block { width: 100%; }
.btn-lg { padding: 16px 32px; font-size: 16px; border-radius: var(--radius); }
.btn-wa {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  background: #25D366; color: var(--white);
  border: none; border-radius: var(--radius-sm);
  padding: 13px 20px; font-size: 15px; font-weight: 600;
  cursor: pointer; width: 100%; margin-top: 12px;
  font-family: 'DM Sans', sans-serif;
  transition: background .2s;
}
.btn-wa:hover { background: #1DA851; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; border: none; cursor: pointer; font-weight: 600; }
.btn-wa-sm { background: #25D366; color: white; }
.btn-success { background: #D1FAE5; color: var(--success); }
.btn-info { background: #DBEAFE; color: var(--info); }
.btn-warning { background: #FEF3C7; color: var(--warning); }
.btn-danger { background: #FEE2E2; color: var(--danger); }

/* ─── FORMS ──────────────────────────────── */
.form-page { background: var(--white); min-height: 100vh; }
.form-hero {
  background: var(--dark); padding: 32px 20px 28px;
  text-align: center;
}
.form-hero h2 { font-family: 'Syne', sans-serif; font-size: 22px; font-weight: 800; color: var(--white); margin-bottom: 6px; }
.form-hero p { color: #AAA; font-size: 14px; }
.form-body { max-width: 680px; margin: 0 auto; padding: 24px 20px 48px; }
.form-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.form-section-title {
  font-family: 'Syne', sans-serif;
  font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--brand); margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.form-section-title::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row.col-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.form-group:last-child { margin-bottom: 0; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--mid); text-transform: uppercase; letter-spacing: .5px; }
.form-group label .req { color: var(--brand); margin-left: 2px; }
input[type="text"], input[type="tel"], input[type="email"], input[type="number"],
select, textarea {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif; font-size: 14px; color: var(--dark);
  background: var(--white); outline: none;
  transition: border-color .2s;
  -webkit-appearance: none; appearance: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B6B6B' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 11px; color: var(--mid); margin-top: 3px; }

/* ─── OPTION PILLS ───────────────────────── */
.option-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.option-pill input { display: none; }
.option-pill span {
  display: block; padding: 8px 14px;
  border: 1.5px solid var(--border); border-radius: 20px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all .15s; color: var(--dark);
  background: var(--white);
}
.option-pill input:checked + span {
  border-color: var(--brand); background: var(--brand-light); color: var(--brand);
}
.option-pill span:hover { border-color: var(--brand); }

/* ─── CHECK PILLS ────────────────────────── */
.check-pills { display: flex; flex-wrap: wrap; gap: 8px; max-height: 200px; overflow-y: auto; padding: 4px; }
.check-pill input { display: none; }
.check-pill span {
  display: block; padding: 6px 12px;
  border: 1.5px solid var(--border); border-radius: 20px;
  font-size: 12px; cursor: pointer; transition: all .15s;
}
.check-pill input:checked + span {
  border-color: var(--brand); background: var(--brand-light); color: var(--brand); font-weight: 600;
}

/* ─── URGENCIA ───────────────────────────── */
.urgencia-btns { display: flex; gap: 10px; }
.urgencia-btn {
  flex: 1; padding: 10px; border-radius: var(--radius-sm);
  border: 2px solid var(--border); background: var(--white);
  font-size: 13px; font-weight: 600; cursor: pointer; text-align: center; transition: all .15s;
}
.urgencia-btn[data-val="Alta"].active { border-color: var(--danger); background: #FEE2E2; color: var(--danger); }
.urgencia-btn[data-val="Media"].active { border-color: var(--warning); background: #FEF3C7; color: var(--warning); }
.urgencia-btn[data-val="Baja"].active { border-color: var(--success); background: #D1FAE5; color: var(--success); }

/* ─── PANEL ──────────────────────────────── */
.panel-page { background: var(--light); }
.panel-header {
  background: var(--dark); padding: 28px 20px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.panel-header h2 { font-family: 'Syne', sans-serif; font-size: 20px; font-weight: 800; color: var(--white); }
.panel-header p { color: #AAA; font-size: 13px; margin-top: 2px; }
.panel-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.panel-body { max-width: 960px; margin: 0 auto; padding: 24px 20px 48px; }
.panel-tabs { display: flex; gap: 4px; margin-bottom: 20px; overflow-x: auto; }
.panel-tab {
  padding: 9px 16px; border-radius: var(--radius-sm);
  border: none; background: var(--white); color: var(--mid);
  font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--border); transition: all .15s;
}
.panel-tab.active { background: var(--brand); color: var(--white); border-color: var(--brand); }

/* ─── STAT CARDS ─────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  text-align: center; box-shadow: var(--shadow);
}
.stat-card .num { font-family: 'Syne', sans-serif; font-size: 28px; font-weight: 800; color: var(--brand); }
.stat-card .lbl { font-size: 11px; color: var(--mid); text-transform: uppercase; letter-spacing: .5px; margin-top: 4px; }

/* ─── SOLICITUD CARD ─────────────────────── */
.solicitud-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  margin-bottom: 12px; box-shadow: var(--shadow);
}
.sol-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sol-pieza { font-family: 'Syne', sans-serif; font-size: 17px; font-weight: 700; }
.sol-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.sol-meta span { font-size: 13px; color: var(--mid); background: var(--light); padding: 4px 10px; border-radius: 20px; }
.sol-specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; margin-bottom: 10px; }
.sol-specs span { font-size: 12px; color: var(--dark); }
.sol-comprador { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding-top: 10px; border-top: 1px solid var(--border); }
.sol-comprador span { font-size: 13px; }
.sol-fecha { margin-left: auto; font-size: 11px; color: var(--mid); }
.sol-notas { font-size: 13px; color: var(--mid); background: #FFF9F5; border-left: 3px solid var(--brand); padding: 8px 12px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin-bottom: 10px; }

/* ─── BADGES ─────────────────────────────── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: .5px; }
.badge-danger { background: #FEE2E2; color: var(--danger); }
.badge-warning { background: #FEF3C7; color: var(--warning); }
.badge-info { background: #DBEAFE; color: var(--info); }
.badge-success { background: #D1FAE5; color: var(--success); }
.badge-estado-pendiente { background: #FEF3C7; color: var(--warning); }
.badge-estado-aprobado { background: #D1FAE5; color: var(--success); }
.badge-estado-verificado { background: #DBEAFE; color: var(--info); }
.badge-estado-suspendido { background: #FEE2E2; color: var(--danger); }
.badge-estado-rechazado { background: #F3F4F6; color: #6B7280; }
.badge-estado-borrador { background: #F3F4F6; color: #6B7280; }

/* ─── ADMIN TABLE ────────────────────────── */
.admin-table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--white); }
.admin-table th { background: var(--light); padding: 10px 12px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--mid); border-bottom: 1px solid var(--border); white-space: nowrap; }
.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #FAFAF8; }
.admin-actions { display: flex; gap: 4px; flex-wrap: wrap; }

/* ─── METRICS ────────────────────────────── */
.metrics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.metric-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.metric-card h4 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--mid); margin-bottom: 12px; }
.metric-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.metric-row:last-child { border-bottom: none; }
.metric-val { font-weight: 700; color: var(--brand); }

/* ─── EMPTY STATE ────────────────────────── */
.empty-state { text-align: center; padding: 48px 20px; color: var(--mid); }
.empty-icon { font-size: 48px; margin-bottom: 12px; opacity: .5; }
.empty-state p { font-size: 14px; line-height: 1.6; }

/* ─── CONFIRMACIÓN ───────────────────────── */
.confirm-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.confirm-card {
  background: var(--white); border-radius: var(--radius); padding: 40px 28px;
  text-align: center; max-width: 400px; width: 100%;
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
}
.confirm-icon { font-size: 56px; margin-bottom: 16px; }
.confirm-card h2 { font-family: 'Syne', sans-serif; font-size: 22px; font-weight: 800; margin-bottom: 10px; }
.confirm-card p { color: var(--mid); font-size: 14px; line-height: 1.6; margin-bottom: 24px; }

/* ─── TOASTS ─────────────────────────────── */
#toasts { position: fixed; bottom: 20px; right: 20px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--dark); color: var(--white);
  padding: 12px 18px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  transform: translateX(120%); transition: transform .3s ease;
  max-width: 280px; box-shadow: var(--shadow-lg);
}
.toast.show { transform: translateX(0); }
.toast-error { background: var(--danger); }

/* ─── CONTENT SECTIONS ───────────────────── */
.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }
.section { padding: 56px 20px; }
.muted { color: var(--mid); font-size: 13px; }

/* ─── FOOTER ─────────────────────────────── */
.footer {
  background: var(--dark2); color: #666; text-align: center;
  padding: 20px; font-size: 12px; margin-top: 0;
}
.footer a { color: var(--brand); text-decoration: none; }

/* ─── RESPONSIVE ─────────────────────────── */
@media (max-width: 640px) {
  .nav-links { display: none; }
  .hamburger { display: block; }
  .form-row { grid-template-columns: 1fr; }
  .form-row.col-3 { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 26px; }
  .hero-btns { flex-direction: column; align-items: center; }
  .panel-header { flex-direction: column; align-items: flex-start; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  #toasts { left: 12px; right: 12px; }
  .toast { max-width: 100%; }
  .urgencia-btns { flex-direction: column; }
}

@media (max-width: 400px) {
  .navbar-brand span { display: none; }
}

/* ─── PWA SAFE AREA ──────────────────────── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  body { padding-bottom: env(safe-area-inset-bottom); }
}
