/* ==========================================================================
   DC Clinic - Responsive Stylesheet
   Breakpoints: Desktop (1920), Laptop (1440), Tablet (1024), Mobile (768), Small Mobile (390)
   Mobile-first approach
   ========================================================================== */

/* ==========================================================================
   Small Mobile (390px and below)
   ========================================================================== */
@media (max-width: 390px) {
  :root {
    --dc-text-display: 28px;
    --dc-text-headline-lg: 24px;
    --dc-text-headline-md: 20px;
    --dc-text-body-lg: 16px;
    --dc-space-xl: 48px;
    --dc-gutter: 16px;
  }

  .dc-hero {
    min-height: auto;
    padding-top: 40px;
    padding-bottom: 40px;
  }

  .dc-hero__buttons {
    flex-direction: column;
  }

  .dc-hero__buttons .btn-dc-primary,
  .dc-hero__buttons .btn-dc-outline {
    width: 100%;
  }

  .dc-service-card {
    height: 350px;
  }

  .dc-service-card__content {
    padding: 24px;
  }

  .dc-card {
    padding: 24px;
  }

  .dc-package-card__body {
    padding: 24px;
  }

  .dc-footer {
    padding-top: 48px;
  }

  .dc-cta {
    padding: 48px 16px;
  }

  .dc-cta__buttons {
    flex-direction: column;
  }

  .dc-cta__buttons .btn-dc-gold,
  .dc-cta__buttons .btn-dc-ghost-light {
    width: 100%;
  }

  .dc-back-to-top {
    bottom: 16px;
    right: 16px;
  }
}

/* ==========================================================================
   Mobile Premium App Experience (390px optimized)
   8px spacing system | 60fps performance | Native app feel
   ========================================================================== */
@media (max-width: 768px) {
  /* ========== CSS Variables for Mobile ========== */
  :root {
    --dc-header-height: 60px;
    --dc-announcement-height: 36px;
    --dc-bottom-nav-height: 72px;
    --dc-text-display: 28px;
    --dc-text-headline-lg: 24px;
    --dc-text-headline-md: 18px;
    --dc-text-body-lg: 15px;
    --dc-text-body: 14px;
    --dc-space-section: 48px;
    --dc-space-card: 24px;
    --dc-space-text: 16px;
    --dc-space-btn: 16px;
    --dc-safe-bottom: calc(var(--dc-bottom-nav-height) + 16px);
  }

  html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
  }

  body {
    font-size: 14px;
    padding-top: var(--dc-header-height);
    padding-bottom: var(--dc-bottom-nav-height);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    overflow-x: clip;
  }

  html {
    overflow-x: clip;
  }

  /* Prevent body scroll when menu open */
  body.menu-open {
    overflow: hidden;
  }

  /* ========== Mobile Header (60px) ========== */
  .dc-header {
    height: var(--dc-header-height);
    padding: 0 16px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .dc-header__inner {
    height: 100%;
    gap: 8px;
  }

  .dc-header__logo {
    font-size: 16px;
    max-height: 32px;
  }

  .dc-header__logo img {
    max-height: 32px;
    width: auto;
  }

  .dc-header__cta > *:not(.dc-menu-toggle),
  .dc-header__actions {
    display: none;
  }

  .dc-header__cta {
    display: flex !important;
    align-items: center;
  }

  .dc-menu-toggle {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  /* ========== Announcement Bar (36px, scrolling text) ========== */
  .dc-announcement {
    height: var(--dc-announcement-height);
    min-height: var(--dc-announcement-height);
    max-height: var(--dc-announcement-height);
    padding: 0 16px;
    overflow: hidden;
  }

  .dc-announcement__inner {
    height: 100%;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .dc-announcement__text {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    flex: 1;
    min-width: 0;
  }

  .dc-announcement__text span:last-child {
    display: inline-block;
    animation: dc-marquee 15s linear infinite;
  }

  @keyframes dc-marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
  }

  .dc-announcement__text .material-symbols-outlined {
    font-size: 14px;
    flex-shrink: 0;
  }

  .dc-announcement__cta {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    border-radius: 4px;
  }

  .dc-announcement__close {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
  }

  .dc-announcement__close .material-symbols-outlined {
    font-size: 16px;
  }

  /* ========== Hero Section (tight spacing) ========== */
  .dc-hero {
    padding-top: 16px;
    min-height: auto;
  }

  .dc-hero__content {
    padding: 16px 0 24px;
  }

  .dc-container {
    padding-left: 24px;
    padding-right: 24px;
  }

  /* Hero Typography (2 lines heading, 3 lines body) */
  .dc-hero h1,
  .dc-hero__title {
    font-size: 26px;
    line-height: 1.2;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .dc-hero p,
  .dc-hero__desc {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--dc-on-surface-variant);
  }

  /* Hero Buttons (auto width, inline) */
  .dc-hero__buttons {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .dc-hero__buttons a {
    width: auto;
    padding: 12px 20px;
    font-size: 14px;
    min-height: 44px;
  }

  .dc-hero__buttons a:first-child {
    flex: 1;
    min-width: 140px;
  }

  /* Hero Stats */
  .dc-hero__stats,
  .dc-stats {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 20px;
  }

  .dc-stat {
    flex: 1;
    min-width: 80px;
    text-align: center;
  }

  .dc-stat__value {
    font-size: 20px;
  }

  .dc-stat__label {
    font-size: 10px;
  }

  /* Hero Image (better cropping) */
  .dc-hero__bg,
  .dc-hero__image {
    object-position: center 30%;
  }

  /* ========== Sections (8px system) ========== */
  .dc-section {
    padding-top: var(--dc-space-section);
    padding-bottom: var(--dc-space-section);
  }

  .section-header {
    margin-bottom: 20px;
    text-align: center;
  }

  .section-header h2 {
    font-size: 22px;
    margin-bottom: 8px;
  }

  .section-header p {
    font-size: 14px;
  }

  .label-caps {
    font-size: 10px;
    margin-bottom: 4px;
  }

  /* ========== Cards ========== */
  .dc-card {
    padding: var(--dc-space-card);
    border-radius: 4px;
  }

  .dc-service-card {
    height: 280px;
    border-radius: 4px;
  }

  .dc-service-card__content {
    padding: 16px;
  }

  .dc-service-card__content h3 {
    font-size: 16px;
  }

  .dc-service-card__content p {
    font-size: 13px;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  /* ========== Grids ========== */
  .dc-grid-2,
  .dc-grid-3,
  .dc-grid-4 {
    gap: 16px;
  }

  /* ========== Buttons (touch-friendly) ========== */
  .btn-dc-primary,
  .btn-dc-outline,
  .btn-dc-gold,
  .btn-dc-ghost-light {
    min-height: 44px;
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 4px;
  }

  /* ========== Bottom Navigation (72px) ========== */
  .dc-mobile-nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--dc-bottom-nav-height);
    max-height: 80px;
    background: #fff;
    border-top: 1px solid rgba(196, 198, 207, 0.15);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 16px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
  }

  .dc-mobile-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 12px;
    text-decoration: none;
    color: var(--dc-on-surface-variant);
    font-size: 11px;
    font-weight: 500;
    transition: color 0.2s ease;
    position: relative;
    min-width: 56px;
  }

  .dc-mobile-nav__item .material-symbols-outlined {
    font-size: 24px;
    transition: transform 0.2s ease;
  }

  .dc-mobile-nav__item span:last-child {
    font-size: 10px;
    letter-spacing: 0.02em;
  }

  /* Active state */
  .dc-mobile-nav__item.active,
  .dc-mobile-nav__item--active {
    color: var(--dc-gold);
  }

  .dc-mobile-nav__item.active .material-symbols-outlined,
  .dc-mobile-nav__item--active .material-symbols-outlined {
    background: rgba(197, 160, 89, 0.12);
    border-radius: 50%;
    padding: 6px;
    margin: -6px;
  }

  /* ========== Floating Appointment Button (64px, centered) ========== */
  .dc-mobile-nav__item--cta {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(var(--dc-bottom-nav-height) + 8px);
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--dc-gold) 0%, #D4AF37 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(197, 160, 89, 0.35);
    z-index: 1001;
    padding: 0;
    min-width: auto;
  }

  .dc-mobile-nav__item--cta .material-symbols-outlined {
    font-size: 24px;
    color: #fff;
    background: none;
    padding: 0;
    margin: 0;
  }

  .dc-mobile-nav__item--cta span:last-child {
    display: none;
  }

  /* ========== Floating Widgets (safe area spacing) ========== */
  .dc-social-bar {
    bottom: var(--dc-safe-bottom);
    right: 16px;
  }

  .dc-social-bar__btn {
    width: 44px;
    height: 44px;
  }

  .dc-chat-widget__fab {
    width: 52px;
    height: 52px;
    bottom: var(--dc-safe-bottom);
    right: 16px;
    box-shadow: 0 4px 16px rgba(10, 25, 47, 0.2);
  }

  .dc-chat-widget__fab .material-symbols-outlined {
    font-size: 24px;
  }

  .dc-chat-widget__panel {
    width: calc(100vw - 32px);
    max-width: 360px;
    bottom: calc(var(--dc-safe-bottom) + 60px);
    right: 16px;
    max-height: 60vh;
  }

  .dc-back-to-top {
    bottom: var(--dc-safe-bottom);
    right: 16px;
  }

  /* ========== Cookie Banner (28vh max, stacked buttons) ========== */
  .dc-cookie-consent {
    max-height: 28vh;
    padding: 16px;
    flex-direction: column;
    gap: 12px;
    bottom: var(--dc-bottom-nav-height);
    border-radius: 4px;
    overflow-y: auto;
  }

  .dc-cookie-consent__icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }

  .dc-cookie-consent__title {
    font-size: 15px;
  }

  .dc-cookie-consent__text {
    font-size: 12px;
    line-height: 1.5;
  }

  .dc-cookie-consent__buttons {
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .dc-cookie-consent__buttons button {
    width: 100%;
    min-height: 40px;
  }

  /* ========== Forms ========== */
  input,
  textarea,
  select {
    min-height: 44px;
    font-size: 16px;
    padding: 10px 12px;
    border-radius: 4px;
  }

  /* ========== Footer ========== */
  .dc-footer {
    padding-top: var(--dc-space-section);
    padding-bottom: calc(var(--dc-bottom-nav-height) + 24px);
  }

  .dc-footer__grid {
    gap: 24px;
    grid-template-columns: 1fr;
  }

  .dc-footer__col {
    grid-column: span 1 !important;
  }

  .dc-footer__logo {
    font-size: 18px;
  }

  /* Footer accordion for mobile */
  .dc-footer__col:not(.dc-footer__col--brand) .dc-footer__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 12px 0;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
    font-weight: 600;
    -webkit-tap-highlight-color: transparent;
  }

  .dc-footer__col:not(.dc-footer__col--brand) .dc-footer__heading::after {
    content: '+';
    font-size: 18px;
    font-weight: 300;
    transition: transform 0.3s ease;
    flex-shrink: 0;
  }

  .dc-footer__col:not(.dc-footer__col--brand).is-open .dc-footer__heading::after {
    transform: rotate(45deg);
  }

  .dc-footer__col:not(.dc-footer__col--brand) .dc-footer__links,
  .dc-footer__col:not(.dc-footer__col--brand) .dc-footer__map,
  .dc-footer__col:not(.dc-footer__col--brand) .dc-footer__newsletter {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease, margin 0.2s ease;
    opacity: 0;
    margin-top: 0;
  }

  .dc-footer__col:not(.dc-footer__col--brand).is-open .dc-footer__links,
  .dc-footer__col:not(.dc-footer__col--brand).is-open .dc-footer__map,
  .dc-footer__col:not(.dc-footer__col--brand).is-open .dc-footer__newsletter {
    max-height: 500px;
    opacity: 1;
    margin-top: 12px;
  }

  /* ========== Testimonials ========== */
  .dc-testimonial {
    padding: 20px;
    border-radius: 4px;
  }

  .dc-testimonial-slider {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .dc-testimonial-slider::-webkit-scrollbar {
    display: none;
  }

  .dc-testimonial-slider__slide {
    scroll-snap-align: start;
    min-width: 85vw;
  }

  /* ========== FAQ ========== */
  .dc-faq-question {
    padding: 14px 16px;
    font-size: 14px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* ========== CTA Section ========== */
  .dc-cta {
    padding: 40px 24px;
  }

  .dc-cta__title {
    font-size: 22px;
  }

  .dc-cta__desc {
    font-size: 14px;
  }

  .dc-cta__buttons {
    flex-direction: column;
    gap: 10px;
  }

  .dc-cta__buttons a {
    width: 100%;
  }

  /* ========== Performance Optimizations ========== */
  * {
    -webkit-tap-highlight-color: transparent;
  }

  .dc-card,
  .dc-service-card,
  .dc-testimonial,
  .btn-dc-primary,
  .btn-dc-outline,
  .btn-dc-gold {
    will-change: transform;
    transform: translateZ(0);
  }

  /* Reduce motion for performance */
  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }
}

/* ==========================================================================
   Desktop (above 1024px) — hide mobile menu elements
   ========================================================================== */
@media (min-width: 1025px) {
  .dc-mobile-menu,
  .dc-mobile-menu-overlay {
    display: none !important;
  }
}

/* ==========================================================================
   Tablet (1024px and below)
   ========================================================================== */
@media (max-width: 1024px) {
  .dc-nav {
    display: none;
  }

  .dc-menu-toggle {
    display: flex;
  }

  .dc-hero__content .row > div:last-child {
    display: none;
  }
}

/* ==========================================================================
   Small Mobile (375px and below) - iPhone SE/Mini safety
   ========================================================================== */
@media (max-width: 375px) {
  :root {
    --dc-text-display: 24px;
    --dc-text-headline-lg: 20px;
    --dc-text-headline-md: 16px;
  }

  .dc-container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .dc-hero h1,
  .dc-hero__title {
    font-size: 22px;
  }

  .dc-hero__buttons {
    flex-direction: column;
    gap: 8px;
  }

  .dc-hero__buttons a {
    width: 100%;
    text-align: center;
  }

  .dc-section {
    padding-top: 32px;
    padding-bottom: 32px;
  }

  .dc-card {
    padding: 16px;
  }

  .dc-service-card {
    height: 240px;
  }

  .dc-mobile-nav__item {
    padding: 4px 8px;
    min-width: 48px;
  }

  .dc-mobile-nav__item span:last-child {
    font-size: 9px;
  }

  .dc-cta {
    padding: 32px 16px;
  }
}

/* ==========================================================================
   Extra Small (320px) - Prevent overflow
   ========================================================================== */
@media (max-width: 320px) {
  body {
    font-size: 13px;
  }

  .dc-hero h1,
  .dc-hero__title {
    font-size: 20px;
  }

  .dc-mobile-nav__item span:last-child {
    display: none;
  }

  .dc-mobile-nav__item {
    min-width: 40px;
  }
}

/* ==========================================================================
   Laptop (1440px and below)
   ========================================================================== */
@media (max-width: 1440px) {
  :root {
    --dc-container-max: 1200px;
  }
}

/* ==========================================================================
   Desktop (1920px)
   ========================================================================== */
@media (min-width: 1441px) {
  :root {
    --dc-container-max: 1280px;
  }
}

/* ==========================================================================
   Responsive Grid Helpers
   ========================================================================== */
.dc-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--dc-gutter);
}

@media (min-width: 768px) {
  .dc-grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.dc-grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--dc-gutter);
}

@media (min-width: 768px) {
  .dc-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .dc-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.dc-grid-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--dc-gutter);
}

@media (min-width: 1024px) {
  .dc-grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Responsive Bento Grid for Services */
.dc-bento-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 768px) {
  .dc-bento-grid {
    grid-template-columns: repeat(12, 1fr);
  }
}

.dc-bento-grid > .dc-bento-7 { grid-column: span 12; }
.dc-bento-grid > .dc-bento-5 { grid-column: span 12; }

@media (min-width: 768px) {
  .dc-bento-grid > .dc-bento-7 { grid-column: span 7; }
  .dc-bento-grid > .dc-bento-5 { grid-column: span 5; }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
  .dc-header,
  .dc-footer,
  .dc-mobile-menu,
  .dc-cta,
  .dc-back-to-top {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
    padding-top: 0;
  }
}
