/* =========================================================
   SHC · Catering empresarial
   Estilos mobile-first (base = móvil, media queries amplían)
   ========================================================= */

:root {
  --background: #faf6f0;
  --foreground: #2b2b2e;
  --card: #ffffff;
  --primary: #d97a4e;
  --primary-hover: #c96a3f;
  --primary-foreground: #ffffff;
  --muted-foreground: #6f6257;
  --border: #eadfd2;
  --surface-alt: #f3e9dc;
  --shadow-soft: 0 1px 2px rgba(43, 43, 46, .06), 0 6px 18px rgba(43, 43, 46, .06);
  --radius: 0.75rem;
}

/* ---------- Reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; border-color: var(--border); }
html { scroll-behavior: smooth; }
body {
  font-family: "Poppins", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.container {
  max-width: 72rem;
  margin: 0 auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 246, 240, .95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.logo { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.025em; }

.main-nav { display: none; align-items: center; gap: 2rem; font-size: 1rem; }
.main-nav a:hover { color: var(--primary); }

/* ---------- Botones ---------- */
.btn-outline {
  border: 1px solid var(--foreground);
  border-radius: 9999px;
  padding: 0.5rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  transition: background .15s, color .15s;
}
.btn-outline:hover { background: var(--foreground); color: var(--background); }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: var(--primary-foreground);
  border-radius: 9999px;
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  box-shadow: var(--shadow-soft);
  transition: background .15s;
}
.btn-primary:hover { background: var(--primary-hover); }

/* ---------- Secciones y tipografía ---------- */
section { padding-top: 4rem; padding-bottom: 4rem; }
.alt { background: var(--surface-alt); }

h1 { font-size: 36px; font-weight: 700; line-height: 1.25; letter-spacing: -0.025em; }
h2 { font-size: 26px; font-weight: 600; letter-spacing: -0.025em; }

.lead {
  margin-top: 1.25rem;
  max-width: 36rem;
  font-size: 17px;
  line-height: 1.625;
  color: var(--muted-foreground);
}
.lead--sm { font-size: 1rem; }
.lead--tight { margin-top: 0.75rem; }

.note { margin-top: 1rem; font-size: 0.875rem; color: var(--muted-foreground); }
.cta-wrap { margin-top: 2rem; }

/* ---------- Portada ---------- */
.hero-grid { display: grid; align-items: center; gap: 2.5rem; }
.hero-img {
  width: 100%;
  height: auto;
  border-radius: 1rem;
  object-fit: cover;
  box-shadow: var(--shadow-soft);
}

/* ---------- Grid de tarjetas ---------- */
.grid { display: grid; gap: 1.5rem; margin-top: 2.5rem; }
.card-list { list-style: none; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.75rem;
  box-shadow: var(--shadow-soft);
}
.card h3 { font-size: 1.125rem; font-weight: 600; margin-top: 1.25rem; }
.card p { margin-top: 0.5rem; font-size: 1rem; line-height: 1.625; color: var(--muted-foreground); }

.icon { width: 2.25rem; height: 2.25rem; color: var(--primary); }

/* Servicios */
.svc { overflow: hidden; padding: 0; }
.svc img { height: 13rem; width: 100%; object-fit: cover; }
.svc-body { padding: 1.5rem; }
.svc-body h3 { margin-top: 0; }
.card .price { margin-top: 1rem; font-size: 1rem; font-weight: 600; color: var(--primary); }

/* Testimonios */
blockquote { font-size: 1rem; line-height: 1.625; }
figcaption { margin-top: 1.25rem; }
figcaption .name { display: block; font-weight: 600; }
figcaption .role { display: block; font-size: 0.875rem; color: var(--muted-foreground); }

/* ---------- Contacto ---------- */
.contact-grid { display: grid; gap: 2.5rem; }
.info-grid { display: grid; gap: 1.5rem; font-size: 1rem; font-style: normal; }
.info-grid h3 { font-weight: 600; }
.info-grid p { margin-top: 0.25rem; color: var(--muted-foreground); }

.social { margin-top: 0.5rem; display: flex; gap: 1.25rem; color: var(--muted-foreground); }
.social a:hover { color: var(--primary); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); }
.site-footer .container {
  padding-top: 2rem;
  padding-bottom: 2rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* ---------- Breakpoints ---------- */
@media (min-width: 640px) {
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .info-grid .span2 { grid-column: span 2; }
}

@media (min-width: 768px) {
  .main-nav { display: flex; }
  section { padding-top: 6rem; padding-bottom: 6rem; }
  h1 { font-size: 48px; }
  h2 { font-size: 32px; }
  .grid { grid-template-columns: repeat(3, 1fr); }
  .hero-grid { grid-template-columns: repeat(2, 1fr); gap: 4rem; }
  .contact-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Autenticación (Supabase) ---------- */
.header-actions { display: flex; align-items: center; gap: 0.75rem; white-space: nowrap; }
button.btn-outline { background: none; color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.logout-link { font-size: 0.875rem; font-weight: 600; color: var(--muted-foreground); }
.logout-link:hover { color: var(--primary); }
.header-actions [hidden] { display: none; }

.welcome-bar {
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--muted-foreground);
}
.welcome-bar .container { padding-top: 0.5rem; padding-bottom: 0.5rem; overflow-wrap: anywhere; }
.welcome-bar[hidden] { display: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.auth-modal {
  margin: auto;
  width: calc(100% - 2rem);
  max-width: 26rem;
  padding: 1.75rem;
  background: var(--card);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: var(--shadow-soft);
}
.auth-modal::backdrop { background: rgba(43, 43, 46, .45); }
.auth-close {
  position: absolute; top: 0.75rem; right: 0.75rem;
  width: 2rem; height: 2rem;
  background: none; border: 0; cursor: pointer;
  font-size: 1.5rem; line-height: 1; color: var(--muted-foreground);
}
.auth-close:hover { color: var(--foreground); }

.auth-tabs { display: flex; gap: 0.25rem; padding: 0.25rem; margin-right: 2rem; background: var(--surface-alt); border-radius: 9999px; }
.auth-tabs button {
  flex: 1; padding: 0.5rem 0.75rem;
  background: none; border: 0; border-radius: 9999px; cursor: pointer;
  font: inherit; font-size: 0.875rem; font-weight: 600; color: var(--muted-foreground);
}
.auth-tabs button[aria-selected="true"] { background: var(--card); color: var(--foreground); box-shadow: var(--shadow-soft); }

.auth-form { display: flex; flex-direction: column; margin-top: 1.5rem; }
.auth-form[hidden], .auth-modal [hidden] { display: none; }
#auth-view-reset { margin-top: 0; }
.auth-form label { font-size: 0.875rem; font-weight: 600; margin-top: 0.75rem; }
.auth-form label:first-of-type { margin-top: 0; }
.auth-form input {
  margin-top: 0.375rem; padding: 0.625rem 0.875rem;
  font: inherit; font-size: 1rem; color: var(--foreground);
  background: var(--background); border: 1px solid var(--border); border-radius: var(--radius);
}
.auth-form input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.auth-form .btn-primary { margin-top: 1.25rem; border: 0; cursor: pointer; font-family: inherit; }
.auth-form .btn-primary:disabled { opacity: .6; cursor: wait; }
.auth-hint { margin-top: 0.375rem; font-size: 0.8125rem; color: var(--muted-foreground); }
.auth-link { align-self: flex-start; margin-top: 0.625rem; font-size: 0.875rem; color: var(--primary); }
.auth-link:hover { text-decoration: underline; }
.auth-msg { margin-top: 0.75rem; font-size: 0.875rem; }
.auth-msg:empty { display: none; }
.auth-msg.is-error { color: #b3261e; }
.auth-msg.is-ok { color: var(--foreground); }
.auth-msg a { color: var(--primary); font-weight: 600; text-decoration: underline; }

.auth-title { font-size: 1.125rem; font-weight: 600; padding-right: 2rem; }
.auth-text { margin-top: 0.5rem; color: var(--muted-foreground); overflow-wrap: anywhere; }
.auth-text strong { color: var(--foreground); }
#auth-view-account .btn-primary { margin-top: 1.25rem; width: 100%; border: 0; cursor: pointer; font-family: inherit; }

@media (max-width: 479px) {
  .header-actions { gap: 0.375rem; }
  /* Con sesión activa hay 4 accesos: pasan a una fila propia bajo el logo */
  .header-inner:has(#profile-link:not([hidden])) { flex-wrap: wrap; row-gap: 0.75rem; }
  .header-inner:has(#profile-link:not([hidden])) .header-actions { flex-basis: 100%; justify-content: space-between; gap: 0; }
  .header-actions .btn-outline { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
  .logout-link { font-size: 0.8125rem; }
}
