/* ═══════════════════════════════════════════════════════════
   Der Detailer – Tablet & Smartphone
   Breakpoints: 1024 · 900 · 768 · 480 · 380
   ═══════════════════════════════════════════════════════════ */

/* ── Basis: Touch & Safe Areas ── */
@media (max-width: 1024px) {
  .container {
    width: min(1140px, 94vw);
  }

  .lux-ablauf-steps {
    width: min(1140px, 94vw);
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .why-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-hub-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .album-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── Tablet (≤900px) ── */
@media (max-width: 900px) {
  :root {
    --header-h: 68px;
  }

  html {
    scroll-padding-top: calc(var(--header-h) + 0.5rem);
  }

  body {
    font-size: 0.95rem;
  }

  /* Abstand für Sticky-CTA unten */
  body.has-sticky-cta {
    padding-bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
  }

  .section {
    padding-bottom: 3rem;
  }

  .section-head {
    padding: 2.25rem 0 1.75rem;
    margin-bottom: 1.75rem;
  }

  .section-head h2,
  .page-hero .section-head h1 {
    font-size: clamp(1.5rem, 5.5vw, 2.1rem);
  }

  .section-intro {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  #app > .section:first-child:not(.hero),
  #app > .premium-band.page-hero-band:first-child,
  #site-main > .section:first-child:not(.hero),
  #site-main > .premium-band.page-hero-band:first-child {
    padding-top: calc(var(--header-h) + 1.25rem);
  }

  .trust-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  .stats {
    padding: 2rem 0;
  }

  .salon-grid {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .salon-media {
    max-height: min(280px, 40vh);
    aspect-ratio: 16 / 10;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .salon-copy {
    padding: 2rem 1.5rem;
    border-left: none;
    border-top: 3px solid var(--yellow);
  }

  .steps {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .step {
    padding: 1.5rem 1rem;
  }

  .compare-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .g-large {
    grid-row: auto;
  }

  .contact-grid,
  .packages-grid {
    grid-template-columns: 1fr;
  }

  .premium-band-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
    text-align: left;
  }

  .premium-band-inner .btn {
    width: 100%;
    min-height: 52px;
  }

  .cta-band {
    padding: 3rem 0;
  }

  .cta-band h2 {
    font-size: clamp(1.35rem, 5vw, 1.75rem);
  }

  .cta-band-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .cta-band-actions .btn {
    width: 100%;
    min-height: 52px;
  }

  .section-cta-wrap {
    flex-direction: column;
    align-items: stretch;
    margin-top: 2rem;
  }

  .section-cta-wrap .btn {
    width: 100%;
    min-height: 52px;
  }

  .footer {
    padding: 2.5rem 0 calc(2rem + env(safe-area-inset-bottom, 0px));
  }

  .footer-inner {
    flex-direction: column;
    gap: 1.25rem;
    text-align: center;
  }

  .footer nav,
  .footer-nav {
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
  }

  .footer nav a,
  .footer-nav a {
    padding: 0.35rem 0;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* Karussell Galerie */
  .carousel-main {
    position: relative;
    display: block;
    padding: 0.5rem;
  }

  .carousel-slide {
    width: 100%;
  }

  .carousel-main-img {
    max-height: min(50vh, 420px);
    width: 100%;
  }

  .carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
    background: rgba(0, 0, 0, 0.65);
    -webkit-tap-highlight-color: transparent;
  }

  .carousel-prev {
    left: 0.65rem;
  }

  .carousel-next {
    right: 0.65rem;
  }

  .carousel-thumbs {
    padding: 0.75rem 0.65rem;
    gap: 0.4rem;
  }

  .carousel-thumb {
    width: 72px;
    height: 48px;
  }

  .carousel-hint {
    font-size: 0.65rem;
    text-align: center;
    padding: 0 0.5rem;
  }

  .album-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }

  .home-gallery-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .home-gallery-strip a {
    min-height: clamp(140px, 32vw, 260px);
  }

  .home-gallery-teaser {
    padding: 3rem 0;
  }

  .home-gallery-teaser-actions {
    flex-direction: column;
  }

  .home-gallery-teaser-actions .btn {
    width: 100%;
    min-height: 52px;
  }

  .page-hub-grid {
    grid-template-columns: 1fr;
  }

  .page-hub-card {
    padding: 1.25rem;
  }

  /* Lightbox */
  .lightbox {
    padding: 0.5rem;
    padding-top: calc(0.5rem + env(safe-area-inset-top, 0px));
  }

  .lightbox-inner {
    max-width: 100%;
    max-height: 85svh;
  }

  .lightbox-img {
    max-height: 70svh;
    border-radius: 4px;
  }

  .lightbox-nav {
    width: 44px;
    height: 44px;
    font-size: 1.75rem;
  }

  .lightbox-prev {
    left: max(0.5rem, env(safe-area-inset-left, 0px));
  }

  .lightbox-next {
    right: max(0.5rem, env(safe-area-inset-right, 0px));
  }

  .lightbox-close {
    top: max(0.5rem, env(safe-area-inset-top, 0px));
    right: max(0.5rem, env(safe-area-inset-right, 0px));
  }

  .stationen-videos {
    gap: 2rem;
  }

  .video-embed {
    max-width: 100%;
  }
}

/* ── Navigation Overlay (≤1100px, ergänzt style.css) ── */
@media (max-width: 1100px) {
  #site-header,
  .site-header {
    z-index: 10200 !important;
    isolation: isolate;
  }

  .nav-toggle {
    width: 48px;
    height: 48px;
    padding: 12px;
    z-index: 10260 !important;
    position: relative;
  }

  /* Backdrop UNTER Header/Drawer (sonst blockiert er Services/Entdecken-Taps) */
  #site-header .nav-backdrop:not([hidden]),
  .nav-backdrop:not([hidden]) {
    background: rgba(0, 0, 0, 0.55);
    z-index: 10040 !important;
  }

  #site-header .main-nav,
  .main-nav,
  .main-nav.open {
    z-index: 10250 !important;
    pointer-events: auto;
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.35);
  }

  .nav-parent {
    position: relative;
    z-index: 1;
    touch-action: manipulation;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(255, 234, 0, 0.15);
  }

  .nav-item--has-sub.is-open .nav-sub {
    pointer-events: auto;
  }

  body.nav-open {
    overflow: hidden;
  }

  body.nav-open #app,
  body.nav-open #site-main {
    z-index: 0 !important;
  }

  body.page-termin #app,
  body.page-termin .termin-planner {
    position: relative;
    z-index: 1;
    pointer-events: auto;
  }

  body.page-termin .termin-planner-main,
  body.page-termin .termin-service-btn,
  body.page-termin .termin-cal-day.is-available,
  body.page-termin .termin-slot-btn,
  body.page-termin .termin-salutation-btn,
  body.page-termin .termin-planner .btn,
  body.page-termin .termin-check {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255, 234, 0, 0.2);
  }

  body.nav-open .hero,
  body.nav-open .hero-bg,
  body.nav-open .hero-img,
  body.nav-open .hero-cinematic,
  body.nav-open .hero-overlay,
  body.nav-open .hero-inner {
    z-index: 0 !important;
    isolation: auto !important;
  }

  body.nav-open .hero-img {
    will-change: auto;
  }

  .main-nav a {
    min-height: 50px;
    display: flex;
    align-items: center;
    font-size: 1rem;
    letter-spacing: 0.1em;
  }

  .main-nav .nav-cta {
    min-height: 54px;
    font-size: 0.95rem;
    justify-content: center;
  }
}

/* ── Smartphone (≤768px) ── */
@media (max-width: 768px) {
  :root {
    --header-h: 64px;
  }

  .logo {
    height: 40px;
  }

  .header-inner {
    width: 94vw;
  }

  .hero {
    min-height: 100svh;
    min-height: 100dvh;
    padding: calc(var(--header-h) + 1.5rem) 0 3rem;
    align-items: flex-end;
  }

  .hero-inner {
    max-width: 100%;
  }

  .hero h1 {
    font-size: clamp(2rem, 9vw, 2.75rem);
    margin-bottom: 1rem;
  }

  .hero-sub {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }

  .hero-benefits {
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
  }

  .hero-benefits li {
    width: 100%;
    font-size: 0.82rem;
    padding: 0.6rem 1rem 0.6rem 1.25rem;
  }

  .hero-cta {
    flex-direction: column;
    gap: 0.75rem;
  }

  .hero-cta .btn {
    width: 100%;
    min-height: 52px;
    padding: 1rem 1.5rem;
  }

  .hero-scroll {
    margin-top: 2rem;
  }

  .marquee {
    padding: 0.65rem 0;
  }

  .marquee-track {
    font-size: 0.62rem;
    gap: 1.25rem;
  }

  .card {
    padding: 1.35rem;
  }

  .card:hover,
  .why-card:hover,
  .step:hover,
  .page-hub-card:hover,
  .home-gallery-strip a:hover {
    transform: none;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .why-grid {
    grid-template-columns: 1fr;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .reviews-grid {
    grid-template-columns: 1fr;
  }

  .faq summary {
    padding: 1.1rem 2.5rem 1.1rem 1rem;
    font-size: 0.88rem;
    line-height: 1.45;
    min-height: 52px;
    display: flex;
    align-items: center;
  }

  .faq p {
    font-size: 0.85rem;
    padding: 0 1rem 1.1rem;
  }

  .contact-form .form-row {
    grid-template-columns: 1fr;
  }

  #kontakt .contact-form--compact .form-row--termin-msg {
    grid-template-columns: 1fr;
  }

  #kontakt .contact-form--compact .field textarea {
    min-height: 4.5rem;
  }

  #kontakt .section-head {
    padding: 1rem 0 0.65rem;
    margin-bottom: 0.5rem;
  }

  .field input,
  .field select,
  .field textarea {
    font-size: 16px;
    min-height: 48px;
  }

  .field textarea {
    min-height: 120px;
  }

  .date-picker-trigger {
    min-height: 52px;
    font-size: 16px;
  }

  .date-picker-popover {
    position: fixed;
    left: max(1rem, env(safe-area-inset-left, 0px));
    right: max(1rem, env(safe-area-inset-right, 0px));
    top: auto;
    bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    max-width: 420px;
    margin-inline: auto;
  }

  .date-picker-day {
    min-height: 44px;
    font-size: 0.95rem;
  }

  .checkbox {
    font-size: 0.82rem;
    line-height: 1.5;
  }

  .ba-wrap {
    min-height: 220px;
  }

  .ba-hint {
    font-size: 0.75rem;
  }

  .compare-grid-mini {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .gallery-item .zoomable-trigger img,
  .gallery-item video {
    aspect-ratio: 16 / 10;
  }

  .pkg-badge {
    top: 0.5rem;
    right: 0.75rem;
  }

  .legal-page {
    padding-top: calc(var(--header-h) + 1.5rem);
    padding-bottom: 3rem;
  }

  .zoom-hint {
    opacity: 1;
    transform: none;
    font-size: 0.55rem;
  }
}

/* ── Kleines Smartphone (≤480px) ── */
@media (max-width: 480px) {
  .container {
    width: 92vw;
  }

  .lux-ablauf-steps {
    width: 92vw;
  }

  .trust-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .trust-item strong {
    font-size: 0.75rem;
  }

  .trust-item span {
    font-size: 0.72rem;
  }

  .stat-value {
    font-size: 1.75rem;
  }

  .stat-label {
    font-size: 0.62rem;
  }

  .home-gallery-strip {
    grid-template-columns: 1fr;
  }

  .home-gallery-strip a {
    min-height: 200px;
    aspect-ratio: 16 / 9;
  }

  .album-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .carousel-main-img {
    max-height: 45vh;
  }

  .carousel-thumb {
    width: 64px;
    height: 42px;
  }

  .btn {
    padding: 0.9rem 1.25rem;
    font-size: 0.68rem;
  }

  .section-head {
    padding: 1.75rem 0 1.25rem;
  }

  .eyebrow {
    font-size: 0.62rem;
    letter-spacing: 0.22em;
  }

  .compare-grid-mini {
    grid-template-columns: 1fr;
  }
}

/* ── Sehr klein (≤380px) ── */
@media (max-width: 380px) {
  .hero h1 {
    font-size: 1.85rem;
  }

  .trust-grid {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Touch: Vorher/Nachher + Terminbuchung (≤900px, wie Sticky-Bar) */
@media (max-width: 900px) {
  .ba-slider--touch .ba-wrap {
    touch-action: pan-x;
    -webkit-user-select: none;
    user-select: none;
  }

  .ba-slider--touch .ba-img {
    pointer-events: none;
    -webkit-user-drag: none;
  }

  .ba-slider--touch .ba-range {
    opacity: 0.01;
    z-index: 10;
    touch-action: pan-x;
    -webkit-appearance: none;
    appearance: none;
    height: 100%;
    min-height: 48px;
  }

  .ba-slider--touch .ba-handle {
    width: 6px;
    margin-left: -3px;
  }

  .ba-slider--touch .ba-handle::after {
    width: 52px;
    height: 52px;
    font-size: 0.85rem;
  }

  .ba-hint {
    font-size: 0.8rem;
    margin-top: 0.65rem;
  }

  body.page-termin .sticky-cta--bar {
    display: none !important;
  }

  body.page-termin.has-sticky-cta {
    padding-bottom: 0;
  }

  .termin-planner {
    margin-left: 0;
    margin-right: 0;
    overflow-x: clip;
  }

  .termin-planner-main {
    padding: 1.25rem 1rem 1.5rem;
    min-height: 0;
    overflow: visible;
  }

  .termin-services {
    grid-template-columns: 1fr;
  }

  .termin-service-btn,
  .termin-slot-btn,
  .termin-cal-nav,
  .termin-salutation-btn,
  .termin-summary-change,
  .termin-planner .btn {
    min-height: 48px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255, 234, 0, 0.15);
  }

  .termin-cal-day.is-available {
    min-height: 2.75rem;
    min-width: 2.5rem;
    aspect-ratio: auto;
    touch-action: manipulation;
  }

  .termin-slots {
    max-height: none;
    overflow-y: visible;
  }

  .termin-step-actions {
    position: sticky;
    bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    z-index: 5;
    margin-top: 1.25rem;
    padding: 0.75rem 0 0.25rem;
    background: linear-gradient(transparent, var(--tp-panel, #111) 28%);
  }

  .termin-form-grid .termin-field input,
  .termin-form-grid .termin-field select,
  .termin-form-grid .termin-field textarea {
    font-size: 16px;
  }

  .termin-check {
    min-height: 44px;
    padding: 0.35rem 0;
  }

  .termin-check input {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.15rem;
  }
}

/* Cinematic & Vorher/Nachher (Startseite) */
@media (max-width: 768px) {
  .cinematic-band {
    padding: 1.75rem 0 2rem;
    gap: 1rem;
  }

  .cinematic-band-bg {
    max-height: 200px;
    aspect-ratio: 16 / 9;
  }

  .cinematic-band h2 {
    font-size: clamp(1.65rem, 7vw, 2.15rem);
  }

  .cinematic-band-text {
    font-size: 0.95rem;
    margin-bottom: 1rem;
  }

  .cinematic-video-placeholder {
    max-width: 100%;
    max-height: 120px;
    margin-top: 0.75rem;
  }

  .home-before-after .ba-slider,
  .gallery-before-after .ba-slider {
    margin-bottom: 0.5rem;
  }

  .hero h1 {
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.7);
  }

  .hero-benefits li {
    flex: 1 1 calc(50% - 0.5rem);
    min-width: 0;
    font-size: 0.8rem;
    padding: 0.55rem 0.85rem 0.55rem 1.1rem;
  }
}

@media (max-width: 480px) {
  .hero-benefits li {
    flex: 1 1 100%;
  }

  .footer-contact {
    font-size: 0.85rem;
  }
}

/* Hover-Effekte auf Touch-Geräten dämpfen */
@media (hover: none) and (pointer: coarse) {
  .card:hover::after {
    transform: translateX(-120%);
  }

  .card:active {
    transform: scale(0.99);
    border-color: var(--border-yellow);
  }

  .btn:hover {
    transform: none;
  }

  .btn:active {
    transform: scale(0.98);
  }

  .btn-ghost:active,
  .hero-cta .btn-ghost:active {
    color: #151515;
    background: var(--hover-ghost-bg, #f3f2ec);
    border-color: rgba(0, 0, 0, 0.24);
  }

  .hero:not(.hero--light) .btn-ghost:active,
  .hero:not(.hero--light) .hero-cta .btn-ghost:active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.65);
  }

  .cta-band--dark .btn-ghost:active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
  }

  [data-theme="dark"] .hero--light .btn-ghost:active {
    color: #151515;
    background: #f3f2ec;
  }

  [data-theme="dark"] .btn-ghost:active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
  }

  [data-theme="dark"] .hero--light .btn-ghost:active,
  [data-theme="dark"] .hero--light .hero-cta .btn-ghost:active {
    color: #151515;
    background: #f3f2ec;
    border-color: rgba(0, 0, 0, 0.24);
  }

  [data-theme="dark"] .cta-band--dark .btn-ghost:active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
  }
}
