/**
 * Glowstone - Collection, Series & Product Pages
 * Eternal Surfaces style layout
 */

.collection-section,
.collection-series-section,
.collection-product-section {
    scroll-margin-top: 80px;
}

/* Notched devices: add safe-area to Bootstrap horizontal padding */
.collection-product-section .container,
.collection-series-section .container,
.collection-section .container {
    padding-left: calc(var(--bs-gutter-x, 1.5rem) * 0.5 + env(safe-area-inset-left, 0px));
    padding-right: calc(var(--bs-gutter-x, 1.5rem) * 0.5 + env(safe-area-inset-right, 0px));
}

/* Domestic collection landing — hero focal point on luxury kitchen render */
.collection-domestic-hero-bg {
    background-position: center 38%;
}

@media (max-width: 768px) {
    .collection-domestic-hero-bg {
        background-position: center 45%;
    }
}

/* Brochure downloads (e.g. domestic collection hub) */
.collection-brochure-cta {
    padding: 2.5rem 0 1rem;
    border-top: 1px solid rgba(201, 169, 98, 0.15);
}

.collection-brochure-cta .container {
    padding-left: calc(var(--bs-gutter-x, 1.5rem) * 0.5 + env(safe-area-inset-left, 0px));
    padding-right: calc(var(--bs-gutter-x, 1.5rem) * 0.5 + env(safe-area-inset-right, 0px));
}

.collection-brochure-cta-inner {
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
}

.collection-brochure-cta-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--navbar-accent);
    margin-bottom: 0.5rem;
    letter-spacing: 0.06em;
}

.collection-brochure-cta-lead {
    font-size: 0.95rem;
    color: rgba(232, 228, 223, 0.65);
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.collection-brochure-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.collection-brochure-link {
    display: inline-block;
    padding: 0.65rem 1.35rem;
    border: 1px solid rgba(201, 169, 98, 0.45);
    color: var(--navbar-accent);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 4px;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.collection-brochure-link:hover {
    background: rgba(201, 169, 98, 0.12);
    border-color: var(--navbar-accent);
    color: #f5f0ea;
}

.collection-brochure-link:focus-visible {
    outline: 2px solid var(--navbar-accent);
    outline-offset: 2px;
}

/* SKU pages: brochure sits inside existing section .container (no nested container) */
.collection-brochure-cta--embed {
    padding: 2rem 0 0;
    margin-top: 1.5rem;
    border-top: 1px solid rgba(201, 169, 98, 0.15);
}

.collection-brochure-cta--embed .collection-brochure-cta-inner {
    max-width: 720px;
}

/* ===== Collections Grid (Series Cards) ===== */
.collection-hero {
    padding: 6rem 0 4rem;
    text-align: center;
}

.collection-hero .section-label {
    display: block;
    font-size: var(--text-small);
    font-weight: 500;
    letter-spacing: 0.25em;
    color: var(--navbar-accent);
    margin-bottom: 1rem;
}

.collection-hero h1 {
    font-size: clamp(2.65rem, 5.25vw, 3.75rem);
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.collection-hero-subtitle {
    font-size: 1.1rem;
    color: rgba(232, 228, 223, 0.8);
}

/* Series Cards Grid */
.series-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    padding: 2rem 0 4rem;
}

.series-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 4/5;
    background: #1a1a1a;
}

.series-card-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.series-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* Ensure product/series card images are responsive */
.product-card-image,
.series-card-image {
    max-width: 100%;
}

.series-card:hover .series-card-image {
    transform: scale(1.05);
}

.series-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
}

.series-card-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-light);
    margin: 0 0 0.5rem;
}

.series-card-cta {
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: var(--navbar-accent);
    margin-top: 0.5rem;
}

.series-card-cta::after {
    content: ' →';
}

/* Placeholder for series without image */
.series-card-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a 0%, #252525 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.series-card-placeholder span {
    font-size: 1.5rem;
    color: rgba(201, 169, 98, 0.5);
}

/* ===== Series Page (Products Grid) ===== */
.series-page-header {
    padding: 4rem 0 2rem;
    text-align: center;
}

.series-page-header .section-label {
    display: block;
    font-size: var(--text-small);
    font-weight: 500;
    letter-spacing: 0.25em;
    color: var(--navbar-accent);
    margin-bottom: 0.5rem;
}

.series-page-header h1,
.series-page-header h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 600;
    color: var(--text-light);
    margin: 0;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 2rem 0 4rem;
}

.product-card {
    border-radius: 12px;
    overflow: hidden;
    background: rgba(235, 228, 216, 0.04);
    border: 1px solid rgba(201, 169, 98, 0.15);
    transition: border-color 0.3s, transform 0.3s;
}

.product-card:hover {
    border-color: rgba(201, 169, 98, 0.4);
    transform: translateY(-4px);
}

.product-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.product-card-image {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    object-position: center;
    display: block;
}

.product-card-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card-placeholder span {
    font-size: 0.9rem;
    color: rgba(232, 228, 223, 0.4);
}

.product-card-info {
    padding: 1.25rem;
}

.product-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #e8e4df;
    margin: 0;
}

.product-card-cta {
    font-size: 0.85rem;
    color: var(--navbar-accent);
    margin-top: 0.5rem;
}

/* Series intro content */
.series-intro {
    max-width: 720px;
    margin: 0 auto 2.5rem;
    text-align: center;
}

.series-intro p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: rgba(232, 228, 223, 0.85);
    margin-bottom: 1rem;
}

.series-intro p:last-child {
    margin-bottom: 0;
}

/* Series empty state */
.series-empty {
    text-align: center;
    padding: 4rem 2rem;
}

.series-empty p {
    color: rgba(232, 228, 223, 0.7);
    font-size: 1.1rem;
}

/* ===== Product Page (Renders Gallery) ===== */
.product-page-header {
    padding: 4rem 0 2rem;
    text-align: center;
}

.product-page-header .breadcrumb {
    margin-bottom: 1rem;
}

.product-page-header h1,
.product-page-header h2 {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 600;
    color: var(--text-light);
    margin: 0;
}

.product-renders {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 2rem 0 4rem;
}

.product-render-item {
    border-radius: 8px;
    overflow: hidden;
    background: #1a1a1a;
    aspect-ratio: 4 / 3;
}

.product-render-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
}

.product-render-placeholder {
    aspect-ratio: 4/3;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-render-placeholder span {
    color: rgba(232, 228, 223, 0.4);
}

/* Product slab + content layout */
.product-slab-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
    margin-bottom: 3rem;
}

.product-slab-image {
    border-radius: 8px;
    overflow: hidden;
    background: #1a1a1a;
}

/*
 * Slab photos: show full image (no crop). Frame follows natural aspect ratio; cap height for very large files.
 * Lightbox (.render-lightbox-content img) still uses contain for full-screen view.
 */
.product-slab-image:has(> img:only-child) {
    aspect-ratio: unset;
    max-height: none;
}

/* Placeholder shown when a product has no slab photo yet */
.slab-coming-soon {
    aspect-ratio: 16 / 9;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 1rem;
    text-align: center;
    background: linear-gradient(135deg, #202020 0%, #2b2b2b 50%, #1a1a1a 100%);
}
.slab-coming-soon .scs-text {
    font-size: 1.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 500;
    color: #c9a84c;
}
.slab-coming-soon .scs-sub {
    font-size: 0.78rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #8a8278;
}

.product-slab-image > img:only-child {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: min(92vh, 1400px);
    min-height: 0;
    display: block;
    object-fit: contain;
    object-position: center;
    cursor: zoom-in;
}

.product-slab-image img:focus-visible {
    outline: 2px solid var(--navbar-accent, #c9a962);
    outline-offset: 3px;
}

/* Slab carousel: height follows the active slide’s image (no fixed aspect ratio, no cover crop) */
.product-slab-image .carousel {
    border-radius: 8px;
    overflow: hidden;
    background: #1a1a1a;
    width: 100%;
    aspect-ratio: unset;
    max-height: none;
}

.product-slab-image .carousel-inner {
    height: auto;
    min-height: 0;
    background: #1a1a1a;
}

.product-slab-image .carousel .carousel-item {
    float: none;
    margin-right: 0;
    width: 100%;
    height: auto;
    min-height: 0;
}

/* Prevent temporary stacked slab images before carousel JS/CSS settles */
.product-slab-image .carousel .carousel-item {
    display: none;
}

.product-slab-image .carousel .carousel-item.active {
    display: block;
}

.product-slab-image .carousel-item img {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: min(92vh, 1400px);
    display: block;
    object-fit: contain;
    object-position: center;
    margin: 0 auto;
    cursor: zoom-in;
}

.product-slab-image .carousel-indicators {
    margin-bottom: 0.35rem;
}

.product-slab-image .carousel-indicators [data-bs-target] {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(232, 228, 223, 0.45);
}

.product-slab-image .carousel-indicators .active {
    background-color: var(--navbar-accent);
}

.product-slab-image .carousel-control-prev,
.product-slab-image .carousel-control-next {
    width: 12%;
    opacity: 0.9;
}

.product-slab-image .carousel-control-prev-icon,
.product-slab-image .carousel-control-next-icon {
    filter: invert(1) drop-shadow(0 0 2px rgba(0, 0, 0, 0.8));
}

.product-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #e8e4df;
    margin-bottom: 1rem;
}

.product-content p {
    font-size: 1rem;
    line-height: 1.8;
    color: rgba(232, 228, 223, 0.85);
    margin-bottom: 1rem;
}

.product-content p:last-child {
    margin-bottom: 0;
}

/* Description, thickness, size (product detail list) */
.product-facts {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.product-fact {
    margin: 0;
    padding: 0 0 1.25rem;
    border-bottom: 1px solid rgba(201, 169, 98, 0.12);
}

.product-fact:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.product-fact dt {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--navbar-accent);
    margin-bottom: 0.5rem;
}

.product-fact dd {
    margin: 0;
    font-size: 1rem;
    line-height: 1.75;
    color: rgba(232, 228, 223, 0.88);
}

.product-description p {
    margin-bottom: 0.85rem;
}

.product-description p:last-child {
    margin-bottom: 0;
}

.product-renders-heading {
    font-size: 1.35rem;
    font-weight: 600;
    color: #e8e4df;
    margin-bottom: 1.5rem;
}

.product-cta-section {
    text-align: center;
    padding: 3rem 0;
}

@media (max-width: 767px) {
    .product-slab-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .product-slab-image {
        order: 1;
    }

    .product-content {
        order: 2;
    }
}

/* Responsive */
@media (max-width: 991px) {
    .collection-hero {
        padding: 4rem 0 3rem;
    }

    .collection-hero h1,
    .collection-hero h2 {
        font-size: clamp(2rem, 4.5vw, 2.75rem);
    }

    .series-page-header {
        padding: 3rem 0 1.5rem;
    }

    .series-intro {
        margin-bottom: 2rem;
    }
}

@media (max-width: 768px) {
    .series-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem 0 3rem;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 1.5rem 0 3rem;
    }

    .product-card-info {
        padding: 1rem;
    }

    .product-card-title {
        font-size: 1.1rem;
    }

    .collection-hero {
        padding: 3rem 0 2rem;
    }

    .product-page-header {
        padding: 3rem 0 1.5rem;
    }

    .product-slab-content {
        gap: 2rem;
        margin-bottom: 2rem;
    }
}

@media (max-width: 576px) {
    .collection-hero {
        padding: 2.5rem 0 1.5rem;
    }

    .collection-hero h1,
    .collection-hero h2 {
        font-size: 1.75rem;
    }

    .collection-hero-subtitle {
        font-size: 1rem;
    }

    .series-grid {
        gap: 1.25rem;
        padding: 1rem 0 2.5rem;
    }

    .series-card-overlay {
        padding: 1.5rem;
    }

    .series-card-title {
        font-size: 1.5rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem 0 2rem;
    }

    .product-renders {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1.5rem 0 3rem;
    }

    .product-renders-heading {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }

    .product-cta-section {
        padding: 2rem 0;
    }
}

@media (max-width: 400px) {
    .series-card-overlay {
        padding: 1rem;
    }

    .series-card-title {
        font-size: 1.35rem;
    }

    .product-card-info {
        padding: 0.875rem;
    }

    .product-card-title {
        font-size: 1rem;
    }
}

/* ===== Render Lightbox (full-size + slider) ===== */
.render-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.95);
    align-items: center;
    justify-content: center;
    padding: max(2rem, env(safe-area-inset-top, 0px)) max(2rem, env(safe-area-inset-right, 0px)) max(2rem, env(safe-area-inset-bottom, 0px)) max(2rem, env(safe-area-inset-left, 0px));
}

.render-lightbox.active {
    display: flex;
}

.render-lightbox-close {
    position: absolute;
    z-index: 2;
    top: max(1.5rem, env(safe-area-inset-top, 0px));
    right: max(1.5rem, env(safe-area-inset-right, 0px));
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(235, 228, 216, 0.12);
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.render-lightbox-close:hover {
    background: rgba(235, 228, 216, 0.22);
}

.render-lightbox-prev,
.render-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    border: none;
    background: rgba(235, 228, 216, 0.12);
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.render-lightbox-prev { left: max(1rem, env(safe-area-inset-left, 0px)); }
.render-lightbox-next { right: max(1rem, env(safe-area-inset-right, 0px)); }

.render-lightbox-prev:hover,
.render-lightbox-next:hover {
    background: rgba(235, 228, 216, 0.28);
}

.render-lightbox-prev:disabled,
.render-lightbox-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.render-lightbox-content {
    position: relative;
    z-index: 0;
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Full source image in overlay (no crop); previews above use object-fit: cover only in-page */
.render-lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
}

.render-lightbox-counter {
    position: absolute;
    z-index: 2;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(235, 228, 216, 0.88);
    font-size: 0.95rem;
}

.product-render-item {
    cursor: pointer;
}

.product-render-item img {
    transition: opacity 0.2s;
}

.product-render-item:hover img {
    opacity: 0.9;
}

/* Lightbox - Mobile responsive */
@media (max-width: 768px) {
    .render-lightbox {
        padding: 1rem;
    }

    .render-lightbox-close {
        top: max(1rem, env(safe-area-inset-top));
        right: max(1rem, env(safe-area-inset-right));
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }

    .render-lightbox-prev {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        left: 0.5rem;
    }

    .render-lightbox-next {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        right: 0.5rem;
    }

    .render-lightbox-content img {
        max-height: 85vh;
    }

    .render-lightbox-counter {
        bottom: max(1rem, env(safe-area-inset-bottom));
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .render-lightbox {
        padding: 0.75rem;
    }

    .render-lightbox-close {
        top: max(0.75rem, env(safe-area-inset-top));
        right: max(0.75rem, env(safe-area-inset-right));
    }

    .render-lightbox-content img {
        max-height: 80vh;
    }
}


/* ===== Collection market tabs (Domestic / International) ===== */
.collection-market-tabs{display:flex;justify-content:center;gap:.5rem;margin:0 auto 2.5rem;flex-wrap:wrap}
.collection-market-tab{display:inline-block;padding:.6rem 1.6rem;border:1px solid var(--navbar-accent,#c9a962);border-radius:999px;color:var(--navbar-accent,#c9a962);text-decoration:none;font-size:.85rem;letter-spacing:.08em;text-transform:uppercase;font-weight:500;transition:all .25s ease;background:transparent}
.collection-market-tab:hover{background:rgba(201,169,98,.12);color:var(--navbar-accent,#c9a962)}
.collection-market-tab.active{background:var(--navbar-accent,#c9a962);color:#0f0f0f}
@media (max-width:480px){.collection-market-tab{padding:.5rem 1.1rem;font-size:.78rem}}

/* ===== Collection hub hero: Download Brochure button ===== */
.about-hero-brochure {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 1.4rem;
    padding: 0.6rem 1.4rem;
    background: var(--navbar-accent, #c9a962);
    color: #0f0f0f;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--navbar-accent, #c9a962);
    border-radius: 999px;
    transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.about-hero-brochure:hover {
    background: transparent;
    color: var(--navbar-accent, #c9a962);
    transform: translateY(-2px);
}
.about-hero-brochure:focus-visible {
    outline: 2px solid var(--navbar-accent, #c9a962);
    outline-offset: 3px;
}
.about-hero-brochure svg { width: 14px; height: 14px; flex-shrink: 0; }

@media (max-width: 480px) {
    .about-hero-brochure { padding: 0.7rem 1.4rem; font-size: 0.72rem; letter-spacing: 0.08em; }
    .about-hero-brochure svg { width: 14px; height: 14px; }
}

/* ===== Collection sort control — segmented pill control ===== */
.collection-sort {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin: 0 auto 2.5rem;
}
.collection-sort-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(232, 228, 223, 0.55);
    font-weight: 500;
}
.collection-sort-label svg { width: 15px; height: 15px; color: var(--navbar-accent, #c9a962); }

/* connected segmented group in one rounded container */
.collection-sort-group {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid rgba(201, 169, 98, 0.3);
    border-radius: 999px;
    overflow: hidden;
    background: rgba(235, 228, 216, 0.03);
}
.collection-sort-btn {
    padding: 0.5rem 1.25rem;
    border: none;
    border-left: 1px solid rgba(201, 169, 98, 0.18);
    background: transparent;
    color: rgba(232, 228, 223, 0.75);
    font-size: 0.74rem;
    letter-spacing: 0.05em;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease;
}
.collection-sort-btn:first-child { border-left: none; }
.collection-sort-btn:hover {
    background: rgba(201, 169, 98, 0.1);
    color: var(--navbar-accent, #c9a962);
}
.collection-sort-btn.active {
    background: var(--navbar-accent, #c9a962);
    color: #0f0f0f;
    font-weight: 600;
}
.collection-sort-btn:focus-visible { outline: 2px solid var(--navbar-accent, #c9a962); outline-offset: 2px; }

@media (max-width: 480px) {
    .collection-sort { gap: 0.5rem; }
    .collection-sort-btn { padding: 0.45rem 0.9rem; font-size: 0.7rem; }
}
