/* Egaña Automotriz — paleta alineada al logo (negro / dorado / blanco) */
:root {
  --color-bg: #f4f5f7;
  --color-bg-warm: #faf8f5;
  --color-surface: #ffffff;
  --color-ink: #0f172a;
  --color-ink-muted: #475569;
  --color-border: #e2e8f0;
  --color-gold: #e8b923;
  --color-gold-light: #ffd54a;
  --color-gold-dark: #b8860b;
  --color-hero: #000000;
  --color-hero-mid: #0a0a0a;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --max: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--color-ink);
  background: var(--color-bg);
  overflow-x: hidden;
}

/* —— Hero & navegación —— */
.hero {
  position: relative;
  background: linear-gradient(160deg, var(--color-hero) 0%, var(--color-hero-mid) 40%, #121212 100%);
  color: #f1f5f9;
  padding-top: max(0rem, env(safe-area-inset-top));
  padding-right: max(1rem, env(safe-area-inset-right));
  padding-bottom: 3.5rem;
  padding-left: max(1rem, env(safe-area-inset-left));
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 45% at 90% 0%, rgba(232, 185, 35, 0.18), transparent 50%),
    radial-gradient(ellipse 55% 35% at 0% 100%, rgba(232, 185, 35, 0.06), transparent 48%);
  pointer-events: none;
}

.hero.hero--compact {
  padding-bottom: 0;
}

.hero.hero--compact .top-nav {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.top-nav {
  position: relative;
  z-index: 2;
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 0;
  min-height: 7.25rem;
  flex-wrap: wrap;
}

.top-nav-head {
  display: contents;
}

.nav-menu-toggle {
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
}

.nav-menu-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
}

.nav-menu-toggle-bars {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
}

.nav-menu-bar {
  display: block;
  width: 1.25rem;
  height: 2px;
  border-radius: 1px;
  background: #f8fafc;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.top-nav.is-open .nav-menu-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.top-nav.is-open .nav-menu-bar:nth-child(2) {
  opacity: 0;
}

.top-nav.is-open .nav-menu-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
  line-height: 0;
}

/* Marca en cabecera (imagen externa, proporción 1:1) */
.brand--ea-mark:hover .brand-ea-mark {
  opacity: 0.94;
  transform: scale(1.02);
}

.brand-ea-mark {
  display: block;
  width: clamp(6.25rem, 18vw, 10rem);
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 10px;
  box-shadow:
    0 0 0 1px rgba(232, 185, 35, 0.4),
    0 8px 28px rgba(0, 0, 0, 0.4);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

@media (max-width: 700px) {
  .brand-ea-mark {
    width: clamp(5.5rem, 24vw, 8rem);
  }
}

@media (max-width: 480px) {
  .brand-ea-mark {
    width: clamp(5rem, 28vw, 7rem);
  }
}

.top-nav ul {
  list-style: none;
  display: flex;
  gap: 0.35rem 1rem;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.top-nav a {
  color: rgba(241, 245, 249, 0.88);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.top-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--max);
  margin: 2.5rem auto 0;
  padding-bottom: 0.5rem;
}

.hero-eyebrow {
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-hero);
  background: linear-gradient(90deg, var(--color-gold-light), var(--color-gold));
  border-radius: 999px;
}

.hero-content h1 {
  margin: 0 0 0.85rem;
  font-size: clamp(1.85rem, 4.5vw, 2.65rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #fff;
}

.hero-lead {
  margin: 0 0 1.35rem;
  max-width: 36rem;
  font-size: 1.05rem;
  color: rgba(226, 232, 240, 0.9);
}

.trust-pills {
  list-style: none;
  margin: 0 0 1.75rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.65rem;
}

.trust-pills li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.trust-pills li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-gold-light);
  box-shadow: 0 0 0 2px rgba(212, 160, 18, 0.35);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

/* —— Secciones —— */
main {
  overflow-x: hidden;
}

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.75rem 1rem;
}

.section h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-ink);
}

.section-intro {
  margin: 0 0 1.25rem;
  color: var(--color-ink-muted);
  max-width: 52rem;
}

.section--alt {
  background: var(--color-bg-warm);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.section--contact {
  background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-bg-warm) 100%);
  border-top: 1px solid var(--color-border);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(272px, 1fr));
  gap: 1.25rem;
  margin-top: 0.35rem;
}

.contact-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-ink);
}

.contact-card .contact-phone {
  margin: 0 0 0.85rem;
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.contact-card .contact-phone a {
  color: var(--color-ink);
  text-decoration: none;
}

.contact-card .contact-phone a:hover {
  text-decoration: underline;
  color: var(--color-gold-dark);
}

.contact-card .contact-note {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: var(--color-ink-muted);
}

.contact-card .btn-stack {
  margin-top: 0.55rem;
  display: inline-block;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 0.9rem;
}

.gallery-grid figure {
  margin: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: var(--shadow-sm), 0 0 0 1px rgba(232, 185, 35, 0.14);
  background: #0f172a;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.gallery-grid figure:hover {
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(232, 185, 35, 0.28);
  transform: translateY(-2px);
}

.gallery-grid img {
  display: block;
  width: 100%;
  height: 148px;
  object-fit: cover;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: var(--shadow-sm), 0 0 0 1px rgba(232, 185, 35, 0.16);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(232, 185, 35, 0.32);
  border-color: rgba(184, 134, 11, 0.45);
}

.card--service-book {
  cursor: pointer;
  text-align: left;
}

.card--service-book:hover {
  border-color: rgba(212, 160, 18, 0.55);
}

.card--service-book:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

.card-book-hint {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-gold-dark);
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-ink);
}

.card p {
  margin: 0 0 1rem;
  color: var(--color-ink-muted);
  font-size: 0.95rem;
}

.service-prices {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0.65rem 0 0;
  border-top: 1px solid var(--color-border);
  font-size: 0.88rem;
  color: var(--color-ink-muted);
}

.service-prices li {
  margin: 0.25rem 0;
}

.service-prices strong {
  color: var(--color-ink);
}

.booking-form {
  background: var(--color-surface);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
  display: grid;
  gap: 1rem;
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(232, 185, 35, 0.12);
}

#agenda-auth-actions {
  margin-bottom: 1.25rem;
  border: 1px dashed rgba(212, 160, 18, 0.55);
  background: linear-gradient(135deg, #fffbeb 0%, #fff 100%);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

#agenda-auth-actions .section-intro {
  margin-bottom: 0.75rem;
}

.schedule-scroll {
  overflow-x: auto;
  margin: 0.75rem 0 1.35rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.excel-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 520px;
}

.excel-table th,
.excel-table td {
  border: 1px solid var(--color-border);
  padding: 0.5rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

.excel-table thead th {
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
  font-weight: 700;
  white-space: nowrap;
  color: var(--color-ink);
}

.excel-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.schedule-cell {
  text-align: center;
  min-width: 6.5rem;
  max-width: 9rem;
}

.schedule-cell.free {
  background: #ecfdf5;
  color: #64748b;
}

.schedule-cell.busy {
  background: #fef2f2;
  color: var(--color-ink);
  font-weight: 600;
}

.schedule-sub {
  display: block;
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--color-ink-muted);
  margin-top: 0.2rem;
}

.profiles-list-wrap {
  margin-top: 1rem;
}

.profiles-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.profiles-list li {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

.admin-panel.hidden {
  display: none;
}

.admin-actions {
  margin: 1rem 0 1.5rem;
}

.site-assets-admin-wrap {
  margin-bottom: 1.25rem;
}

.site-assets-upload-form {
  margin-top: 0.5rem;
}

.row-actions {
  margin-top: 0.6rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn.small {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

.btn.danger {
  background: #b91c1c;
  color: #fff;
}

.field {
  display: grid;
  gap: 0.4rem;
}

label {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--color-ink);
}

input,
select {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(212, 160, 18, 0.2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.15rem;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
  font-size: 0.95rem;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, color 0.15s;
}

.btn:active {
  transform: scale(0.98);
}

.btn.primary {
  background: linear-gradient(180deg, var(--color-gold-light) 0%, var(--color-gold) 100%);
  color: var(--color-hero);
  box-shadow: 0 2px 0 var(--color-gold-dark), 0 4px 12px rgba(166, 124, 0, 0.35);
}

.btn.primary:hover {
  filter: brightness(1.05);
  box-shadow: 0 2px 0 var(--color-gold-dark), 0 6px 20px rgba(166, 124, 0, 0.4);
}

.btn.secondary {
  background: var(--color-ink);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn.secondary:hover {
  background: #1e293b;
}

.btn-ghost {
  background: transparent;
  color: #f8fafc;
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: none;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.55);
}

.btn-lg {
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
}

.hidden {
  display: none !important;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.booking-message {
  min-height: 1.5rem;
  margin: 0;
  font-weight: 600;
}

.booking-message.ok {
  color: #15803d;
}

.booking-message.error {
  color: #b91c1c;
}

.notify-links {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.notify-links.hidden {
  display: none;
}

.notify-links .notify-hint {
  width: 100%;
  margin: 0;
  font-size: 0.88rem;
  color: var(--color-ink-muted);
  font-weight: 600;
}

.nav-login-btn {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.12);
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-sm);
  font-weight: 700;
}

.nav-login-btn:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  color: #fff !important;
}

/* —— Modal —— */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(12, 18, 34, 0.55);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 1200;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
}

.modal-card {
  width: min(440px, 100%);
  max-height: min(90vh, 640px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: var(--color-surface);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  padding: 1.5rem;
  display: grid;
  gap: 1rem;
  box-shadow: var(--shadow-lg);
}

.modal-card h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
}

.modal-card > p:first-of-type {
  margin: 0;
  color: var(--color-ink-muted);
  font-size: 0.95rem;
}

/* —— Footer —— */
.site-footer {
  background: var(--color-hero);
  color: #94a3b8;
  padding: 2.5rem 1rem 2rem;
  margin-top: 0;
}

.site-footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
  align-items: flex-start;
}

.site-footer strong {
  display: block;
  color: #fff;
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.site-footer-inner p {
  margin: 0;
  font-size: 0.9rem;
  max-width: 280px;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.site-footer-links a {
  color: #e2e8f0;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.site-footer-links a:hover {
  color: var(--color-gold-light);
}

.site-footer-copy {
  max-width: var(--max);
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
  text-align: center;
  color: #64748b;
}

/* —— Página interna: título bajo barra —— */
.page-title-block {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.75rem 1rem 0;
  position: relative;
  z-index: 2;
}

.page-title-block .hero-eyebrow {
  margin-bottom: 0.5rem;
}

.page-title-block h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.page-title-block .hero-lead {
  margin: 0;
  font-size: 0.98rem;
}

@media (min-width: 769px) {
  .nav-menu-toggle {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .top-nav-head {
    display: flex !important;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
  }

  .nav-menu-toggle {
    display: inline-flex !important;
  }

  .top-nav {
    min-height: 0;
    align-items: flex-start;
    padding-bottom: 0.85rem;
  }

  .top-nav .nav-links {
    order: 3;
    flex-direction: column;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin: 0;
    padding: 0;
    gap: 0.15rem;
    align-items: stretch;
    justify-content: flex-start;
    transition: max-height 0.35s ease, opacity 0.2s ease, padding 0.2s ease;
  }

  .top-nav.is-open .nav-links {
    max-height: min(78vh, 560px);
    opacity: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.35rem 0 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 0.35rem;
  }

  .top-nav .nav-links li {
    width: 100%;
  }

  .top-nav .nav-links a,
  .top-nav .nav-links .nav-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 2.75rem;
    padding: 0.65rem 0.85rem;
    font-size: 1rem;
    box-sizing: border-box;
  }

  .top-nav .nav-links .nav-login-btn {
    white-space: normal;
    text-align: center;
    line-height: 1.25;
  }

  .hero-content {
    margin-top: 1.35rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .section {
    padding: 2rem max(1rem, env(safe-area-inset-left)) 2rem max(1rem, env(safe-area-inset-right));
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }

  .gallery-grid img {
    height: 120px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .contact-card .btn {
    width: 100%;
    justify-content: center;
  }

  .contact-card .btn-stack {
    display: block;
    width: 100%;
    text-align: center;
  }

  .social-links {
    flex-direction: column;
    align-items: stretch;
  }

  .social-links .btn {
    width: 100%;
    justify-content: center;
    min-height: 2.75rem;
  }

  .site-footer {
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
  }

  .site-footer-inner {
    flex-direction: column;
  }

  .schedule-scroll {
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 480px) {
  input,
  select,
  textarea {
    font-size: 16px;
  }

  .excel-table {
    font-size: 0.8125rem;
  }

  .excel-table th,
  .excel-table td {
    padding: 0.45rem 0.5rem;
  }

  .page-title-block {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
}
