/* ============================================================
   RESPONSIVE.CSS – Mobile-First Breakpoints
   ============================================================ */

/* ── Mobile < 576px ────────────────────────────────────── */
@media (max-width: 575px) {
  .hero-section { padding: 44px 0 36px; }
  .hero-section h1 { font-size: 1.65rem; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn-hero { width: 100%; text-align: center; justify-content: center; }
  .usp-strip .d-flex { flex-wrap: wrap; gap: .25rem !important; justify-content: center; }
  .config-layout { padding: 0 .75rem; }
  .fields-grid { grid-template-columns: 1fr; padding: 1rem; }
  .step-header { padding: 1rem 1rem 0; }
  .step-nav { flex-direction: column; gap: .65rem; padding: .85rem 1rem 1rem; }
  .step-nav .btn-step { width: 100%; justify-content: center; }
  .cph-specs { display: none !important; }
  .step-label { display: none; }
  .price-box .pb-value { font-size: 2rem; }
}

/* ── Tablet 576–991px ──────────────────────────────────── */
@media (min-width: 576px) and (max-width: 991px) {
  .hero-section h1 { font-size: 2.1rem; }
  .config-layout { grid-template-columns: 1fr; }
  .config-sidebar-col { position: static; order: -1; }
  .price-box, .summary-box, .info-box { max-width: 480px; }
  .fields-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Desktop ≥ 992px ───────────────────────────────────── */
@media (min-width: 992px) {
  .config-layout { padding: 0 1.5rem; }
}

/* ── Touch-targets ─────────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  .btn, .color-opt, .option-card-item { min-height: 44px; }
}

/* ── Print ─────────────────────────────────────────────── */
@media print {
  .site-header, .site-footer, .config-sidebar-col,
  .step-nav, .usp-strip, .flash-container { display: none !important; }
  body { font-size: 12pt; color: #000; }
}

/* ============================================================
   PHASE 2 – Responsive Optimierung Konfigurator & Admin
   ============================================================ */

/* Große Desktops */
@media (min-width: 1200px) {
  .config-layout {
    max-width: 1280px;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 1.75rem;
  }
  .product-visual-box .pvb-img { aspect-ratio: 18 / 8; }
}

/* Tablet und kleinere Notebooks */
@media (max-width: 991px) {
  .configurator-main { padding: 1rem 0 7.5rem; }
  .config-layout {
    grid-template-columns: 1fr !important;
    max-width: 760px;
    padding: 0 1rem;
  }
  .config-sidebar-col {
    order: 3 !important;
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto !important;
    z-index: 1030;
    background: #fff;
    border-top: 1px solid var(--border, #e5e7eb);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, .12);
    padding: .65rem 1rem max(.65rem, env(safe-area-inset-bottom));
  }
  .config-sidebar-col .price-box {
    margin: 0 !important;
    padding: .75rem 1rem;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    text-align: left;
    gap: .15rem 1rem;
    border-radius: 14px;
    box-shadow: none;
  }
  .config-sidebar-col .price-box .pb-label,
  .config-sidebar-col .price-box .pb-sub { font-size: .72rem; margin: 0; }
  .config-sidebar-col .price-box .pb-value {
    grid-row: 1 / span 3;
    grid-column: 2;
    font-size: 1.45rem;
    white-space: nowrap;
  }
  .config-sidebar-col .summary-box,
  .config-sidebar-col .info-box { display: none; }
  .config-product-header {
    flex-direction: column;
    padding: 1.05rem;
  }
  .cph-title { font-size: 1.25rem; }
  .product-visual-box .pvb-img { aspect-ratio: 16 / 10; }
  .step-progress {
    overflow-x: auto;
    padding: .85rem 1rem;
    scrollbar-width: thin;
  }
  .step-item { min-width: 46px; }
  .fields-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .9rem;
  }
  .fabric-selector,
  .form-card-grid,
  .accessory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .admin-content { padding: 1rem; }
  .admin-header { padding: 0 1rem; }
  .admin-header .page-title { font-size: 1rem; }
  .table-responsive { border-radius: 12px; border: 1px solid #e2e8f0; background: #fff; }
}

/* Smartphones */
@media (max-width: 575px) {
  html { -webkit-text-size-adjust: 100%; }
  .site-header .navbar { min-height: 58px; }
  .navbar-brand .brand-text { font-size: .98rem; }
  .page-header-bar { display: none; }
  .configurator-main { padding-top: .75rem; }
  .config-layout { padding: 0 .75rem !important; }
  .config-product-header {
    border-radius: 16px;
    margin-bottom: .9rem;
  }
  .cph-group { font-size: .7rem; }
  .cph-title { font-size: 1.15rem; line-height: 1.2; }
  .cph-desc { font-size: .86rem; line-height: 1.45; }
  .product-visual-box {
    border-radius: 16px;
    margin-bottom: .9rem;
  }
  .product-visual-box .pvb-img { aspect-ratio: 4 / 3; }
  .pvb-caption { font-size: .76rem; padding: .65rem .8rem; }
  .step-progress {
    border-radius: 16px;
    margin-bottom: .9rem;
  }
  .step-dot { width: 30px; height: 30px; font-size: .78rem; }
  .step-line { min-width: 26px; margin-bottom: 0; }
  .step-header { padding: 1rem .95rem 0; }
  .step-title { font-size: 1.12rem; }
  .fields-grid {
    grid-template-columns: 1fr !important;
    padding: 1rem .95rem;
    gap: .85rem;
  }
  .form-control,
  .form-select,
  textarea.form-control {
    min-height: 46px;
    font-size: 16px; /* verhindert iOS-Zoom */
  }
  textarea.form-control { min-height: 110px; }
  .step-nav {
    display: grid;
    grid-template-columns: 1fr;
    padding: .9rem .95rem 1rem;
  }
  .step-nav > div:empty { display: none; }
  .btn-step {
    width: 100%;
    min-height: 46px;
    justify-content: center;
  }
  .fabric-selector,
  .form-card-grid,
  .accessory-grid,
  .option-card-grid {
    grid-template-columns: 1fr !important;
  }
  .color-grid,
  .color-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .file-item { gap: .45rem; }
  .flash-container {
    left: .75rem;
    right: .75rem;
    bottom: 5.8rem;
    max-width: none;
  }

  .config-sidebar-col { padding: .55rem .75rem max(.55rem, env(safe-area-inset-bottom)); }
  .config-sidebar-col .price-box { border-radius: 12px; }
  .config-sidebar-col .price-box .pb-value { font-size: 1.25rem; }

  .admin-content { padding: .75rem; }
  .admin-header .btn { padding: .35rem .55rem; font-size: .82rem; }
  .sidebar-brand { padding: 1rem; }
  .sidebar-nav a { padding: .72rem 1rem; }
  .modal-dialog { margin: .65rem; }
}

/* Sehr kleine Geräte */
@media (max-width: 380px) {
  .config-sidebar-col .price-box {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .config-sidebar-col .price-box .pb-value {
    grid-row: auto;
    grid-column: auto;
    font-size: 1.35rem;
  }
}

/* ── Success Page responsive ───────────────────────────── */
@media (max-width: 991px) {
  .success-header-actions { gap: .75rem; }
  .success-header-phone span { display: none; }
  .success-header-phone i { font-size: 1.35rem; }
  .success-card-modern { padding: 2.4rem 1.4rem 1.4rem; border-radius: 20px; }
  .success-steps-modern {
    grid-template-columns: 1fr;
    gap: .95rem;
    padding: 1.1rem;
  }
  .success-steps-modern .ss-arrow {
    transform: rotate(90deg);
    font-size: 1.25rem;
    line-height: 1;
  }
  .success-contact-modern { grid-template-columns: 1fr; }
  .success-contact-modern .sc-link { border-left: 0; border-top: 1px solid #e2e8f0; padding: .95rem 0 0; }
  .success-trust-row { grid-template-columns: repeat(2, 1fr); padding: 0 .5rem; }
}

@media (max-width: 575px) {
  .success-header { height: 64px; }
  .success-header .navbar { height: 64px; }
  .success-header .brand-icon { width: 40px; height: 40px; border-radius: 10px; }
  .success-header .navbar-brand { font-size: 1rem; }
  .success-header-home { display: none; }
  .success-page-modern { padding: 1rem 0 1.5rem; }
  .success-card-modern { padding: 2rem 1rem 1rem; }
  .success-icon-modern { width: 68px; height: 68px; font-size: 2.15rem; }
  .success-card-modern h1 { font-size: 1.75rem; }
  .success-lead { font-size: .97rem; margin-bottom: 1.35rem; }
  .success-steps-modern .ss-step { grid-template-columns: auto 1fr; gap: .75rem; }
  .success-steps-modern .ss-icon { width: 48px; height: 48px; font-size: 1.35rem; }
  .success-actions-modern { display: grid; grid-template-columns: 1fr; gap: .7rem; }
  .success-actions-modern .btn { min-width: 0; width: 100%; font-size: .95rem; }
  .success-contact-modern { padding: 1rem; }
  .success-contact-modern .sc-main-icon { width: 50px; height: 50px; }
  .success-trust-row { grid-template-columns: 1fr; gap: .85rem; margin-top: 1.15rem; }
}

/* PHASE 3 – Geräteoptimierung */
@media (max-width: 991px) {
  .config-quickfacts { grid-template-columns: 1fr; }
  .cqf-item { padding:.8rem .9rem; }
  .config-step, #contactFormSection { border-radius:18px; }
  .config-sidebar-col { position: static; }
}
@media (max-width: 767px) {
  .configurator-main { padding-top:.85rem; padding-bottom:6rem; }
  .config-product-header { border-radius:18px; padding:1rem; }
  .cph-title { font-size:1.25rem; }
  .product-visual-box { border-radius:18px; }
  .step-header { padding:1.05rem 1rem 0; }
  .step-title { font-size:1.2rem; }
  .fields-grid { padding:1rem; grid-template-columns:1fr; gap:.85rem; }
  .step-nav { padding: .85rem 1rem; gap:.65rem; }
  .step-nav .btn-step { flex:1; padding:.68rem .75rem; }
  .fabric-selector, .accessory-grid { grid-template-columns: 1fr; }
  .color-selector { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-visual-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .config-sidebar-col .price-box {
    position: fixed;
    left: .75rem;
    right: .75rem;
    bottom: .75rem;
    z-index: 1035;
    margin:0;
    padding:.75rem 1rem;
    display:grid;
    grid-template-columns: 1fr auto;
    column-gap:.75rem;
    align-items:center;
  }
  .config-sidebar-col .price-box .pb-value { font-size:1.35rem; text-align:right; }
  .config-sidebar-col .price-box .pb-sub, .config-sidebar-col .price-details { display:none; }
  .sidebar-action-box { display:none; }
}
@media (max-width: 420px) {
  .color-selector { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-visual-grid { gap:.5rem; }
  .form-card-label { font-size:.68rem; }
}

@media (max-width: 991.98px) {
  .technical-check-box { margin: .75rem 0; }
  .tcb-head { padding: .7rem .85rem; }
  .tcb-body { padding: .65rem; }
  .tcb-item { font-size: .8rem; }
}

/* Phase 5.2: Mobile Plausibilitätsprüfung */
@media (max-width: 991.98px) {
  .technical-check-box {
    border-radius: 14px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
  }
  .tcb-head { padding: .7rem .85rem; font-size: .9rem; }
  .tcb-body { padding: .65rem; }
  .tcb-state { padding: .6rem; gap: .55rem; }
  .tcb-state strong { font-size: .85rem; }
  .tcb-state span { font-size: .75rem; }
  .tcb-item { font-size: .76rem; padding: .45rem .5rem; }
  .technical-field-warning { font-size: .76rem; padding: .45rem .5rem; }
}

/* ============================================================
   HOTFIX – Mobile technische Prüfung darf keine Eingabefelder verdecken
   ============================================================ */
.mobile-technical-check-slot { display: none; }

@media (max-width: 991.98px) {
  .mobile-technical-check-slot {
    display: block;
    margin: 0 0 .9rem;
  }

  /* Sidebar darf auf Mobile nicht als große Box über dem Formular liegen */
  .config-sidebar-col {
    position: static !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    z-index: auto !important;
    background: transparent !important;
    border-top: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  /* Nur die Preisbox bleibt unten fixiert. Alles andere bleibt im normalen Dokumentfluss. */
  .config-sidebar-col > *:not(.price-box) {
    display: none !important;
  }

  .mobile-technical-check-slot .technical-check-box {
    display: block !important;
    position: static !important;
    margin: 0 !important;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
  }

  .technical-check-box.mobile-compact .tcb-head {
    cursor: pointer;
    justify-content: space-between;
  }

  .technical-check-box.mobile-compact .tcb-head::after {
    content: 'anzeigen';
    font-size: .72rem;
    font-weight: 800;
    color: var(--primary);
    background: rgba(232, 93, 4, .08);
    border-radius: 999px;
    padding: .25rem .55rem;
  }

  .technical-check-box.mobile-compact.is-open .tcb-head::after {
    content: 'ausblenden';
  }

  .technical-check-box.mobile-compact:not(.is-open) .tcb-body .tcb-section {
    display: none !important;
  }

  .technical-check-box.mobile-compact:not(.is-open) .tcb-body {
    padding: .65rem;
  }

  .technical-check-box.mobile-compact:not(.is-open) .tcb-state span {
    display: none;
  }

  .technical-check-box.mobile-compact:not(.is-open) .tcb-state {
    padding: .55rem .65rem;
    border-radius: 12px;
  }
}

@media (max-width: 575.98px) {
  .mobile-technical-check-slot { margin-top: -.15rem; }
  .mobile-technical-check-slot .technical-check-box { border-radius: 16px; }
  .mobile-technical-check-slot .tcb-head { font-size: .88rem; padding: .65rem .75rem; }
  .mobile-technical-check-slot .tcb-state strong { font-size: .82rem; }
}

/* Phase 7.1: Mobile Darstellung der Monteurvorschau im Admin */
@media (max-width: 768px) {
    .admin-installer-preview .btn {
        width: 100%;
        margin-left: 0 !important;
    }
    .admin-technical-sketch-box {
        padding: .65rem;
        border-radius: 12px;
    }
}

/* Phase 10A.2b: Exportzentrale responsiv */
@media (max-width: 1399.98px) {
  .export-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 991.98px) {
  .export-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .export-action-card {
    min-height: 225px;
  }
}

@media (max-width: 575.98px) {
  .export-center .card-body {
    padding: 1rem !important;
  }
  .export-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .export-action-card {
    min-height: auto;
    padding: 14px;
  }
  .export-action-card p {
    flex: unset;
  }
}


@media (max-width: 768px) {
    .hero-section.hero-has-json::before {
        background:
            linear-gradient(180deg, rgba(255,255,255,.97) 0%, rgba(255,255,255,.86) 56%, rgba(255,255,255,.30) 100%);
    }
}


/* Hersteller Carousel Responsive */
@media (max-width: 1199.98px) {
  .mcs-message-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mcs-logo-slide {
    width: 170px;
    height: 86px;
  }
}

@media (max-width: 767.98px) {
  .manufacturer-carousel-section {
    padding: 58px 0 66px !important;
  }

  .mcs-head {
    text-align: left;
    margin-bottom: 30px;
  }

  .mcs-head h2 {
    font-size: 2rem;
  }

  .mcs-head p {
    font-size: .96rem;
  }

  .mcs-carousel-wrap {
    margin-bottom: 32px;
    mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  }

  .mcs-carousel-track {
    gap: 12px;
    animation-duration: 26s;
  }

  .mcs-logo-slide {
    width: 145px;
    height: 74px;
    border-radius: 18px;
    padding: 15px;
  }

  .mcs-logo-slide img {
    max-height: 42px;
  }

  .mcs-message-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .mcs-message-card {
    border-radius: 22px;
    padding: 22px;
  }
}


/* Admin Produktübersicht Thumbnail responsive */
@media (max-width: 767.98px) {
  .admin-product-list-item .admin-product-thumb {
    width: 76px !important;
    height: 54px !important;
    min-width: 76px !important;
    max-width: 76px !important;
  }

  .admin-product-list-item .admin-product-thumb img {
    max-width: 76px !important;
    height: 54px !important;
  }

  .admin-product-cell {
    min-width: 220px;
  }
}


/* Produktbild Vorschau product_edit.php responsive */
@media(max-width:767.98px){
  .admin-product-edit-image-box{
    flex-direction:column!important;
    align-items:stretch!important;
  }
  .admin-product-edit-preview,
  .admin-product-edit-preview-img,
  .admin-product-edit-preview img{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    height:180px!important;
    min-height:180px!important;
    max-height:180px!important;
  }
  .admin-product-edit-upload{
    min-width:0!important;
  }
}


/* Product Edit Rebuilt Fix responsive */
@media (max-width:1199.98px){.product-edit-grid{grid-template-columns:minmax(0,1fr) 330px;}}
@media (max-width:991.98px){.product-edit-grid{grid-template-columns:1fr;}.product-edit-sidebar{position:static;}}
@media (max-width:767.98px){.product-edit-page-wrap{padding:1rem;}.product-edit-image-box{flex-direction:column;align-items:stretch;}.product-edit-image-preview{width:100%;max-width:100%;min-width:0;height:180px;}.product-edit-image-upload{min-width:0;}}
