/* ── Product Detail Page ──────────────────────────────── */

.product-detail-page {
    display: grid;
    grid-template-columns: 55fr 45fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 1.5rem 3rem;
}

.product-detail-images {
    position: sticky;
    top: 1rem;
    align-self: start;
}

.product-hero {
    background: var(--theme-surface-light);
    border-radius: var(--theme-radius-lg);
    overflow: hidden;
    cursor: zoom-in;
    position: relative;
}

.product-hero img {
    width: 100%;
    height: calc(100vh - 180px);
    display: block;
    object-fit: contain;
}

.product-hero-zoom-hint {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0.7;
}

/* Mobile carousel — hidden on desktop */
.product-hero-carousel-wrap {
    display: none;
}

.product-thumbnails {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    overflow-x: auto;
    padding-bottom: 4px;
}

.product-thumbnail {
    width: 90px;
    height: 90px;
    border-radius: var(--theme-radius-md);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    flex-shrink: 0;
    background: var(--theme-surface-light);
    transition: border-color 0.15s;
}

.product-thumbnail:hover {
    border-color: var(--theme-text-muted);
}

.product-thumbnail.active {
    border-color: var(--mud-palette-primary);
}

.product-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── Video thumbnail indicator ───────────────────────── */

.thumbnail-video-indicator {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--theme-border);
}

.thumbnail-play-icon {
    width: 32px;
    height: 32px;
    fill: #666;
}

/* ── Details panel ───────────────────────────────────── */

.product-detail-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.product-stock-code {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--mud-palette-text-primary);
}

.product-description {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--mud-palette-text-primary);
    margin-bottom: 0.25rem;
}

.product-brand {
    font-size: 0.8rem;
    color: var(--mud-palette-text-secondary);
    margin-bottom: 1rem;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--mud-palette-text-primary);
    margin-bottom: 1.25rem;
}

.product-price .rrp {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--mud-palette-text-secondary);
    margin-left: 0.75rem;
}

/* ── Colour selector ─────────────────────────────────── */

.colour-section {
    margin-bottom: 1.25rem;
}

.colour-section-label {
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--mud-palette-text-secondary);
    margin-bottom: 0.5rem;
}

.colour-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.colour-chip {
    padding: 0.4rem 1rem;
    border: 2px solid var(--theme-border-strong);
    border-radius: var(--theme-radius-md);
    background: var(--theme-surface);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: border-color 0.15s, background 0.15s;
    user-select: none;
}

.colour-chip:hover {
    border-color: var(--theme-text-muted);
}

.colour-chip.active {
    border-color: var(--mud-palette-primary);
    background: var(--theme-surface);
    color: var(--mud-palette-primary);
}

/* ── Pack selection cards ─────────────────────────────── */

.pack-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.pack-card {
    border: 2px solid var(--theme-border-input);
    border-radius: var(--theme-radius-lg);
    padding: 0.75rem 1rem;
    transition: border-color 0.15s, background 0.15s;
}

.pack-card.selectable {
    cursor: pointer;
}

.pack-card.selectable:hover {
    border-color: var(--theme-text-muted);
}

.pack-card.selected {
    border-color: var(--mud-palette-primary);
    background: var(--theme-surface);
}

.pack-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.pack-card .pack-label {
    font-size: 0.85rem;
    font-weight: 600;
}

.pack-card .size-grid {
    border-collapse: collapse;
    font-size: 0.8rem;
}

.pack-card .size-grid td,
.pack-card .size-grid th {
    text-align: center;
    padding: 3px 10px;
    border: 1px solid var(--theme-border-input);
}

.pack-card .size-grid thead {
    background: var(--theme-surface-light);
}

.pack-card.selected .size-grid thead {
    background: var(--theme-surface-light);
}

/* ── Specifications card ─────────────────────────────── */

.product-specs {
    background: var(--theme-surface-alt);
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius-lg);
    padding: 1rem;
    margin-bottom: 1.25rem;
}

.product-specs-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--mud-palette-text-secondary);
    margin-bottom: 0.75rem;
}

.product-attributes {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--mud-palette-text-secondary);
    margin: 0;
}

.product-attributes dt {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 500;
    color: var(--mud-palette-text-primary);
}

.product-attributes dd {
    margin: 0;
    display: flex;
    align-items: center;
}

.spec-icon {
    color: var(--mud-palette-text-secondary);
}

/* ── Add to cart ──────────────────────────────────────── */

.add-to-cart-section {
    border-top: 1px solid var(--theme-border-input);
    padding-top: 1.25rem;
    margin-top: auto;
}

.post-add-prompt {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 1rem;
    background: #f0faf0;
    border-radius: var(--theme-radius-lg);
    margin-top: 0.75rem;
}

.post-add-prompt .success-text {
    font-weight: 500;
    color: var(--mud-palette-success);
    margin-right: auto;
}

/* ── Image Viewer Overlay ────────────────────────────── */

.iv-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--theme-overlay-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.iv-toolbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    z-index: 2;
    color: #fff;
}

.iv-counter {
    font-size: 0.9rem;
    opacity: 0.8;
}

.iv-close {
    color: #fff !important;
}

.iv-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.iv-image {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    transform-origin: center center;
    transition: none;
    user-select: none;
    -webkit-user-drag: none;
}

.iv-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    color: #fff !important;
    background: rgba(255,255,255,0.1) !important;
    backdrop-filter: blur(4px);
}

.iv-nav:hover {
    background: rgba(255,255,255,0.2) !important;
}

.iv-nav-left {
    left: 1rem;
}

.iv-nav-right {
    right: 1rem;
}

/* ── Mobile responsive ───────────────────────────────── */

@media (max-width: 959px) {
    .product-detail-page {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0.75rem 1rem 2rem;
        overflow-x: hidden;
    }

    .product-detail-images {
        position: static;
    }

    .product-hero {
        border-radius: 0;
        margin: 0 -1rem;
        max-width: calc(100% + 2rem);
    }

    .product-hero--single {
        display: none;
    }

    .product-hero-carousel-wrap {
        display: block;
        position: relative;
        margin: 0 -1rem;
    }

    .product-hero-carousel {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .product-hero-carousel::-webkit-scrollbar {
        display: none;
    }

    .product-hero-slide {
        flex: 0 0 100%;
        scroll-snap-align: start;
        scroll-snap-stop: always;
        background: var(--theme-surface-light);
        cursor: zoom-in;
    }

    .product-hero-slide img {
        width: 100%;
        max-height: 70vh;
        display: block;
        object-fit: contain;
    }

    .carousel-arrow {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 2;
        background: rgba(255, 255, 255, 0.7);
        border: none;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: #333;
        backdrop-filter: blur(4px);
    }

    .carousel-arrow:active {
        background: rgba(255, 255, 255, 0.9);
    }

    .carousel-arrow-left {
        left: 8px;
    }

    .carousel-arrow-right {
        right: 8px;
    }

    .carousel-counter {
        position: absolute;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.5);
        color: #fff;
        font-size: 0.75rem;
        padding: 2px 10px;
        border-radius: 12px;
        z-index: 2;
    }

    .product-thumbnails {
        display: none;
    }

    .product-price {
        font-size: 1.3rem;
    }

    .product-breadcrumbs {
        padding: 0.25rem 1rem;
    }

    .product-detail-info {
        padding-bottom: 80px;
    }

    .add-to-cart-section {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--theme-surface);
        z-index: 100;
        padding: 12px 16px !important;
        border-top: 1px solid var(--theme-border-strong);
        box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
        margin-top: 0;
    }

    .add-to-cart-section .d-flex {
        flex-wrap: wrap;
    }

    .post-add-prompt {
        flex-wrap: wrap;
    }

    .iv-nav {
        display: none;
    }
}

/* ── Breadcrumbs ─────────────────────────────────────── */

.product-breadcrumbs {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.breadcrumb-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--mud-palette-text-secondary);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.breadcrumb-back:hover {
    background: var(--theme-hover-bg);
    color: var(--mud-palette-primary);
}

.product-breadcrumbs .mud-breadcrumbs li {
    font-size: 0.85rem;
}
