/**
 * MCT Catalog Modal – catalog.css  v2
 *
 * Produktkatalog-Modal: Kategoriefilter, Suche, Produktkarten
 * Mobile  : Bottom-Sheet, horizontale Karten (Bild links)
 * Desktop : Floating-Modal, 3-Spalten-Grid (Bild oben)
 *
 * Z-Index-Ebenen (mit quickview.css abgestimmt):
 *   catalog overlay  250000
 *   catalog modal    250001
 *   quickview overlay 310000   ← öffnet sich ÜBER dem catalog
 *   quickview modal  310001
 *
 * Author: Sören Kotte - VEZOZA.com
 */

/* ════════════════════════════════════════════════════════════════
   OVERLAY
════════════════════════════════════════════════════════════════ */
.mct-catalog-overlay {
    display:    none;
    position:   fixed;
    inset:      0;
    z-index:    250000;
    background: rgba(0,0,0,.82);
}
.mct-catalog-overlay.is-open { display: block; }

/* ════════════════════════════════════════════════════════════════
   MODAL WRAPPER
════════════════════════════════════════════════════════════════ */
.mct-catalog-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 250001;
    align-items: flex-end;
    justify-content: center;
}
.mct-catalog-modal.is-open { display: flex; }

/* ── Inner (Mobile: Bottom-Sheet) ────────────────────────────── */
.mct-catalog-modal__inner {
    width: 100%;
    display: flex;
    flex-direction: column;
    max-height: 92vh;
    overflow: hidden;

    background:    #282828;
    border-radius: 22px 22px 0 0;
    border:        1px solid #3c3c3c;
    border-bottom: none;

    animation: mct-catalog-slide-up .3s cubic-bezier(.32,.72,0,1) both;
}
@keyframes mct-catalog-slide-up {
    from { transform: translateY(48px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ── Desktop: Floating Modal ─────────────────────────────────── */
@media (min-width: 700px) {
    .mct-catalog-modal {
        align-items: flex-start;
        padding: 40px 24px 0;
    }
    .mct-catalog-modal__inner {
        max-width: 1020px;
        max-height: calc(100vh - 72px);
        margin: 0 auto;
        border-radius: 20px;
        border-bottom: 1px solid #3c3c3c;
        animation: mct-catalog-pop .24s cubic-bezier(.2,.8,.2,1) both;
    }
    @keyframes mct-catalog-pop {
        from { transform: translateY(-16px) scale(.98); opacity: 0; }
        to   { transform: translateY(0) scale(1);       opacity: 1; }
    }
}

/* ════════════════════════════════════════════════════════════════
   HEADER
════════════════════════════════════════════════════════════════ */
.mct-catalog-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 0;
    flex-shrink: 0;
    gap: 12px;
}
.mct-catalog-modal__title {
    font-size: 1.22rem;
    font-weight: 800;
    letter-spacing: -.02em;
    margin: 0 0 2px;
    color: var(--mct-text, #18181b);
    line-height: 1.2;
}
.mct-catalog-modal__sub {
    font-size: .75rem;
    color: var(--mct-text-muted, #a1a1aa);
    margin: 0;
    font-weight: 500;
}
.mct-catalog-modal__close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #3c3c3c;
    color: #f2f2f2;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    margin-left: auto;
}
.mct-catalog-modal__close:hover { background: #4a4a4a; }

/* ════════════════════════════════════════════════════════════════
   KATEGORIE-TABS
════════════════════════════════════════════════════════════════ */
.mct-catalog-modal__tabs {
    display: flex;
    gap: 6px;
    padding: 14px 20px 10px;
    overflow-x: auto;
    flex-shrink: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.mct-catalog-modal__tabs::-webkit-scrollbar { display: none; }

/* Dropdown-Select (Mobile) – standardmäßig versteckt */
.mct-catalog-tab-select {
    display: none;
}

.mct-catalog-tab {
    padding: 6px 15px;
    border-radius: 100px;
    border: 1.5px solid rgba(255,255,255,.18);
    background: transparent;
    font-size: .79rem;
    font-weight: 600;
    font-family: var(--mct-font, inherit);
    white-space: nowrap;
    cursor: pointer;
    color: var(--mct-text, #bfbfbf);
    transition: background .14s, color .14s, border-color .14s;
    flex-shrink: 0;
    line-height: 1.2;
    -webkit-tap-highlight-color: transparent;
}
.mct-catalog-tab:hover {
    border-color: rgba(255,255,255,.35);
    color: #f2f2f2;
}
.mct-catalog-tab.is-active,
.mct-catalog-tab[aria-selected="true"] {
    background:   #f2f2f2;
    color:        #1f2020;
    border-color: #f2f2f2;
}

/* ════════════════════════════════════════════════════════════════
   SUCHE
════════════════════════════════════════════════════════════════ */
.mct-catalog-modal__search {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 4px 20px 14px;
    background: rgba(255,255,255,.05);
    border: 1px solid transparent;
    border-radius: 11px;
    padding: 9px 14px;
    flex-shrink: 0;
    color: var(--mct-text-muted, #bfbfbf);
    transition: border-color .15s, background .15s;
}
.mct-catalog-modal__search:focus-within {
    background: #1f2020;
    border-color: #3c3c3c;
}
.mct-catalog-modal__search input {
    border: none;
    background: transparent;
    font-size: .88rem;
    font-family: var(--mct-font, inherit);
    width: 100%;
    outline: none;
    color: var(--mct-text, #f2f2f2);
}
.mct-catalog-modal__search input::placeholder {
    color: var(--mct-text-muted, #bfbfbf);
}

/* ════════════════════════════════════════════════════════════════
   PRODUKTGRID
════════════════════════════════════════════════════════════════ */
.mct-catalog-modal__grid {
    overflow-y: auto;
    padding: 2px 16px 32px;
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    align-content: start;
    -webkit-overflow-scrolling: touch;
}
@media (min-width: 700px) {
    .mct-catalog-modal__grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        padding: 4px 20px 36px;
    }
}

/* ════════════════════════════════════════════════════════════════
   PRODUKTKARTE – Mobile (horizontal)
════════════════════════════════════════════════════════════════ */
.mct-catalog-card {
    display: flex;
    background: #282828;
    border: 1px solid #3c3c3c;
    border-radius: 14px;
    overflow: hidden;
    transition: transform .18s;
    -webkit-tap-highlight-color: transparent;
}
.mct-catalog-card:hover {
    transform: translateY(-1px);
}

/* Bild – Mobile */
.mct-catalog-card__img {
    width: 96px;
    flex-shrink: 0;
}
.mct-catalog-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Body – Mobile */
.mct-catalog-card__body {
    padding: 11px 11px 11px 13px;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2px;
}

.mct-catalog-card__name {
    font-size: .92rem;
    font-weight: 700;
    letter-spacing: -.01em;
    margin: 0;
    color: var(--mct-text, #18181b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.mct-catalog-card__meta {
    font-size: .72rem;
    color: var(--mct-text-muted, #a1a1aa);
    margin: 0 0 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mct-catalog-card__price {
    margin-bottom: 6px;
    line-height: 1;
}
.mct-catalog-card__price .price {
    font-size: .82rem !important;
    color: var(--mct-text, #18181b) !important;
    font-weight: 600 !important;
    letter-spacing: -.01em !important;
}
.mct-catalog-card__price .price ins {
    font-weight: 700 !important;
    text-decoration: none !important;
}
.mct-catalog-card__price .price del {
    color: #888 !important;
    font-size: .78em !important;
    margin-right: 4px;
    font-weight: 400 !important;
}

/* ── Aktionszeile ────────────────────────────────────────────── */
.mct-catalog-card__actions {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: nowrap;
}

/* Variationsbuttons (0,4L / 0,5L) */
.mct-catalog-var-btn {
    padding: 5px 11px;
    border-radius: 8px;
    border: 1.5px solid rgba(255,255,255,.18);
    background: transparent;
    font-size: .76rem;
    font-weight: 700;
    font-family: var(--mct-font, inherit);
    cursor: pointer;
    color: var(--mct-text, #f2f2f2);
    transition: background .13s, color .13s, border-color .13s;
    line-height: 1.1;
    white-space: nowrap;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.mct-catalog-var-btn.mct-catalog-var-btn--active,
.mct-catalog-var-btn:hover {
    background:   #f2f2f2;
    color:        #1f2020;
    border-color: #f2f2f2;
}
.mct-catalog-var-btn.is-adding {
    opacity: .55;
    pointer-events: none;
}
.mct-catalog-var-btn.is-added {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
    animation: mct-pop .28s ease;
}

/* Einfaches Produkt */
.mct-catalog-add-btn {
    flex: 1;
    padding: 5px 11px;
    border-radius: 8px;
    border: none;
    background: #f2f2f2;
    color: #1f2020;
    font-size: .76rem;
    font-weight: 700;
    font-family: var(--mct-font, inherit);
    cursor: pointer;
    transition: opacity .13s;
    text-align: center;
    white-space: nowrap;
    line-height: 1.1;
    -webkit-tap-highlight-color: transparent;
}
.mct-catalog-add-btn:hover { opacity: .85; }
.mct-catalog-add-btn.is-adding { opacity: .45; pointer-events: none; }
.mct-catalog-add-btn.is-added {
    background: #16a34a;
    animation: mct-pop .28s ease;
}

/* Pfeil-Button (→) öffnet Quick-View */
.mct-catalog-detail-btn {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,.18);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mct-text-muted, #bfbfbf);
    text-decoration: none;
    margin-left: auto;
    transition: border-color .13s, color .13s, background .13s;
    -webkit-tap-highlight-color: transparent;
}
.mct-catalog-detail-btn:hover {
    border-color: var(--mct-primary, #ce5c15);
    color: var(--mct-primary, #ce5c15);
    background: rgba(206,92,21,.10);
}

/* ════════════════════════════════════════════════════════════════
   DESKTOP: Vertikale Karten
════════════════════════════════════════════════════════════════ */
@media (min-width: 700px) {
    .mct-catalog-card {
        flex-direction: column;
    }
    .mct-catalog-card__img {
        width: 100%;
        height: 210px;
    }
    .mct-catalog-card__body {
        padding: 13px 13px 12px;
        gap: 3px;
    }
    .mct-catalog-card__name {
        white-space: normal;
        font-size: .94rem;
    }
    .mct-catalog-card__actions {
        flex-wrap: wrap;
        gap: 5px;
    }
    .mct-catalog-add-btn {
        flex: 1 1 100%;
    }
    /* Pfeil am Ende der Button-Reihe rechts */
    .mct-catalog-detail-btn {
        margin-left: auto;
    }
}

/* ════════════════════════════════════════════════════════════════
   LEER / LADEN
════════════════════════════════════════════════════════════════ */
.mct-catalog-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--mct-text-muted, #a1a1aa);
    padding: 56px 20px;
    font-size: .94rem;
    font-weight: 500;
}
.mct-catalog-loading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 0;
    min-height: 140px;
}

/* ════════════════════════════════════════════════════════════════
   ANIMATIONEN
════════════════════════════════════════════════════════════════ */
@keyframes mct-pop {
    0%   { transform: scale(1);    }
    40%  { transform: scale(1.12); }
    100% { transform: scale(1);    }
}

/* ════════════════════════════════════════════════════════════════
   MOBILE ONLY (< 700px)
════════════════════════════════════════════════════════════════ */
@media (max-width: 699px) {

    /* Tabs ausblenden, Dropdown anzeigen */
    .mct-catalog-modal__tabs  { display: none; }
    .mct-catalog-tab-select {
        display: block;
        margin: 10px 20px 4px;
        padding: 9px 14px;
        width: calc(100% - 40px);
        border-radius: 11px;
        border: 1.5px solid #3c3c3c;
        background: #1f2020;
        font-size: .88rem;
        font-weight: 600;
        font-family: var(--mct-font, inherit);
        color: var(--mct-text, #f2f2f2);
        cursor: pointer;
        outline: none;
        flex-shrink: 0;
        -webkit-appearance: auto;
        appearance: auto;
    }
    .mct-catalog-tab-select:focus {
        border-color: #4a4a4a;
        background: #282828;
    }

    /* Produktkarte: feste Höhe, Body scrollbar */
    .mct-catalog-card {
        height: 110px;
    }
    .mct-catalog-card__body {
        overflow-y: auto;
        padding: 8px 10px 8px 12px;
        gap: 1px;
    }

    /* "In den Warenkorb"-Button: kompakt auf Mobile */
    .mct-catalog-add-btn {
        padding: 5px 8px !important;
        font-size: .72rem !important;
        min-height: 0 !important;
        height: auto !important;
        line-height: 1.2 !important;
    }
}

/* ════════════════════════════════════════════════════════════════
   BODY-LOCK (iOS-sicher via JS + position:fixed)
════════════════════════════════════════════════════════════════ */
body.mct-catalog-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
}
