/* ============================================================
   PRODUCT DETAIL PAGE - ADDITIONAL STYLES
   ============================================================ */
body {
    overflow-x: hidden;
}

/* ----- Layout with Sidebar ----- */
.detail-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 5% 3rem;
    align-items: start;
    position: relative;
}

/* 100% full-width divider (true viewport width) */
.detail-layout::after {
    content: "";
    position: absolute;
    bottom: 0;
    height: 1px;
    background-color: #eee;
    z-index: 10;
    left: calc(50% - 50vw);
    width: 100vw;
}

/* ----- SIDEBAR ----- */
.detail-sidebar {
    position: sticky;
    top: 90px;              /* fix: 78px -> 90px, avoid fixed navigation */
    align-self: start;
    max-height: calc(100vh - 110px); /* match top offset */
    overflow-y: auto;
    padding-right: 0.4rem;
    scrollbar-width: thin;  /* Firefox scrollbar */
}
.detail-sidebar::-webkit-scrollbar { width: 4px; }
.detail-sidebar::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.toc-box {
    background: #f5f5f5;
    border: 1px solid #eee;
    border-radius: 14px;
    padding: 1.2rem 1.1rem;
    margin-bottom: 1.2rem;
}
.toc-box h4 {
    margin: 0 0 0.8rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #4a5b6e;
    font-weight: 700;
}
.toc-box ul { list-style: none; padding: 0; margin: 0; font-size: 0.9rem; }
.toc-box ul li { margin-bottom: 0.4rem; }
.toc-box ul li a {
    color: #1f2a3a;
    display: block;
    padding: 0.2rem 0 0.2rem 0.6rem;
    border-left: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    text-decoration: none;
}
.toc-box ul li a:hover,
.toc-box ul li a.active {
    color: #294197;
    border-left-color: #294197;
    text-decoration: none;
}

.quicknav-box {
    background: #294197;
    color: #fff;
    border-radius: 14px;
    padding: 1.2rem 1.1rem;
}
.quicknav-box h4 {
    margin: 0 0 0.8rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #d6dff0;
    font-weight: 700;
}
.quicknav-box a {
    display: block;
    color: #fff;
    font-size: 0.88rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.18);
    text-decoration: none;
    transition: opacity 0.15s;
}
.quicknav-box a:last-child { border-bottom: none; }
.quicknav-box a:hover { opacity: 0.8; text-decoration: none; }

/* ----- MAIN CONTENT COLUMN ----- */
.detail-content { min-width: 0; }

/* Breadcrumb */
.detail-breadcrumb {
    font-size: 0.88rem;
    color: #6c7a8a;
    margin: 0 0 1.8rem;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 0.6rem;
}
.detail-breadcrumb a { color: #294197; text-decoration: none; }
.detail-breadcrumb a:hover { text-decoration: underline; }
.detail-breadcrumb li:not(:last-child)::after { content: "›"; margin-left: 0.4rem; color: #90a0b0; }

/* ----- Product Hero ----- */
.detail-hero {
    display: flex;
    flex-wrap: nowrap;
    gap: 2rem;
    align-items: flex-start;
    margin-bottom: 2.8rem;
}

/* Image Gallery Area */
.detail-gallery {
    flex: 1 1 45%;
    min-width: 250px;
    max-width: 480px;
}
.gallery-main {
    position: relative;
    background: #f5f5f5;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #eee;
    aspect-ratio: 1 / 1;
    box-shadow: 0 8px 28px rgba(0,0,0,0.06);
}
.gallery-track { display: flex; height: 100%; transition: transform 0.4s ease; will-change: transform; }
.gallery-slide {
    flex: 0 0 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.gallery-slide img {
    width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; display: block; padding: 0.7rem;
}
.gallery-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255,255,255,0.9); border: 1px solid #dde4f0;
    color: #294197; font-size: 1.3rem; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 5; user-select: none;
    transition: background 0.2s, opacity 0.2s; opacity: 0.85;
}
.gallery-arrow:hover { background: #fff; opacity: 1; }
.gallery-arrow--prev { left: 12px; }
.gallery-arrow--next { right: 12px; }

.gallery-thumbs { display: flex; gap: 0.7rem; margin-top: 0.9rem; flex-wrap: wrap; }
.gallery-thumb {
    width: 74px; height: 74px; border-radius: 10px; overflow: hidden;
    border: 2px solid #dde4f0; cursor: pointer; background: #f5f5f5; padding: 0;
    transition: border-color 0.2s, transform 0.15s; flex-shrink: 0;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; padding: 3px; }
.gallery-thumb:hover { border-color: #7a8bb5; transform: translateY(-1px); }
.gallery-thumb.active { border-color: #294197; box-shadow: 0 0 0 2px rgba(41,65,151,0.18); }

/* Right Summary Area */
.detail-summary {
    flex: 1 1 55%;
    min-width: 300px;
}
.detail-summary h1 {
    font-size: 1.85rem; line-height: 1.25; margin: 0 0 0.7rem; color: #294197;
    border-left: none; padding-left: 0;
}
.detail-summary .product-subtitle {
    font-size: 1.02rem; color: #2d3b4c; margin-bottom: 1.4rem; line-height: 1.7;
}
.detail-meta-specs {
    list-style: none; padding: 1.3rem 1.5rem; margin: 0 0 1.6rem;
    display: flex; flex-wrap: wrap; gap: 1.4rem 2.4rem;
    background: #f5f5f5; border-radius: 14px; border: 1px solid #eee;
}
.detail-meta-specs li { display: flex; flex-direction: column; font-size: 0.94rem; }
.detail-meta-specs li strong {
    font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.03em;
    color: #6c7a8a; font-weight: 600; margin-bottom: 0.15rem;
}
.detail-meta-specs li span { font-weight: 600; color: #1f2a3a; }

/* ===== Action Buttons (PC: inline, Mobile: stacked) ===== */
.detail-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 1.2rem;
    width: 100%;
}
.detail-btn-primary {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: #294197; color: #fff;
    padding: 0.85rem 1rem; border-radius: 40px; font-weight: 700;
    text-decoration: none; transition: background 0.2s, transform 0.15s;
    font-size: 1rem; text-align: center;
    white-space: nowrap;
    flex: 1 1 50%;
    border: 2px solid #294197;
}
.detail-btn-primary:hover { background: #134b9e; border-color: #134b9e; transform: translateY(-2px); text-decoration: none; color: #fff; }

.detail-btn-outline {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: transparent; color: #294197;
    border: 2px solid #294197; padding: 0.85rem 1rem; border-radius: 40px;
    font-weight: 700; text-decoration: none; transition: background 0.2s, color 0.2s, transform 0.15s;
    font-size: 1rem; text-align: center;
    white-space: nowrap;
    flex: 1 1 50%;
}
.detail-btn-outline:hover { background: #294197; color: #fff; transform: translateY(-2px); text-decoration: none; }

/* ----- Lightbox ----- */
.detail-lightbox {
    display: none; position: fixed; inset: 0; z-index: 9999;
    background: rgba(10, 18, 35, 0.88); align-items: center; justify-content: center;
    padding: 1.5rem; cursor: zoom-out;
}
.detail-lightbox.open { display: flex; }
.detail-lightbox .lb-figure {
    margin: 0; width: 600px; max-width: 92vw; height: 600px; max-height: 92vh;
    background: #fff; border-radius: 10px; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.45); position: relative;
}
.detail-lightbox .lb-figure img {
    width: 100%; height: 100%;
    max-width: 100%; max-height: 100%; object-fit: contain; display: block;
}
.detail-lightbox .lb-close {
    position: absolute; top: 18px; right: 18px; width: 44px; height: 44px;
    border-radius: 50%; border: none; background: rgba(255,255,255,0.15);
    color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: background 0.2s; z-index: 10000;
}
.detail-lightbox .lb-close:hover { background: rgba(255,255,255,0.3); }
.detail-lightbox .lb-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 48px; height: 48px; border-radius: 50%; border: none;
    background: rgba(255,255,255,0.18); color: #fff; font-size: 1.4rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 10000; transition: background 0.2s;
}
.detail-lightbox .lb-arrow:hover { background: rgba(255,255,255,0.36); }
.detail-lightbox .lb-arrow--prev { left: 20px; }
.detail-lightbox .lb-arrow--next { right: 20px; }
.detail-lightbox .lb-counter {
    position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
    color: rgba(255,255,255,0.75); font-size: 0.85rem; letter-spacing: 0.04em;
    background: rgba(0,0,0,0.35); padding: 0.25rem 0.9rem; border-radius: 40px; z-index: 10000;
}

/* ----- Content Blocks ----- */
.detail-block { margin-bottom: 2.8rem; scroll-margin-top: 100px; }
.detail-block h2 {
    font-size: 1.6rem; margin-bottom: 1.1rem;
    border-left: none; padding-left: 0;  /* override global h2 blue border */
}
.detail-block h3 { font-size: 1.15rem; margin: 1.6rem 0 0.55rem; }
.detail-block p { margin-bottom: 1rem; }
.detail-block ul { padding-left: 1.4rem; margin-bottom: 1.4rem; }
.detail-block ul li { margin-bottom: 0.45rem; }

.detail-feature-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem 2rem; margin: 1.2rem 0 1.8rem;
}
.detail-feature-grid ul { padding-left: 1.1rem; margin: 0; }
.detail-feature-grid ul li { margin-bottom: 0.45rem; font-size: 0.95rem; }

/* Tables */
.detail-table-wrap {
    overflow-x: auto; margin: 1.4rem 0 1.8rem;
    border-radius: 14px; border: 1px solid #eee;
}
.detail-table {
    width: 100%; border-collapse: collapse; font-size: 0.9rem; background: #fff; min-width: 640px;
}
.detail-table caption {
    caption-side: top; text-align: left; font-weight: 700; font-size: 1rem;
    padding: 0.85rem 1.2rem; background: #f0f4ff; color: #294197; border-bottom: 1px solid #e2e8f2;
}
.detail-table thead th {
    background: #294197; color: #fff; font-weight: 600;
    text-align: left;
    padding: 0.8rem 1rem; border: 1px solid #294197; white-space: nowrap;
}
.detail-table tbody td {
    padding: 0.8rem 1rem; border: 1px solid #eee; color: #1f2a3a;
    vertical-align: middle;
    text-align: left;
}

/* Column-specific styling (class-based, avoids rowspan/nth-child conflicts) */
/* Column 1: group title, bold + primary color */
.detail-table tbody td.col-group {
    font-weight: 600;
    color: #294197;
    background-color: #fcfcfc;
}

/* Column 2: parameter name, regular weight + primary color (Isolationswiderstand stays normal) */
.detail-table tbody td.col-param {
    font-weight: 500;
    color: #294197;
    background-color: transparent;
}

/* Column 3: technical value, regular weight + dark color */
.detail-table tbody td.col-value {
    font-weight: 400;
    color: #1f2a3a;
    background-color: transparent;
}

.detail-table tbody tr:nth-child(even) td { background: #f9fafb; }
.detail-table tbody tr:hover td { background: #f0f4ff; }
.detail-tech-note { font-size: 0.88rem; color: #6c7a8a; font-style: italic; }

/* ============================================================
   Image Figure Optimizations
   ============================================================ */
.detail-figure {
    margin: 2.5rem 0;
    background: transparent;
    border: none;
}
.detail-figure img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}
.detail-figure figcaption {
    padding: 0;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #6c7a8a;
    text-align: center;
    font-style: italic;
}

.detail-cta {
    background: #f0f4ff; border-radius: 16px; padding: 2rem 2.2rem; margin-top: 2.8rem; text-align: center;
}
.detail-cta h3 { margin: 0 0 0.6rem; font-size: 1.3rem; color: #294197; }
.detail-cta p { margin: 0 auto 1.3rem; max-width: 620px; color: #6c7a8a; }

/* ----- Responsive Adjustments ----- */
@media (max-width: 1024px) {
    .detail-layout { grid-template-columns: 1fr; gap: 1.5rem; padding-top: 1.8rem; }
    .detail-sidebar {
        position: static; max-height: none; overflow: visible;
        display: flex; gap: 1rem; flex-wrap: wrap;
    }
    .toc-box, .quicknav-box { flex: 1 1 220px; }
}

@media (max-width: 1024px) and (min-width: 641px) {
    .detail-hero { flex-wrap: nowrap; gap: 1.5rem; }
    .detail-gallery { flex: 1 1 40%; min-width: 200px; }
    .detail-summary { flex: 1 1 60%; min-width: 280px; }
    .detail-summary h1 { font-size: 1.5rem; }
    .detail-meta-specs { gap: 1rem; padding: 1rem; }
    .detail-btn-primary, .detail-btn-outline { padding: 0.7rem 0.5rem; font-size: 0.9rem; }
}

/* Mobile View (640px and below) */
@media (max-width: 640px) {
    .detail-hero { flex-wrap: wrap; gap: 1.5rem; }
    .detail-gallery { flex: 1 1 100%; max-width: 100%; }
    .detail-summary { flex: 1 1 100%; }
    .detail-summary h1 { font-size: 1.45rem; }
    .gallery-arrow { width: 34px; height: 34px; font-size: 1rem; }
    .gallery-thumb { width: 62px; height: 62px; }
    .detail-lightbox .lb-figure { width: 600px; height: 600px; max-width: 94vw; max-height: 94vh; }
    .detail-lightbox .lb-arrow { width: 36px; height: 36px; font-size: 1rem; }
    .detail-lightbox .lb-arrow--prev { left: 8px; }
    .detail-lightbox .lb-arrow--next { right: 8px; }

    /* Stack buttons on mobile */
    .detail-actions {
        flex-direction: column;
        justify-content: center;
        gap: 0.8rem;
    }
    .detail-btn-primary, .detail-btn-outline {
        flex: none;
        width: 100%;
        padding: 0.8rem 0.5rem;
        font-size: 0.95rem;
    }
    .detail-figure { margin: 1.8rem 0; }
}

/* ============================================================
   TAGS (SCHLAGWÖRTER) - Specific Styles
   ============================================================ */
.detail-block .detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1rem 0 1.5rem;
}

.detail-block .detail-tag {
    display: inline-block;
    background: #f0f4ff;
    color: #294197 !important; /* force color to prevent global a override */
    border: 1px solid #d0ddf5;
    border-radius: 40px;
    padding: 0.45rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.25s ease;
}

.detail-block .detail-tag:hover {
    background: #294197;
    color: #ffffff !important;
    border-color: #294197;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(41, 65, 151, 0.2);
}

/* ============================================================
   SIMILAR PRODUCTS - Grid Layout
   ============================================================ */
.similar-products-grid {
    display: grid;
    /* PC: force 3 columns (equal width) */
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1.2rem;
}

/* Card base (strongly override global BASE styles) */
.similar-products-grid .product-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    text-align: left;
    padding: 0;
    margin: 0;
}

.similar-products-grid .product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
    border-color: #294197;
}

/* Link wrapper */
.similar-products-grid .product-card .card-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

/* Image (remove BASE max-width limit) */
.similar-products-grid .product-card img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    background: #f9fafb; /* light background to make image stand out */
    padding: 1rem;
    display: block;
    margin: 0 !important;
    border-bottom: 1px solid #f0f0f0;
}

/* Title */
.similar-products-grid .product-card .name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #294197;
    margin: 0.8rem 1rem 0.4rem;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    transition: color 0.2s ease;
}

.similar-products-grid .product-card:hover .name {
    color: #134b9e;
}

/* Description */
.similar-products-grid .product-card .desc {
    font-size: 0.82rem;
    color: #4a5b6e;
    margin: 0 1rem 1rem;
    line-height: 1.5;
    text-align: center;
    flex-grow: 1;
}

/* ============================================================
   Responsive Layout Adjustments
   ============================================================ */

/* Tablet (e.g. iPad) */
@media (max-width: 1024px) {
    .similar-products-grid {
        gap: 1rem;
    }
    .similar-products-grid .product-card .name {
        font-size: 0.88rem;
    }
    .similar-products-grid .product-card .desc {
        font-size: 0.78rem;
    }
}

/* Mobile (phone): force vertical single column */
@media (max-width: 820px) {
    .similar-products-grid {
        grid-template-columns: 1fr; /* single column */
        gap: 1.2rem;
    }

    .detail-block .detail-tag {
        padding: 0.35rem 1rem;
        font-size: 0.82rem;
    }

    .similar-products-grid .product-card {
        flex-direction: column;
    }

    .similar-products-grid .product-card img {
        max-height: 250px; /* limit image height on mobile */
    }
}