/* ============================================================
   TOOTH CARE DENTAL — "IVORY EDITORIAL" DESIGN SYSTEM
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400;1,9..144,500&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600&display=swap');

:root {
  /* Palette — Ivory Editorial */
  --ivory-800: #FBF8F1;
  --ivory-900: #F6F1E8;
  --ivory-700: #F0E9DB;
  --ivory-600: #E7DECD;
  --paper: #FFFFFF;
  --ink: #113233;
  --ink-600: #2F4544;
  --ink-400: #5C6E6A;
  --ink-300: #85938F;
  --bone: #DED4C1;
  --bone-deep: #C9BCA2;
  --teal: #0E6E62;
  --teal-deep: #0A564C;
  --teal-ink: #0A4941;
  --teal-soft: #E3EFE9;
  --teal-wash: #EAF2ED;
  --bronze: #A8762F;
  --bronze-ink: #8A5E20;
  --bronze-soft: #F1E8D6;
  --star: #C08A2E;
  --danger: #B3402E;
  --danger-soft: #F6E5E1;
  --success: #2E7D54;

  /* Type */
  --font-display: 'Fraunces', 'Georgia', serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-label: 'Space Grotesk', system-ui, sans-serif;

  /* Hairlines / rules */
  --hairline-ink: 1px solid rgba(17, 50, 51, 0.28);
  --hairline-soft: 1px solid rgba(17, 50, 51, 0.14);
  --hairline-bone: 1px solid var(--bone);

  /* Radii */
  --radius-s: 2px;
  --radius-m: 6px;
  --radius-l: 12px;
  --radius-pill: 999px;

  /* Elevation */
  --shadow-1: 0 1px 0 rgba(17, 50, 51, 0.05), 0 8px 22px -12px rgba(17, 50, 51, 0.16);
  --shadow-2: 0 2px 0 rgba(17, 50, 51, 0.05), 0 22px 44px -22px rgba(17, 50, 51, 0.28);
  --glow-teal: 0 8px 26px -10px rgba(14, 110, 98, 0.45);

  /* Layout */
  --header-h: 76px;
  --strip-h: 36px;
  --container: 1300px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--ivory-800);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--teal); color: var(--ivory-800); }

h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); font-weight: 500; line-height: 1.14; color: var(--ink); }

a { color: inherit; text-decoration: none; transition: color .25s var(--ease), background-color .25s var(--ease), transform .3s var(--ease), opacity .3s var(--ease), border-color .25s var(--ease); }

img { max-width: 100%; display: block; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
textarea, input, select { font-family: inherit; }

:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 32px; }

.section { position: relative; padding: 88px 0; }
.section-padding { padding: 88px 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--teal);
}

.eyebrow::after { content: ''; width: 44px; height: 1px; background: var(--bone-deep); }

.eyebrow .section-index {
  color: var(--bronze);
  font-variant-numeric: tabular-nums;
}

.section-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  max-width: 720px;
  margin: 0 0 48px;
  text-align: left;
}

.section-header.centered { margin-left: auto; margin-right: auto; text-align: center; align-items: center; }
.section-header.centered .eyebrow::after { display: none; }

.section-header h2 { font-size: clamp(2rem, 3.4vw, 2.8rem); letter-spacing: -0.015em; }
.section-header p { color: var(--ink-400); font-size: 16.5px; max-width: 560px; }

.section-header .rule { width: 56px; height: 3px; background: var(--bronze); margin-top: 4px; }

.lead { font-size: 17px; color: var(--ink-400); }

/* ---------- Skip link ---------- */
.skip-link {
  position: fixed; top: -60px; left: 20px; z-index: 3000;
  background: var(--ink); color: var(--ivory-800);
  font-family: var(--font-label); font-size: 13px; font-weight: 600;
  padding: 12px 18px; border-radius: 0 0 4px 4px;
  transition: top .25s var(--ease);
}
.skip-link:focus { top: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-label); font-size: 13px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 15px 26px; border-radius: var(--radius-s);
  cursor: pointer; line-height: 1; white-space: nowrap;
  transition: transform .3s var(--ease), background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), box-shadow .3s var(--ease);
  position: relative; overflow: hidden;
}
.btn i { font-size: 15px; }
.btn:active { transform: translateY(0) scale(0.98); }

.btn-primary { background: var(--ink); color: var(--ivory-800); box-shadow: var(--shadow-1); }
.btn-primary:hover { background: var(--teal); color: var(--ivory-800); transform: translateY(-2px); box-shadow: var(--glow-teal); }

.btn-accent { background: var(--teal); color: var(--ivory-800); }
.btn-accent:hover { background: var(--teal-deep); transform: translateY(-2px); box-shadow: var(--glow-teal); }

.btn-secondary { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn-secondary:hover { background: var(--ink); color: var(--ivory-800); transform: translateY(-2px); }

.btn-outline-bone { background: transparent; color: var(--ink); border: 1px solid var(--bone-deep); }
.btn-outline-bone:hover { border-color: var(--ink); transform: translateY(-2px); }

.btn-ghost {
  background: transparent; color: var(--teal); padding: 6px 2px;
  letter-spacing: 0.08em; text-transform: none; font-size: 14px;
}
.btn-ghost::after { content: ''; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; background: var(--teal); transform: scaleX(0.35); transform-origin: left; transition: transform .3s var(--ease); }
.btn-ghost:hover { color: var(--teal-deep); }
.btn-ghost:hover::after { transform: scaleX(1); }

.btn-lg { padding: 18px 34px; font-size: 14px; }
.btn-sm { padding: 11px 18px; font-size: 12px; }
.btn-block { width: 100%; }

/* ---------- Badges / chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-label); font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 6px 12px; border-radius: var(--radius-pill);
  background: var(--teal-soft); color: var(--teal-deep);
  border: 1px solid transparent;
}

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-label); font-size: 12px; font-weight: 500;
  padding: 6px 12px; border-radius: var(--radius-pill);
  background: var(--ivory-700); border: 1px solid var(--bone);
  color: var(--ink-600);
}

/* ---------- Header ---------- */
.emergency-strip {
  background: var(--teal-ink); color: var(--ivory-800);
  font-family: var(--font-label); font-size: 12px; letter-spacing: 0.04em;
  min-height: var(--strip-h);
  display: flex; align-items: center;
}
.emergency-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.emergency-msg { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; }
.emergency-msg i { color: var(--bronze-soft); font-size: 14px; }
.emergency-actions { display: flex; align-items: center; gap: 16px; }
.emergency-link { display: inline-flex; align-items: center; gap: 8px; color: var(--ivory-800); font-weight: 600; }
.emergency-link:hover { color: var(--bronze-soft); }
.emergency-call i { color: var(--bronze-soft); }
.emergency-sep { width: 1px; height: 14px; background: rgba(255,255,255,0.3); }

.header {
  height: var(--header-h);
  position: sticky; top: 0; z-index: 1000;
  background: rgba(251, 248, 241, 0.92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: var(--hairline-soft);
  transition: background .3s var(--ease), box-shadow .3s var(--ease);
}
.header.scrolled { background: rgba(251, 248, 241, 0.98); box-shadow: 0 10px 30px -22px rgba(17,50,51,0.35); }

.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 100%; }

.logo-wrapper { display: inline-flex; align-items: center; gap: 12px; flex-shrink: 0; }
.logo-mark {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--ivory-800); border-radius: var(--radius-s);
  box-shadow: var(--shadow-1); transition: transform .3s var(--ease), background-color .25s var(--ease);
}
.logo-wrapper:hover .logo-mark { transform: rotate(-4deg) translateY(-1px); background: var(--teal); }
.logo-mark svg { width: 20px; height: 20px; }
.logo-text { font-family: var(--font-display); font-size: 24px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); line-height: 1; }
.logo-text .logo-accent { font-style: italic; color: var(--teal); }

.site-nav { display: flex; align-items: center; }
.nav-menu { display: flex; align-items: center; gap: 30px; list-style: none; }
.nav-cta { display: none; }

.nav-link {
  font-family: var(--font-label); font-size: 13px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-600);
  padding: 6px 0; position: relative;
}
.nav-link span { position: relative; }
.nav-link span::after {
  content: ''; position: absolute; left: 0; bottom: -6px; width: 100%; height: 2px;
  background: var(--teal); transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav-link:hover, .nav-link.active { color: var(--teal); }
.nav-link:hover span::after, .nav-link.active span::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: 18px; }

.live-status {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-label); font-size: 12px; font-weight: 600;
  letter-spacing: 0.05em; color: var(--ink-600);
  padding: 8px 14px; border-radius: var(--radius-pill);
  background: var(--paper); border: var(--hairline-bone);
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; position: relative; flex-shrink: 0; }
.live-dot.open { background: var(--success); }
.live-dot.open::after { content:''; position:absolute; inset:0; border-radius:50%; background: var(--success); animation: pulse-ring 1.8s ease-out infinite; }
.live-dot.closed { background: var(--danger); }
.live-dot.closed::after { content:''; position:absolute; inset:-2px; border-radius:50%; border: 2px solid var(--danger); opacity:.4; }
@keyframes pulse-ring { 0% { transform: scale(1); opacity:.7; } 100% { transform: scale(2.6); opacity:0; } }

.nav-toggle {
  display: none; font-size: 26px; color: var(--ink);
  width: 44px; height: 44px; align-items: center; justify-content: center;
  border: 1px solid var(--bone); border-radius: var(--radius-s); background: var(--paper);
}
.nav-toggle:hover { border-color: var(--teal); color: var(--teal); }

/* ---------- Mobile nav drawer ---------- */
@media (max-width: 1023px) {
  .nav-toggle { display: inline-flex; }
  .site-nav { position: fixed; top: var(--header-h); left: 0; right: 0; z-index: 1001; }
  .nav-menu {
    position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: flex-start;
    gap: 0; background: var(--paper); border-top: var(--hairline-ink);
    padding: 12px 32px 28px; transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: transform .35s var(--ease), opacity .25s var(--ease);
    box-shadow: 0 34px 60px -30px rgba(17,50,51,0.4);
    max-height: calc(100dvh - var(--header-h)); overflow-y: auto;
  }
  .nav-menu.active { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-menu li { width: 100%; border-bottom: var(--hairline-soft); }
  .nav-menu li:last-child { border-bottom: none; }
  .nav-link { display: block; padding: 16px 2px; font-size: 15px; letter-spacing: 0.08em; color: var(--ink); }
  .nav-link span::after { display: none; }
  .nav-link:hover span { color: var(--teal); }
  .nav-cta { display: block; padding-top: 20px; }
  .nav-cta .btn { width: 100%; }
  .live-status { display: none; }
}
@media (max-width: 1023px) and (min-width: 641px) {
  .nav-menu { padding: 12px 32px 32px; }
}

@media (max-width: 640px) {
  :root { --header-h: 66px; --strip-h: 34px; }
  .container { padding: 0 20px; }
  .header-actions { gap: 12px; }
  .logo-mark { width: 34px; height: 34px; }
  .logo-mark svg { width: 17px; height: 17px; }
  .logo-text { font-size: 20px; }
  .emergency-msg { font-size: 11px; }
  .emergency-actions .emergency-call { display: none; } /* phone lives in the mobile action bar */
  .emergency-actions { margin-left: auto; }
}

/* ---------- Floating quick contacts ---------- */
.floating-actions {
  position: fixed; right: 26px; bottom: 26px; z-index: 900;
  display: flex; flex-direction: column; gap: 14px;
}
.floater {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--ivory-800); font-size: 24px; position: relative;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background-color .25s var(--ease);
}
.floater:hover { transform: translateY(-4px) scale(1.05); }
.floater-whatsapp { background: var(--teal); box-shadow: var(--glow-teal); }
.floater-whatsapp:hover { background: var(--teal-deep); }
.floater-call { background: var(--ink); box-shadow: var(--shadow-1); }
.floater-call:hover { background: var(--bronze); color: var(--ivory-800); }
.floater-tooltip {
  position: absolute; right: 70px; top: 50%; transform: translateY(-50%) translateX(6px);
  background: var(--ink); color: var(--ivory-800);
  font-family: var(--font-label); font-size: 12px; font-weight: 500; letter-spacing: 0.04em;
  padding: 7px 12px; border-radius: var(--radius-s); white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.floater:hover .floater-tooltip { opacity: 1; transform: translateY(-50%) translateX(0); }

/* ---------- Mobile action bar ---------- */
.mobile-action-bar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 950;
  background: var(--ink); color: var(--ivory-800);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  gap: 4px;
}
.mab-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 8px 4px; border-radius: var(--radius-s);
  color: var(--ivory-800); font-family: var(--font-label);
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  transition: background-color .2s var(--ease);
}
.mab-item i { font-size: 20px; }
.mab-item:hover { background: rgba(255,255,255,0.08); color: var(--ivory-800); }
.mab-book { background: var(--teal); }
.mab-book:hover { background: var(--teal-deep); color: var(--ivory-800); }

@media (max-width: 640px) {
  .mobile-action-bar { display: flex; }
  .floating-actions { bottom: calc(84px + env(safe-area-inset-bottom)); right: 16px; gap: 12px; }
  .floater { width: 52px; height: 52px; font-size: 22px; }
  .floater-tooltip { display: none; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}

/* ---------- Booking / modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(17, 50, 51, 0.5);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none; transition: opacity .3s var(--ease);
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal-card {
  width: 100%; max-width: 540px; max-height: calc(100dvh - 48px); overflow-y: auto;
  background: var(--paper); border-radius: var(--radius-m);
  border: 1px solid var(--bone); box-shadow: var(--shadow-2);
  position: relative; padding: 40px;
  transform: translateY(18px) scale(0.98);
  transition: transform .35s var(--ease);
}
.modal-overlay.active .modal-card { transform: translateY(0) scale(1); }

.modal-close {
  position: absolute; top: 18px; right: 18px; width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--bone); border-radius: var(--radius-s);
  color: var(--ink-600); font-size: 18px; background: var(--ivory-800);
  transition: all .2s var(--ease);
}
.modal-close:hover { border-color: var(--danger); color: var(--danger); transform: rotate(90deg); }

.modal-kicker { font-family: var(--font-label); font-size: 11px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--bronze); margin-bottom: 10px; }
.modal-header h3 { font-size: 30px; letter-spacing: -0.01em; margin-bottom: 10px; }
.modal-header p { color: var(--ink-400); font-size: 14.5px; margin-bottom: 26px; }

.form-group { margin-bottom: 18px; display: flex; flex-direction: column; gap: 7px; }
.form-group label { font-family: var(--font-label); font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-600); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 14px 16px;
  border: 1px solid var(--bone); background: var(--ivory-800);
  border-radius: var(--radius-s); font-size: 15px; color: var(--ink);
  transition: border-color .2s var(--ease), background-color .2s var(--ease), box-shadow .2s var(--ease);
}
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--ink-300); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--teal); background: var(--paper);
  box-shadow: 0 0 0 3px rgba(14,110,98,0.14);
}
.btn-form-submit { width: 100%; padding: 17px; margin-top: 8px; }

.modal-note {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--teal-soft); border: 1px solid rgba(14,110,98,0.2);
  padding: 12px 14px; border-radius: var(--radius-s); margin-bottom: 18px;
  font-size: 13px; color: var(--teal-ink);
}
.modal-note i { color: var(--teal); margin-top: 2px; }

@media (max-width: 640px) {
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal-card { max-height: calc(100dvh - 8px); max-width: 100%; border-radius: var(--radius-m) var(--radius-m) 0 0; padding: 32px 20px calc(20px + env(safe-area-inset-bottom)); }
}

/* ---------- Toast ---------- */
.toast-notification {
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  border-radius: var(--radius-m);
}

/* ---------- Footer ---------- */
.footer {
  background: var(--ink); color: #C7D3D0;
  border-top: 4px solid var(--teal);
  padding: 76px 0 0;
  font-size: 15px;
}
.footer-top { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.3fr; gap: 44px; padding-bottom: 56px; }

.footer-brand .logo-text { color: var(--ivory-800); font-size: 26px; display: inline-flex; gap: 8px; align-items: baseline; }
.footer-brand .logo-text .logo-accent { color: var(--bronze-soft); }
.footer-brand .logo-mark { background: var(--ivory-800); color: var(--ink); width: 38px; height: 38px; vertical-align: middle; }
.footer-brand p { color: #B9C5C2; margin: 18px 0 22px; max-width: 320px; line-height: 1.7; }

.footer-col h4 {
  font-family: var(--font-label); font-size: 12px; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--ivory-800);
  margin-bottom: 22px; display: inline-flex; align-items: center; gap: 10px;
}
.footer-col h4::after { content: ''; width: 26px; height: 2px; background: var(--bronze); }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.footer-col ul a { color: #B9C5C2; }
.footer-col ul a:hover { color: var(--bronze-soft); transform: translateX(3px); }

.footer-socials { display: flex; gap: 10px; }
.social-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06); color: #C7D3D0; font-size: 17px;
  border: 1px solid rgba(255,255,255,0.12);
  transition: all .25s var(--ease);
}
.social-btn:hover { background: var(--teal); color: var(--ivory-800); border-color: var(--teal); transform: translateY(-3px); }

.footer-contact-item { display: flex; gap: 12px; margin-bottom: 14px; align-items: flex-start; color: #B9C5C2; }
.footer-contact-item i { color: var(--bronze-soft); font-size: 18px; margin-top: 2px; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 26px 0 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 13px; color: #93A5A1;
}
.footer-policies { display: flex; gap: 22px; }
.footer-policies a:hover { color: var(--ivory-800); }

@media (max-width: 1023px) { .footer-top { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) {
  .footer { padding-top: 56px; }
  .footer-top { grid-template-columns: 1fr; gap: 36px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .emergency-actions a[href*="wa.me"],
  .emergency-actions .emergency-sep {
    display: none;
  }
}

/* ---------- Reveal system (JS adds classes) ---------- */
[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
[data-reveal].revealed { opacity: 1; transform: none; }
[data-reveal="left"] { transform: translateX(-30px); }
[data-reveal="right"] { transform: translateX(30px); }
[data-reveal="scale"] { transform: scale(0.94); }
[data-reveal="rotate"] { transform: perspective(1000px) rotateX(10deg) translateY(24px); transform-origin: top; }
[data-reveal].revealed { transform: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}