﻿/* ============================================================
   KITCHEN LAB MALTA — product.css
   Individual product page (product.cshtml)

   Consolidated from the former product-detail.css +
   product-detail-ecommerce.css. Those two files existed only
   because the e-commerce layer (price/offers/warranties/gallery-
   as-swiper) was bolted on after the fact and needed !important
   overrides to reliably win a cross-file cascade race. Now that
   it's one file there's no race to defend against, so each
   previously-duplicated rule has been collapsed to a single
   declaration. Related-products carousel styling (.product-card,
   .compSwipper, .recentSwipper, etc.) lives in product-swipers.css.
   ============================================================ */

/* ── Hero layout ───────────────────────────────────────────── */
.detail-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: flex-start;
    padding: 80px var(--gutter) 0;
    /* see min-width note below the gallery block */
    min-width: 0;
}

/* ── Gallery ───────────────────────────────────────────────── */
/* .detail-gallery-main is the real Swiper root
   (class="detail-gallery-main swiper additonalImages"), so it can't
   also carry display:flex centering itself — that fights Swiper's
   own width calculation on the slide track. Centering lives one level
   down on .swiper-slide instead. */
.detail-gallery-main {
    position: relative;
    height: 520px;
    overflow: hidden;
    background: var(--c-surface);
    border-radius: 2px;
    margin-bottom: 12px;
    min-width: 0;
}

.detail-gallery-main .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-width: 0;
}

.detail-gallery-main .swiper-wrapper {
    min-width: 0;
}

.detail-gallery-main .swiper-slide img,
.detail-gallery-main img.productImage {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    padding: 36px;
    mix-blend-mode: multiply;
}

/* CSS Grid/flex items default to min-width:auto, so an unconstrained
   product image's natural pixel width gets treated as a hard minimum
   that propagates up through .swiper-wrapper -> .detail-gallery-main
   -> .detail-gallery -> the grid track, ballooning the whole hero to
   millions of pixels. min-width:0 at every level in the chain breaks
   that propagation. */
.detail-gallery {
    min-width: 0;
}

/* Solution B's swiper-pagination/prev-next chrome is kept in the DOM
   (product.js's toggleNavButtons() references it directly) but visually
   hidden — the thumbnail strip below drives navigation instead. */
.gallery-swiper-pagination-hidden,
.gallery-nav-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
    pointer-events: none;
}

/* Thumbnails — a second, synced Swiper instance (see product.js) */
.thumbnailSwiper {
    overflow: hidden;
    margin-top: 12px;
}

.detail-thumb {
    height: 110px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 2px;
    transition: border-color 0.3s;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    padding: 8px;
    mix-blend-mode: multiply;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.detail-thumb.active {
    border-color: var(--c-red);
}

    .detail-thumb.active img {
        opacity: 1;
    }

.detail-thumb:hover img {
    opacity: 0.9;
}

/* ── Info panel ────────────────────────────────────────────── */
.detail-info-brand {
    font-size: 10.5px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--c-red);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.detail-info-brand::before {
    content: '';
    display: block;
    width: 24px;
    height: 1px;
    background: var(--c-red);
}

.detail-info-name {
    font-family: var(--f-serif);
    font-size: clamp(36px,4vw,60px);
    font-weight: 300;
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.detail-info-sub {
    font-size: 14px;
    color: var(--c-muted);
    letter-spacing: 0.04em;
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

/* ── Price ─────────────────────────────────────────────────── */
.detail-price {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 8px;
}

.detail-price-current {
    font-family: var(--f-serif);
    font-size: 32px;
    font-weight: 300;
    color: var(--c-text);
}

.detail-price-original {
    font-size: 15px;
    color: var(--c-muted);
    text-decoration: line-through;
}

.detail-price-badge {
    font-size: 10.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-red);
}

/* ── SKU ───────────────────────────────────────────────────── */
.detail-sku {
    font-size: 10.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-muted);
    margin-top: 8px;
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

    .detail-sku span {
        color: var(--c-text-dim);
    }

/* ── Offers ────────────────────────────────────────────────── */
.detail-offers {
    margin-bottom: 32px;
}

.detail-offers h4,
.detail-warranties h4 {
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--c-muted);
    margin-bottom: 16px;
}

.detail-offer-card {
    border: 1px solid var(--border);
    padding: 16px 20px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color 0.25s, background 0.25s;
}

.detail-offer-card:hover {
    border-color: var(--border-mid);
}

.detail-offer-card.active {
    border-color: var(--c-red);
    background: rgba(232,57,28,0.05);
}

.detail-offer-desc {
    font-size: 13px;
    color: var(--c-text);
    margin-bottom: 8px;
}

.detail-offer-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.detail-offer-price {
    font-family: var(--f-serif);
    font-size: 18px;
    color: var(--c-text);
}

.detail-offer-savings {
    font-size: 10.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--c-red);
}

.detail-offer-btn {
    display: inline-block;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-muted);
    border: 1px solid var(--border);
    padding: 8px 16px;
    transition: color 0.3s, border-color 0.3s;
}

.detail-offer-card.active .detail-offer-btn {
    color: var(--c-red);
    border-color: var(--c-red);
}

/* ── Colour swatch selector ────────────────────────────────── */
/* Each swatch is an <a> (navigates to a genuinely separate product —
   own SKU/price/stock) rather than a <button>, so display:inline-block
   is explicit since anchors default to inline and would otherwise
   ignore width/height. */
.colour-section {
    margin-bottom: 32px;
}

.colour-section-label {
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--c-muted);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#selected-colour-name {
    color: var(--c-white);
    font-size: 11px;
}

.colour-swatches-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.colour-swatch {
    display: inline-block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--c-swatch-border);
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.25s, transform 0.2s;
    flex-shrink: 0;
}

.colour-swatch:hover {
    transform: scale(1.15);
    border-color: var(--c-swatch-hover);
}

.colour-swatch.active {
    border-color: var(--c-red) !important;
    box-shadow: 0 0 0 2px var(--c-brown), 0 0 0 4px var(--c-red);
    transform: scale(1.1);
}

/* Falls back to the substitute's own product photo when no known
   Le Creuset colour name matches the substitute's description. */
.colour-swatch-photo {
    background-size: cover;
    background-position: center;
}

/* ── Features ──────────────────────────────────────────────── */
.detail-features {
    margin-bottom: 40px;
}

.detail-features h4 {
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--c-muted);
    margin-bottom: 20px;
}

.detail-features ul {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0px;
}

.detail-features li {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    font-size: 13.5px;
    color: var(--c-text-feature);
    line-height: 1.5;
}

.detail-features li::before {
    content: '';
    display: block;
    width: 5px;
    height: 5px;
    background: var(--c-red);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}

/* ── Warranties ────────────────────────────────────────────── */
.detail-warranties {
    margin-bottom: 32px;
}

.detail-warranty-option {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--c-text-feature);
    padding: 10px 0;
    cursor: pointer;
}

.detail-warranty-option input[type="radio"] {
    accent-color: var(--c-red);
}

.detail-warranty-price {
    margin-left: auto;
    color: var(--c-muted);
    font-size: 12px;
}

/* ── Actions ───────────────────────────────────────────────── */
.detail-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 36px;
    border-top: 1px solid var(--border);
}

/* ── Tabs ──────────────────────────────────────────────────── */
.detail-tabs {
    padding: 0 var(--gutter);
    border-bottom: 1px solid var(--border);
    margin-top: 72px;
    display: flex;
    gap: 0;
}

.tab-btn {
    font-family: var(--f-sans);
    font-size: 11.5px;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--c-muted);
    padding: 20px 36px;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.3s, border-color 0.3s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

.tab-btn:hover {
    color: var(--c-text);
}

.tab-btn.active {
    color: var(--c-text);
    border-bottom-color: var(--c-red);
}

.tab-content {
    display: none;
    padding: 60px var(--gutter);
}

.tab-content.active {
    display: block;
}

/* Overview tab */
.tab-description {
    max-width: 680px;
    font-size: 15px;
    color: var(--c-muted-light);
    line-height: 1.9;
    margin-bottom: 60px;
}

/* WebDesc is raw HTML from the database, almost always with inline
   color/background-color styles baked in by whatever rich-text editor
   wrote it — fine against a white page, unreadable (or a stray grey
   box) against this dark theme. Inline styles beat normal CSS, hence
   !important. */
#webDescriptionContainer,
#webDescriptionContainer * {
    color: var(--c-muted-light) !important;
    background-color: transparent !important;
}

#webDescriptionContainer strong,
#webDescriptionContainer b {
    color: var(--c-text) !important;
}

#webDescriptionContainer a {
    color: var(--c-red) !important;
}

#webDescriptionContainer *,
#webDescriptionContainer hr {
    border-color: var(--border) !important;
}

/* Specs tab */
.specs-table {
    width: 100%;
    max-width: 720px;
    border-collapse: collapse;
}

.specs-table tr {
    border-bottom: 1px solid var(--border);
}

.specs-table tr:last-child {
    border-bottom: none;
}

.specs-table td {
    padding: 18px 0;
    font-size: 13.5px;
    vertical-align: top;
}

.specs-table td:first-child {
    width: 220px;
    color: var(--c-muted);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding-right: 24px;
}

.specs-table td:last-child {
    color: var(--c-text);
}

/* Downloads tab */
.downloads-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 600px;
}

.download-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}

.download-item:first-child {
    border-top: 1px solid var(--border);
}

.download-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.download-icon {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--c-muted);
}

.download-name {
    font-size: 14px;
    color: var(--c-text);
}

.download-type {
    font-size: 10.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-muted);
    margin-top: 4px;
}

.download-btn {
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--c-muted);
    border: 1px solid var(--border);
    padding: 8px 16px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.download-btn:hover {
    color: var(--c-text);
    border-color: var(--border-mid);
}

/* ── Related-products section wrapper ──────────────────────────
   This is just the page-level heading/section rhythm; the carousel
   mechanics inside it (compSwipper/recentSwipper, .product-card) are
   in product-swipers.css. ── */
.related-section {
    padding: 80px var(--gutter) 120px;
    border-top: 1px solid var(--border);
}

.related-section .sec-h2 {
    margin-top: 16px;
    margin-bottom: 52px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
    .detail-hero {
        gap: 48px;
    }

    .detail-gallery-main {
        height: 420px;
    }
}

@media (max-width: 900px) {
    .detail-hero {
        grid-template-columns: 1fr;
        gap: 36px;
        padding: 60px var(--gutter) 0;
    }

    .detail-gallery-main {
        height: 380px;
    }

    .detail-tabs {
        padding: 0 var(--gutter);
        overflow-x: auto;
        white-space: nowrap;
    }

    .tab-content {
        padding: 40px var(--gutter);
    }
}

@media (max-width: 767px) {
    .detail-hero {
        padding: calc(72px + 36px) var(--gutter) 0;
    }

    .detail-gallery-main {
        height: 300px;
    }

    .detail-thumb {
        height: 80px;
    }

    .detail-price-current {
        font-size: 26px;
    }

    .detail-info-name {
        font-size: clamp(32px, 8vw, 52px);
    }

    .detail-actions {
        padding-top: 28px;
        gap: 12px;
    }

    .related-section {
        padding: 48px var(--gutter) 100px;
    }

    .tab-btn {
        padding: 16px 20px;
        font-size: 10.5px;
    }

    .specs-table td:first-child {
        width: 140px;
        font-size: 10px;
    }
}
