/* Core styles shared by every page. Generated from the former main.css. */
/* ==========================================================================
   Editorial Care — Design System & Main Stylesheet
   Phòng khám Sản phụ khoa Thiên Phúc (BS CKI Vũ Thị Thơi)
   ========================================================================== */

/* 1. DESIGN TOKENS */
:root {
  /* Bảng màu Editorial Care */
  --color-ink: #202622;
  --color-ink-soft: #55605a;
  --color-paper: #f7f4ee;
  --color-surface: #fffdf9;
  --color-sage: #71857a;
  --color-sage-soft: #dce5df;
  --color-sage-light: #eef3f0;
  --color-terracotta: #a84f45;
  --color-terracotta-dark: #843b34;
  --color-terracotta-soft: #f8eeeb;
  --color-peach: #efd5c9;
  --color-line: #d9d8d1;
  --color-line-light: #eae8e1;
  --color-white: #ffffff;
  --color-danger: #a33131;

  /* Typography Fluid Scales */
  --font-display: "Lora", "Noto Serif", Georgia, serif;
  --font-sans: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --step--1: clamp(0.85rem, 0.82rem + 0.16vw, 0.95rem);
  --step-0: clamp(1rem, 0.95rem + 0.24vw, 1.125rem);
  --step-1: clamp(1.2rem, 1.08rem + 0.6vw, 1.5rem);
  --step-2: clamp(1.5rem, 1.3rem + 1.1vw, 2.1rem);
  --step-3: clamp(2rem, 1.6rem + 2vw, 3rem);
  --step-4: clamp(2.5rem, 1.9rem + 3vw, 4.2rem);

  /* Spacing */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 40px;
  --space-xl: 64px;
  --space-2xl: clamp(64px, 8vw, 120px);

  /* Transitions & Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast: 160ms;
  --duration-base: 320ms;
  --duration-slow: 650ms;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;

  /* Shadows */
  --shadow-subtle: 0 4px 20px rgba(32, 38, 34, 0.05);
  --shadow-card: 0 8px 30px rgba(32, 38, 34, 0.07);
}

/* 2. BASE & RESET */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.68;
  color: var(--color-ink);
  background-color: var(--color-paper);
  overflow-x: hidden;
}

/* Cánh hoa hồng phấn: lớp trang trí nhẹ, không chặn tương tác. */
.soft-petal-fall {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  pointer-events: none;
}

.soft-petal {
  --petal-x: 50vw;
  --petal-size: 15px;
  --petal-duration: 18s;
  --petal-delay: 0s;
  --petal-drift: 28px;
  position: absolute;
  top: -12vh;
  left: var(--petal-x);
  width: var(--petal-size);
  height: calc(var(--petal-size) * 1.45);
  border-radius: 75% 25% 70% 30%;
  background: linear-gradient(145deg, rgba(224, 124, 148, 0.82), rgba(247, 190, 202, 0.58));
  box-shadow: inset 1px 1px 2px rgba(255, 255, 255, 0.62), 0 2px 5px rgba(154, 78, 98, 0.08);
  opacity: 0;
  will-change: transform, opacity;
  animation: soft-petal-drift var(--petal-duration) linear var(--petal-delay) infinite;
}

.soft-petal::after {
  content: "";
  position: absolute;
  inset: 18% 47% 18% auto;
  width: 1px;
  border-radius: 999px;
  background: rgba(157, 72, 94, 0.3);
  transform: rotate(16deg);
}

.soft-petal--1  { --petal-x: 5vw;  --petal-size: 14px; --petal-duration: 19s; --petal-delay: -8s;  --petal-drift: 34px; }
.soft-petal--2  { --petal-x: 16vw; --petal-size: 17px; --petal-duration: 24s; --petal-delay: -17s; --petal-drift: -25px; }
.soft-petal--3  { --petal-x: 28vw; --petal-size: 12px; --petal-duration: 17s; --petal-delay: -3s;  --petal-drift: 22px; }
.soft-petal--4  { --petal-x: 39vw; --petal-size: 16px; --petal-duration: 22s; --petal-delay: -13s; --petal-drift: -36px; }
.soft-petal--5  { --petal-x: 52vw; --petal-size: 13px; --petal-duration: 20s; --petal-delay: -6s;  --petal-drift: 30px; }
.soft-petal--6  { --petal-x: 63vw; --petal-size: 18px; --petal-duration: 26s; --petal-delay: -21s; --petal-drift: -30px; }
.soft-petal--7  { --petal-x: 72vw; --petal-size: 13px; --petal-duration: 18s; --petal-delay: -11s; --petal-drift: 27px; }
.soft-petal--8  { --petal-x: 81vw; --petal-size: 16px; --petal-duration: 23s; --petal-delay: -4s;  --petal-drift: -23px; }
.soft-petal--9  { --petal-x: 90vw; --petal-size: 12px; --petal-duration: 21s; --petal-delay: -15s; --petal-drift: 32px; }
.soft-petal--10 { --petal-x: 96vw; --petal-size: 15px; --petal-duration: 25s; --petal-delay: -9s;  --petal-drift: -28px; }

@keyframes soft-petal-drift {
  0% {
    opacity: 0;
    transform: translate3d(0, -10vh, 0) rotate(0deg);
  }
  10% {
    opacity: 0.52;
  }
  88% {
    opacity: 0.42;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--petal-drift), 120vh, 0) rotate(430deg);
  }
}

@media (max-width: 768px) {
  .soft-petal:nth-child(n + 7) {
    display: none;
  }

  .soft-petal {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .soft-petal-fall {
    display: none;
  }
}

img,
picture,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

button,
input,
select,
textarea {
  font: inherit;
}

ul,
ol {
  list-style: none;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.25;
  color: var(--color-ink);
}

h1 {
  font-size: var(--step-4);
}

h2 {
  font-size: var(--step-3);
}

h3 {
  font-size: var(--step-2);
}

h4 {
  font-size: var(--step-1);
}

/* 3. LAYOUT UTILITIES */
.container {
  width: min(100% - 32px, 1240px);
  margin-inline: auto;
}

.page-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(16px, 2.5vw, 32px);
  width: min(100% - 32px, 1240px);
  margin-inline: auto;
}

.section-spacing {
  padding-block: var(--space-2xl);
}

.bg-surface {
  background-color: var(--color-surface);
}

.bg-paper {
  background-color: var(--color-paper);
}

/* 4. BUTTONS & CTA */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-weight: 500;
  font-size: var(--step-0);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-out);
  border: 1px solid transparent;
  text-align: center;
}

.btn-primary {
  background-color: var(--color-terracotta);
  color: var(--color-white);
}

.btn-primary:hover {
  background-color: var(--color-terracotta-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(168, 79, 69, 0.25);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-ink);
  border-color: var(--color-line);
}

.btn-secondary:hover {
  border-color: var(--color-ink);
  background-color: rgba(32, 38, 34, 0.03);
}

.btn-outline-terracotta {
  background-color: transparent;
  color: var(--color-terracotta);
  border-color: var(--color-terracotta);
}

.btn-outline-terracotta:hover {
  background-color: var(--color-terracotta);
  color: var(--color-white);
}

.btn-zalo {
  background-color: #0068ff;
  color: var(--color-white);
}

.btn-zalo:hover {
  background-color: #0056d6;
  transform: translateY(-1px);
}

.btn-sm {
  padding: 8px 16px;
  font-size: var(--step--1);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.1rem;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-terracotta);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: gap var(--duration-fast) var(--ease-out);
}

.text-link:hover {
  color: var(--color-terracotta-dark);
  gap: 10px;
}

/* 5. SITE HEADER */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: rgba(247, 252, 250, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(63, 127, 120, 0.14);
  box-shadow: 0 4px 20px rgba(24, 63, 59, 0.04);
  transition: all var(--duration-base) var(--ease-out);
}

.header-inner {
  width: min(100% - 48px, 1360px);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(16px, 2.5vw, 40px);
  padding-block: 12px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  text-decoration: none;
}

.brand-logo-mark {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(36, 92, 87, 0.25);
  border: 1.5px solid rgba(36, 92, 87, 0.12);
}

.brand-text h1,
.brand-title {
  font-size: 1.12rem;
  font-family: var(--font-ios, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  font-weight: 700;
  color: #183330;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.brand-subtitle {
  font-size: 0.76rem;
  color: #4f8f87;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  display: block;
  margin-top: 1px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.4vw, 22px);
}

.nav-link {
  font-family: var(--font-ios, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  font-size: 0.94rem;
  font-weight: 550;
  color: #2d4844;
  padding: 6px 10px;
  border-radius: 8px;
  position: relative;
  white-space: nowrap;
  letter-spacing: 0.05px;
  transition: color 180ms ease, background-color 180ms ease;
  text-decoration: none;
}

.nav-link:hover {
  color: #245c57;
  background-color: rgba(63, 127, 120, 0.08);
}

.nav-link.active {
  color: #245c57;
  font-weight: 650;
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 10px;
  right: 10px;
  height: 2.5px;
  background-color: #245c57;
  border-radius: 999px;
}

/* SERVICE NAVIGATION DROPDOWN */
.nav-service-menu {
  position: relative;
}

.nav-service-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.nav-service-chevron {
  flex: 0 0 auto;
  transition: transform 200ms ease;
}

.service-submenu {
  position: absolute;
  top: 100%;
  left: 50%;
  width: min(660px, calc(100vw - 32px));
  padding-top: 14px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px);
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

.service-submenu-panel {
  padding: 18px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(63, 127, 120, 0.18);
  border-radius: 18px;
  box-shadow: 0 22px 54px rgba(24, 63, 59, 0.16);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.nav-service-menu:hover .service-submenu,
.nav-service-menu.is-open .service-submenu {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.nav-service-menu:hover .nav-service-chevron,
.nav-service-menu.is-open .nav-service-chevron {
  transform: rotate(180deg);
}

.service-submenu-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 2px 4px 14px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(63, 127, 120, 0.13);
}

.service-submenu-head strong {
  display: block;
  color: #183330;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
}

.service-submenu-kicker {
  display: block;
  margin-bottom: 2px;
  color: #5a7b76;
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.service-submenu-all {
  flex: 0 0 auto;
  color: #2e6c65;
  font-size: 0.82rem;
  font-weight: 650;
}

.service-submenu-all:hover {
  color: #183f3b;
}

.service-submenu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.service-submenu-link {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) 15px;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 11px 12px;
  color: #36514d;
  border-radius: 11px;
  font-size: 0.82rem;
  font-weight: 550;
  line-height: 1.4;
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.service-submenu-link:hover,
.service-submenu-link.active {
  color: #1f5a54;
  background: rgba(63, 127, 120, 0.09);
  transform: translateX(2px);
}

.service-submenu-link svg {
  color: #7a9b96;
}

.service-submenu-dot {
  width: 7px;
  height: 7px;
  background: #89aaa5;
  border-radius: 50%;
}

.service-submenu-link.active .service-submenu-dot {
  background: #a84f45;
  box-shadow: 0 0 0 3px rgba(168, 79, 69, 0.12);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: clamp(14px, 1.8vw, 24px);
  flex-shrink: 0;
}

.header-phone-box {
  display: flex;
  flex-direction: column;
  text-align: right;
  text-decoration: none;
}

.header-phone-label {
  font-size: 0.72rem;
  color: #587a75;
  line-height: 1.2;
}

.header-phone-number {
  font-family: var(--font-ios, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  font-size: 1rem;
  font-weight: 700;
  color: #245c57;
  letter-spacing: 0.2px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  transition: color var(--duration-fast) var(--ease-out);
  text-decoration: none;
}

.header-phone-number:hover {
  color: #183f3b;
}

.header-cta-btn {
  padding: 9px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 999px;
  background-color: #245c57 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(36, 92, 87, 0.22);
  border: 1px solid rgba(36, 92, 87, 0.35);
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: background-color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}

.header-cta-btn:hover {
  background-color: #183f3b !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(24, 63, 59, 0.28);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: #183330;
  border-radius: var(--radius-sm);
  transition: background-color var(--duration-fast) var(--ease-out);
}

.mobile-menu-btn:hover {
  background-color: rgba(63, 127, 120, 0.1);
}

.mobile-nav-footer {
  display: none;
}

@media (max-width: 992px) {
  .site-nav.open {
    max-height: calc(100dvh - 68px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .nav-service-menu {
    width: 100%;
  }

  .nav-service-trigger {
    width: 100%;
    justify-content: space-between;
    text-align: left;
  }

  .nav-service-trigger.active::after {
    display: none;
  }

  .service-submenu {
    position: static;
    width: 100%;
    display: grid;
    grid-template-rows: 0fr;
    padding: 0;
    visibility: visible;
    opacity: 0;
    pointer-events: none;
    transform: none;
    transition: grid-template-rows 240ms ease, opacity 180ms ease;
  }

  .service-submenu-panel {
    min-height: 0;
    padding: 0 12px;
    overflow: hidden;
    background: rgba(232, 244, 241, 0.72);
    border: 0;
    border-radius: 12px;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .nav-service-menu:hover .service-submenu,
  .nav-service-menu:focus-within .service-submenu {
    grid-template-rows: 0fr;
    opacity: 0;
    pointer-events: none;
    transform: none;
  }

  .nav-service-menu.is-open .service-submenu,
  .nav-service-menu.is-open:hover .service-submenu,
  .nav-service-menu.is-open:focus-within .service-submenu {
    grid-template-rows: 1fr;
    margin-top: 5px;
    opacity: 1;
    pointer-events: auto;
  }

  .nav-service-menu:hover .nav-service-chevron,
  .nav-service-menu:focus-within .nav-service-chevron {
    transform: none;
  }

  .nav-service-menu.is-open .nav-service-chevron {
    transform: rotate(180deg);
  }

  .service-submenu-head {
    align-items: center;
    padding: 13px 2px 10px;
  }

  .service-submenu-head strong {
    font-size: 0.92rem;
  }

  .service-submenu-kicker {
    display: none;
  }

  .service-submenu-grid {
    grid-template-columns: 1fr;
    gap: 2px;
    padding-bottom: 10px;
  }

  .service-submenu-link {
    padding: 9px 6px;
    font-size: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .service-submenu,
  .nav-service-chevron,
  .service-submenu-link {
    transition: none;
  }
}

/* 6. SHARED MOBILE STICKY CTA
   One component and one visual treatment for every page. */
.mobile-sticky-cta {
  display: none;
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 999;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 253, 249, 0.97);
  border-top: 1px solid rgba(63, 127, 120, 0.2);
  box-shadow: 0 -4px 16px rgba(24, 63, 59, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.mobile-cta-inner {
  display: grid;
  grid-template-columns: 0.78fr 0.82fr 1.4fr;
  gap: 8px;
  width: min(100%, 520px);
  margin-inline: auto;
}

.mobile-cta-btn {
  display: flex;
  min-width: 0;
  min-height: 60px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  padding: 8px 4px;
  color: #245c57;
  background: #f7fbfa;
  border: 1px solid rgba(36, 92, 87, 0.2);
  border-radius: 4px;
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.mobile-cta-btn svg {
  flex: 0 0 auto;
}

.mobile-cta-book {
  color: #ffffff;
  background: #245c57;
  border-color: #245c57;
  font-weight: 700;
}

.mobile-cta-btn:focus-visible {
  outline: 3px solid rgba(79, 143, 135, 0.4);
  outline-offset: 2px;
}

@media (max-width: 992px) {
  body {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }

  .mobile-sticky-cta {
    display: block;
  }
}
