/* shop/public/css/product.css */
/* ==================================================
   SHOP-LAYOUT: SIDEBAR LINKS, PRODUKTE RECHTS
   ================================================== */
.page-title {
    background: linear-gradient(135deg, #1a3a5c, #2563eb);
    color: #fff;
    padding: 1rem 2rem;
    text-align: center;
}

.page-title h1 {
    margin: 0 0 .5rem;
    font-size: 2rem;
}

.page-title p {
    margin: 0;
    opacity: .85;
    font-size: 1rem;
}

.shop-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 30px;
    align-items: start;
    width: 100%;
    padding: 20px 0;
}

/* =========================
   PRODUKT-FILTERLEISTE
   ========================= */
.product-filterbar {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin: 0 0 1.5rem;
    padding: 1.1rem 1.2rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.pf-search {
    display: flex;
    gap: 0.5rem;
}
.pf-search input {
    flex: 1;
    padding: 0.6rem 0.85rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #1f2933;
    background: #fff;
}
.pf-search input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.pf-search button {
    padding: 0 1rem;
    border: none;
    border-radius: 8px;
    background: #2563eb;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
}
.pf-search button:hover { background: #1d4ed8; }

.pf-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.9rem;
}
.pf-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.78rem;
    color: #6b7280;
}
.pf-field select,
.pf-field input {
    padding: 0.45rem 0.6rem;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: 0.9rem;
    color: #1f2933;
    background: #fff;
    min-width: 140px;
}
.pf-field select:focus,
.pf-field input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
.pf-price-inputs {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.pf-price-inputs input {
    width: 90px;
    min-width: 0;
}
.pf-dash { color: #9ca3af; }

.pf-apply {
    padding: 0.5rem 1.1rem;
    border: none;
    border-radius: 8px;
    background: #111827;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
}
.pf-apply:hover { background: #1f2937; }

.pf-reset {
    font-size: 0.85rem;
    color: #6b7280;
    text-decoration: none;
    align-self: center;
}
.pf-reset:hover { color: #dc2626; text-decoration: underline; }

.pf-noresult {
    padding: 2rem 1rem;
    text-align: center;
    color: #6b7280;
    background: #fff;
    border: 1px dashed #d1d5db;
    border-radius: 12px;
}

@media (max-width: 640px) {
    .pf-controls { gap: 0.7rem; }
    .pf-field, .pf-field select, .pf-field input { min-width: 0; width: 100%; }
    .pf-field.pf-price { width: 100%; }
}

.category-sidebar {
    width: 260px;
    max-width: 260px;
    flex-shrink: 0;
}

.product-area {
    width: 100%;
}

/* ==================================================
   PRODUKT-GRID
   ================================================== */

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 2rem;
}

/* ==================================================
   FARBVARIABLEN
   ================================================== */

:root {
    --level-1-bg: #e8f0ff;
    --level-1-border: #b8c9ff;

    --level-2-bg: #f3f3f3;
    --level-3-bg: #ededed;
    --level-4-bg: #e7e7e7;

    --active-bg: #0074d9;
    --active-text: #ffffff;

    --hover-bg: #dbe7ff;

    --transition-speed: 0.3s;
}

/* ==================================================
   KATEGORIE-BOX (Container)
   ================================================== */

.category-box {
    margin-bottom: 2px;
}

/* ==================================================
   HEADER (KLICKFLÄCHE)
   ================================================== */

.category-box-header {
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background var(--transition-speed) ease,
        color var(--transition-speed) ease;
    user-select: none;
}

/* ==================================================
   LEVEL-DESIGN
   ================================================== */

.category-box[data-level="1"] .category-box-header {
    background: var(--level-1-bg);
    border: 1px solid var(--level-1-border);
}

.category-box[data-level="2"] .category-box-header {
    background: var(--level-2-bg);
    padding-left: 26px;
}

.category-box[data-level="3"] .category-box-header {
    background: var(--level-3-bg);
    padding-left: 40px;
}

.category-box[data-level="4"] .category-box-header {
    background: var(--level-4-bg);
    padding-left: 52px;
}

/* ==================================================
   AKTIVE KATEGORIE
   ================================================== */

.category-box.active>.category-box-header {
    background: var(--active-bg);
    color: var(--active-text);
}

/* ==================================================
   KATEGORIE-TEXT / LINK
   ================================================== */

.category-link {
    text-decoration: none;
    color: inherit;
    flex: 1;
}

.category-title {
    font-weight: 600;
    color: inherit;
}

/* ==================================================
   KENNZEICHNUNG: HAT UNTERKATEGORIEN
   ================================================== */

.category-box.has-children>.category-box-header::after {
    content: "▸";
    margin-left: auto;
    font-size: 0.9rem;
    opacity: 0.6;
    transition: transform var(--transition-speed) ease;
}

/* Gedreht, wenn offen */
.category-box.open>.category-box-header::after {
    transform: rotate(90deg);
}

/* ==================================================
   UNTERKATEGORIEN (ACCORDION)
   ================================================== */

.category-box-children {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-speed) ease;
}

.category-box.open>.category-box-children {
    max-height: 1000px;
    margin-top: 4px;
}

/* ==================================================
   HOVER-EFFEKT
   ================================================== */

.category-box-header:hover {
    background: var(--hover-bg);
}

.category-box-header:hover .category-title {
    text-decoration: underline;
}

/* ==================================================
   BREADCRUMBS
   ================================================== */

.breadcrumbs {
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: #555;
}

.breadcrumbs a {
    color: #2f5fd7;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs .sep {
    margin: 0 6px;
    color: #999;
}

/* ================================================================
   LAGERAMPEL
   ================================================================ */

/* ── Badge-Container ── */
.stock-badge-wrap {
    margin: 0 1rem .5rem;
    line-height: 1;
}

.stock-badge-detail {
    margin: 12px 0 16px;
}

/* ── Badge-Basis ── */
.stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 5px 10px 4px 7px;
    border-radius: 20px;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.stock-dot {
    font-size: 0.65rem;
    line-height: 1;
}

/* ── Grün: Auf Lager ── */
.stock-badge.stock-green {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.stock-badge.stock-green .stock-dot {
    color: #43a047;
}

/* ── Gelb: Nur noch wenige ── */
.stock-badge.stock-yellow {
    background: #fff8e1;
    color: #e65100;
    border: 1px solid #ffcc80;
}

.stock-badge.stock-yellow .stock-dot {
    color: #fb8c00;
}

/* ── Rot: Auf Bestellung ── */
.stock-badge.stock-red {
    background: #fdecea;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.stock-badge.stock-red .stock-dot {
    color: #e53935;
}

/* ── Detailseite: etwas größer ── */
.stock-badge-detail .stock-badge {
    font-size: 0.88rem;
    padding: 5px 14px 5px 10px;
}

/* ── Karte ausgegraut wenn Menge = 0 ── */
.product-card--out-of-stock .product-image img {
    opacity: 0.7;
    filter: grayscale(25%);
}

.product-card--out-of-stock .btn-add-to-cart:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

/* ── "Auf Bestellung anfragen"-Button (Detailseite) ── */
.btn-add-to-cart[disabled] {
    background: #9e9e9e;
    cursor: not-allowed;
}

/* ── Hinweis-Text bei Bestellartikeln ── */
.stock-order-hint {
    font-size: 0.82rem;
    color: #888;
    margin-top: -6px;
    margin-bottom: 10px;
}

.stock-order-hint a {
    color: #1565c0;
    text-decoration: none;
}

.stock-order-hint a:hover {
    text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════════
   PRODUKT-KATEGORIE-NAVIGATION
   ═══════════════════════════════════════════════════════════════════ */

.prod-cat-nav {
    width: 100%;
}

.prod-cat-title {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #888;
    margin-bottom: .55rem;
    padding: 0 .3rem;
}

.prod-cat-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.prod-cat-nav li {
    margin: .1rem 0;
}

.prod-cat-row {
    display: flex;
    align-items: center;
}

.prod-cat-nav a {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: .35rem;
    padding-bottom: .35rem;
    padding-right: .5rem;
    border-radius: 5px;
    color: #333;
    font-size: .87rem;
    text-decoration: none;
    transition: background .12s;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.prod-cat-nav a:hover,
.prod-cat-nav a.active {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 600;
}

.prod-cat-count {
    font-size: .73rem;
    color: #bbb;
    margin-left: .25rem;
    flex-shrink: 0;
}

/* Toggle-Button */
.prod-cat-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: .3rem .35rem;
    color: #aaa;
    font-size: .76rem;
    line-height: 1;
    border-radius: 3px;
    flex-shrink: 0;
    transition: color .12s;
}

.prod-cat-toggle:hover {
    color: #555;
}

/* Dreieck-Icon */
/* WICHTIG: .prod-cat-item .toggle-icon – nicht .rent-cat-item */
.prod-cat-item .toggle-icon {
    display: inline-block;
    transition: transform .2s ease;
}

/* Nur beim direkten .prod-cat-row drehen, nicht verschachtelte */
.prod-cat-item.open>.prod-cat-row .toggle-icon {
    transform: rotate(90deg);
}

/* Unterliste
   FIX Problem 1: [hidden] muss display:none erzwingen.
   Einige CSS-Resets entfernen [hidden]. Hier explizit sicherstellen. */
.prod-subcat {
    list-style: none;
    margin: .1rem 0 .2rem;
    padding: 0;
}

.prod-subcat[hidden],
ul.prod-subcat[hidden] {
    display: none !important;
}

/* Tiefenindikator: gestrichelte linke Linie ab depth-1 */
.prod-cat-item.depth-1>.prod-cat-row a,
.prod-cat-item.depth-2>.prod-cat-row a,
.prod-cat-item.depth-3>.prod-cat-row a,
.prod-cat-item.depth-4>.prod-cat-row a {
    border-left: 2px solid #e5e7eb;
    border-radius: 0 5px 5px 0;
}

.prod-cat-item.depth-1>.prod-cat-row a.active,
.prod-cat-item.depth-2>.prod-cat-row a.active,
.prod-cat-item.depth-3>.prod-cat-row a.active,
.prod-cat-item.depth-4>.prod-cat-row a.active {
    border-left-color: #2563eb;
}

/* ═══════════════════════════════════════════════════════════════════
   Bilder-Galerie
   ═══════════════════════════════════════════════════════════════════ */
.prod-thumb:hover {
    border-color: #93c5fd !important;
}

.prod-thumb.active {
    border-color: #2563eb !important;
}

.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .85);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.lightbox-overlay.open {
    display: flex;
}

.lightbox-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .prod-cat-nav {
        margin-bottom: 1rem;
    }
}
