/* The header stays wide; page content shares the product detail margins. */
:root {
    --store-content-width: 120rem;
    --store-gutter: 1rem;
    --store-grid-gap: 0.75rem;
}

.store-shell {
    box-sizing: border-box;
    width: 100%;
    max-width: var(--store-content-width);
    min-width: 0;
    margin-inline: auto;
    padding-inline: var(--store-gutter);
}

.store-content-shell {
    max-width: calc(100rem + 2 * var(--store-gutter));
}

.store-hero .banner-slide__backdrop { display: none; }

@media (min-width: 1024px) {
    .store-hero .banner-slide {
        height: clamp(23rem, 30vw, 30rem);
        background: #080b10;
        isolation: isolate;
    }

    .store-hero .banner-slide:hover { transform: none; }

    .store-hero .banner-slide__img:not(.banner-slide__backdrop) {
        object-fit: contain;
        object-position: right center;
        z-index: 1;
        filter: none;
        mask-image: linear-gradient(to right, transparent, #000 32%);
        -webkit-mask-image: linear-gradient(to right, transparent, #000 32%);
    }

    .store-hero .banner-slide__backdrop {
        display: block;
        z-index: 0;
        object-fit: cover;
        filter: blur(28px) brightness(0.55);
        transform: scale(1.08);
        opacity: 0.65;
    }

    .store-hero .banner-slide-overlay {
        z-index: 2;
        background: linear-gradient(90deg, rgba(8, 11, 16, 0.9), rgba(8, 11, 16, 0.55) 36%, transparent 68%);
    }

    .store-hero .banner-content {
        z-index: 3;
        width: 44%;
        min-width: 0;
        max-width: 36rem;
        padding: clamp(1.75rem, 3vw, 3rem);
    }
}

.store-shell .home-section,
.store-shell .store-categories-section,
.store-shell .category-view-layout,
.store-shell .categories-section,
.store-shell .related-products-section,
.store-shell .similar-price-section {
    min-width: 0;
    margin-inline: 0;
    padding-inline: 0;
}

.store-shell .home-section {
    margin-bottom: clamp(1.5rem, 2.5vw, 2.5rem);
}

.store-shell .category-filter-header h2 { font-size: 1rem !important; }

.store-shell .store-products-grid,
.store-shell .price-timer__grid.store-products-grid,
.store-live-search .store-products-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: var(--store-grid-gap);
    width: 100%;
    min-width: 0;
}

.store-products-grid > *,
.store-products-grid .product-card,
.store-products-grid .related-product-card,
.store-shell .home-section-inner,
.store-shell .category-view-layout > * {
    min-width: 0;
}

.store-products-grid .product-card,
.store-products-grid .related-product-card {
    height: 100%;
}

.store-products-grid .product-card h3 {
    overflow-wrap: anywhere;
}

.store-shell .store-pack-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--store-grid-gap);
}

.store-shell .store-categories-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--store-grid-gap);
}

/* Horizontal rows keep a useful card size and scroll inside their own section. */
.store-shell .home-section-scroll {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
}

.store-shell .home-section-scroll > .flex {
    gap: var(--store-grid-gap);
    padding-bottom: 0.5rem;
}

.store-shell .home-section-scroll > .flex > div {
    flex: 0 0 8rem;
    width: 8rem;
    margin-inline: 0;
    scroll-snap-align: start;
}

.store-rail-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.store-rail-heading .home-section-title {
    min-width: 0;
    margin-bottom: 0;
}

.store-rail-controls {
    display: flex;
    flex-shrink: 0;
    gap: 0.5rem;
}

.store-rail-controls[hidden] { display: none; }

.store-rail-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1px solid var(--color-outline, #e2e8f0);
    border-radius: 50%;
    color: var(--color-text-primary, #0f172a);
    background: var(--color-surface-primary, #fff);
    cursor: pointer;
}

.store-rail-button:disabled {
    opacity: 0.35;
    cursor: default;
    box-shadow: none;
    transform: none;
}

.store-rail-button:focus-visible,
.store-shell .home-section-scroll:focus-visible {
    outline: 2px solid var(--color-primary, #4f46e5);
    outline-offset: 2px;
}

.store-header .store-header-main { position: relative; padding-block: 0.5rem; }
.store-header .store-header-row,
.store-header .store-header-row > :first-child,
.store-header .store-header-row > :first-child > div,
.store-header .store-brand-link,
.store-header .search-bar-container form > .flex-1 {
    min-width: 0;
}

.store-header .store-header-row { gap: 0.75rem; margin-bottom: 0.5rem; }
.store-header .store-header-row > :last-child { flex-shrink: 0; }
.store-header .store-brand-link h1 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1.125rem !important;
}

.store-header .search-input-theme { min-height: 2.75rem; padding-block: 0.75rem; }
.store-header .search-bar-btn,
.store-header .filters-toggle-btn { flex-shrink: 0; min-height: 2.75rem; padding-block: 0.75rem; }
.store-header .store-header-search { min-width: 0; }
.store-header .store-header-search > :not([hidden]) ~ :not([hidden]) { margin-top: 0.5rem; }
.store-header #filters-panel {
    position: absolute;
    top: 100%;
    inset-inline: var(--store-gutter);
    z-index: 50;
    margin-top: 0;
    max-height: max(8rem, min(60svh, calc(100svh - var(--store-header-height, 10rem) - 1rem)));
    overflow-y: auto;
    overscroll-behavior-y: contain;
}

.store-header #app-menu-dropdown {
    max-width: calc(100vw - 2 * var(--store-gutter));
    max-height: calc(100svh - 5rem);
    overflow-y: auto;
    overscroll-behavior-y: contain;
}

.store-header #language-submenu {
    position: static;
    width: auto;
    margin: 0.25rem 0.5rem;
}

/* Shared navigation stays within the sticky header, including on product pages. */
.store-category-navigation { border-top: 1px solid var(--color-outline, #e2e8f0); }
.store-category-navigation .store-category-nav-shell { padding-block: 0.25rem 0.375rem; }
.store-category-navigation .categories-section { margin-block: 0; }
.store-category-navigation .categories-nav-wrapper { min-width: 0; gap: 0.5rem; }
.store-category-navigation #categories-scroll {
    min-width: 0;
    max-width: 100%;
    padding-block: 0.125rem;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 0.125rem;
}

.store-category-navigation .category-pill {
    box-sizing: border-box;
    min-height: 2.75rem;
    padding-inline: 0.875rem;
    white-space: nowrap;
    scroll-snap-align: start;
}

.store-category-navigation .categories-nav-btn {
    width: 2.75rem;
    height: 2.75rem;
    opacity: 1;
}

.store-category-navigation .categories-nav-btn[hidden] { display: none; }
.store-category-navigation .categories-nav-wrapper .categories-nav-btn:disabled { opacity: 0.35; }
.store-category-navigation .category-pill:focus-visible,
.store-category-navigation .categories-nav-btn:focus-visible {
    outline: 2px solid var(--color-primary, #4f46e5);
    outline-offset: -2px;
}

/* Search suggestions share the store width and leave the complete header visible. */
.store-live-search {
    position: fixed;
    z-index: 40;
    top: calc(var(--store-header-height, 10rem) + 0.5rem);
    left: 50%;
    width: calc(100% - 2 * var(--store-gutter));
    max-width: calc(var(--store-content-width) - 2 * var(--store-gutter));
    max-height: calc(100vh - var(--store-header-height, 10rem) - 1rem);
    max-height: calc(100dvh - var(--store-header-height, 10rem) - 1rem);
    box-sizing: border-box;
    padding: 0.875rem;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    transform: translateX(-50%);
    border: 1px solid var(--color-outline, #e2e8f0);
    border-radius: 1rem;
    color: var(--color-text-primary, #0f172a);
    background: var(--color-surface-primary, #fff);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

.store-live-search[hidden],
.store-live-search .store-search-image > img[hidden] { display: none; }
.store-live-search .store-search-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.store-live-search .store-search-heading > h2 {
    min-width: 0;
    margin: 0;
    font-size: 1rem !important;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.store-live-search .store-search-close {
    flex-shrink: 0;
    min-height: 2.75rem;
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--color-outline, #e2e8f0);
    border-radius: 0.625rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--color-text-primary, #0f172a);
    background: var(--color-surface-primary, #fff);
    cursor: pointer;
}

.store-live-search > .store-search-close { margin-top: 0.875rem; }
.store-live-search .store-search-count {
    margin: 0.25rem 0 0.875rem;
    font-size: 0.8125rem;
    color: var(--color-text-secondary, #64748b);
}

.store-live-search .store-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.store-live-search .store-search-result {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 0.5rem;
    padding: 0.625rem;
    border: 1px solid var(--color-outline, #e2e8f0);
    border-radius: 0.75rem;
    color: var(--color-text-primary, #0f172a);
    text-decoration: none;
}

.store-live-search .store-search-image {
    width: 100%;
    height: clamp(6rem, 14vw, 10rem);
    overflow: hidden;
    border-radius: 0.375rem;
    background: var(--color-surface-primary, #fff);
}

.store-live-search .store-search-image > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.store-live-search .store-search-name {
    display: -webkit-box;
    min-height: 2.8em;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow-wrap: anywhere;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
}

.store-live-search .store-search-price { margin-top: auto; font-size: 1rem; font-weight: 600; }
.store-live-search .store-search-empty { margin: 0; line-height: 1.6; overflow-wrap: anywhere; }
.store-live-search .store-search-close:hover,
.store-live-search .store-search-result:hover { background: var(--color-surface-secondary, #f8fafc); }
.store-live-search .store-search-close:focus-visible,
.store-live-search .store-search-result:focus-visible {
    outline: 2px solid var(--color-primary, #4f46e5);
    outline-offset: 2px;
}

/* Product detail remains readable on very large monitors. */
.store-shell .product-detail-layout {
    max-width: 100rem;
    margin-inline: auto;
}

@media (min-width: 640px) {
    :root {
        --store-gutter: clamp(1.25rem, 2vw, 2.5rem);
        --store-grid-gap: clamp(1rem, 1.2vw, 1.5rem);
    }

    .store-shell .store-products-grid,
    .store-shell .price-timer__grid.store-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr));
    }

    .store-live-search .store-products-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

    .store-shell .store-pack-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
    }

    .store-shell .store-categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr));
    }

    .store-shell .home-section-scroll > .flex > div {
        flex-basis: clamp(10rem, 12vw, 13rem);
        width: clamp(10rem, 12vw, 13rem);
    }
}

@media (pointer: fine) {
    .store-shell .home-section-scroll {
        scrollbar-width: thin;
        scrollbar-color: var(--color-outline, #cbd5e1) transparent;
    }

    .store-shell .home-section-scroll::-webkit-scrollbar {
        display: block;
        height: 6px;
    }

    .store-shell .home-section-scroll::-webkit-scrollbar-thumb {
        border-radius: 999px;
        background: var(--color-outline, #cbd5e1);
    }
}

@media (max-width: 359px) {
    :root { --store-grid-gap: 0.5rem; }
    .store-header .filters-toggle-btn { padding-inline: 0.625rem; }
}

/* Product page: one layout instead of nested padded cards. */
.store-product-view {
    --store-product-header-height: 10rem;
    --store-gallery-height: clamp(12rem, 36svh, 21rem);
}

.store-product-page {
    width: 100%;
    max-width: 100rem;
    min-width: 0;
    margin-inline: auto;
    padding: 0 !important;
    background: transparent !important;
    border: 0;
    border-radius: 0;
    box-shadow: none !important;
    overflow: visible;
}

.store-product-page .product-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "heading" "gallery" "purchase" "details";
    gap: 0.875rem !important;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible;
}

.store-product-page .product-detail-layout::before { display: none; }
.store-product-page .product-summary-header { grid-area: heading; min-width: 0; }
.store-product-page .product-gallery { grid-area: gallery; }
.store-product-page .product-detail-container { grid-area: purchase; }

.store-product-page .product-summary-header.space-y-3 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.5rem; }
.store-product-page .product-summary-header h1 {
    min-width: 0;
    max-width: 100%;
    margin: 0;
    font-size: clamp(1.125rem, 1.6vw, 1.625rem) !important;
    line-height: 1.3;
    color: var(--color-text-primary) !important;
    overflow-wrap: anywhere;
}

.store-product-page .product-detail-container {
    min-width: 0;
    padding: 0;
    gap: 0.875rem;
    animation: none;
}

.store-product-page .product-detail-container .product-info-pricing { gap: 0.75rem; }
.store-product-page .product-detail-container .leading-relaxed { line-height: 1.65; }
.store-product-page .product-description {
    grid-column: 1 / -1;
    width: 100%;
    max-width: none;
}
.store-product-page .product-long-details {
    grid-area: details;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--color-outline, #e2e8f0);
    align-items: start;
}

.store-product-page .product-long-details > * { min-width: 0; }
.store-product-page .product-long-details:not(:has(> div)) { display: none; }
.store-product-page .product-long-details > :only-child { grid-column: 1 / -1; }
.store-product-page .product-long-details > .space-y-6 {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 1.25rem;
}

.store-product-page .product-long-details > .space-y-6 > :not([hidden]) ~ :not([hidden]) { margin-top: 0 !important; }

.store-product-page .product-support-details {
    display: grid;
    align-content: start;
    gap: 1.25rem;
    min-width: 0;
}

.store-product-page .product-support-details > * { margin-block: 0; }

.store-product-page .product-gallery {
    min-width: 0;
    position: static;
    align-self: start;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.625rem;
    max-height: none;
    height: auto;
}

.store-product-page .main-image-container {
    box-sizing: border-box;
    height: var(--store-gallery-height);
    min-height: 0;
    padding-bottom: 0 !important;
}

.store-product-page #main-media-container img,
.store-product-page #main-media-container video {
    width: 100%;
    height: 100%;
    object-fit: contain !important;
}

.store-product-page .product-gallery-thumbnails { min-width: 0; }
.store-product-page #thumbnails-container {
    gap: 0.5rem;
    margin: 0;
    padding: 0.125rem !important;
    scroll-snap-type: x proximity;
}

.store-product-page .thumbnail-item {
    position: relative;
    width: 3.5rem;
    height: 3.5rem;
    min-width: 3.5rem;
    min-height: 3.5rem;
    margin: 0 !important;
    padding: 0;
    background: var(--color-surface-primary);
    scroll-snap-align: start;
}

.store-product-page .thumbnail-item img { object-fit: contain; }
.store-product-page .thumbnail-item:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.store-product-page .gallery-share-btn { opacity: 1; }
.store-product-page #prev-btn,
.store-product-page #next-btn {
    display: flex;
    width: 2.5rem;
    height: 2.5rem;
    opacity: 1 !important;
    background-color: var(--color-surface-primary);
    color: var(--color-text-primary);
    transform: translateY(-50%);
}

.store-product-page .product-actions-buttons {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
}

.store-product-page .product-actions-buttons > button {
    min-width: 0;
    min-height: 2.75rem;
    white-space: normal;
}

.store-product-view .breadcrumb-wrapper {
    padding-block: 0.625rem;
    padding-inline: 0;
}

.store-product-view .breadcrumb-section { max-width: 100rem; margin-inline: auto; }

@media (min-width: 768px) {
    .store-product-view {
        --store-gallery-height: clamp(12rem, min(42vw, calc(100svh - var(--store-product-header-height) - 5rem)), 28rem);
    }

    .store-product-page .product-detail-layout {
        grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
        grid-template-areas: "gallery heading" "gallery purchase" "details details";
        grid-template-rows: auto 1fr auto;
        column-gap: clamp(1.25rem, 2.5vw, 2.5rem) !important;
        row-gap: 0.875rem !important;
    }
}

@media (min-width: 900px) {
    .store-product-page .product-long-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .store-product-page .product-long-details > .space-y-6 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
}

@media (min-width: 1024px) {
    .store-live-search .store-products-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }

    /* Every view uses the same compact desktop header; extra controls get their own row. */
    .store-header .store-header-main {
        display: grid;
        grid-template-columns: minmax(10rem, 0.75fr) minmax(0, 2.5fr) auto;
        align-items: center;
        column-gap: clamp(0.75rem, 1.5vw, 1.5rem);
        row-gap: 0.5rem;
    }

    .store-header .store-header-row,
    .store-header .store-header-search { display: contents; }
    .store-header .store-header-row > :first-child { grid-column: 1; grid-row: 1; }
    .store-header .store-header-row > :last-child { grid-column: 3; grid-row: 1; }
    .store-header .store-header-search > * { grid-column: 1 / -1; }
    .store-header .store-header-search > .search-bar-container { grid-column: 2; grid-row: 1; }
    .store-header .store-header-search > :not([hidden]) ~ :not([hidden]) { margin-top: 0; }

    .store-shell .category-filters-aside {
        position: sticky;
        align-self: start;
        top: calc(var(--store-header-height, 7rem) + 1rem);
    }

    .store-shell .category-filters-aside .category-filter-panel#filters-sidebar {
        position: static;
        max-height: calc(100vh - var(--store-header-height, 7rem) - 2rem);
        max-height: calc(100dvh - var(--store-header-height, 7rem) - 2rem);
        overscroll-behavior-y: contain;
    }

    .store-product-page .product-actions-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .store-product-page .product-actions-buttons > :only-child { grid-column: 1 / -1; }
}

@media (min-width: 1100px) {
    .store-product-page .product-detail-layout { grid-template-columns: minmax(0, 34rem) minmax(0, 1fr); }
    .store-product-page .product-gallery:has(.product-gallery-thumbnails) {
        grid-template-columns: 4rem minmax(0, 1fr);
        column-gap: 0.75rem;
    }

    .store-product-page .product-gallery:has(.product-gallery-thumbnails) > .product-gallery-stage { grid-column: 2; grid-row: 1; }
    .store-product-page .product-gallery-thumbnails { grid-column: 1; grid-row: 1; }
    .store-product-page #thumbnails-container {
        flex-direction: column;
        max-height: var(--store-gallery-height);
        overflow-x: hidden;
        overflow-y: auto !important;
        scroll-snap-type: y proximity;
    }

    .store-product-page .product-gallery-thumbnails > .scroll-gradient-left,
    .store-product-page .product-gallery-thumbnails > .scroll-gradient-right { display: none; }
}

@media (min-width: 768px) and (max-height: 600px) {
    .store-product-view { --store-gallery-height: clamp(10rem, calc(100svh - var(--store-product-header-height) - 4rem), 24rem); }
}

.store-product-view.theme-dark .store-product-page .product-detail-layout {
    background: transparent !important;
    box-shadow: none !important;
}

/* Recommendations follow the content edges and use compact, uncropped cards. */
.store-content-shell .store-recommendations {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--color-outline, #e2e8f0);
}

.store-recommendations .related-section-title,
.store-recommendations .similar-section-title {
    font-size: 1.125rem !important;
    line-height: 1.4;
    margin: 0;
}

.store-content-shell .store-recommendations-grid.store-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.store-recommendations .related-product-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-radius: 0.875rem;
}

.store-recommendations .related-product-card:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
}

.store-recommendations .related-card-image {
    flex-shrink: 0;
    padding: 0.625rem;
    background: var(--color-surface-primary);
}

.store-recommendations .related-card-img { object-fit: contain; }
.store-recommendations .related-card-body { padding: 0.75rem; gap: 0.5rem; }
.store-recommendations .related-card-category {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-transform: none;
    letter-spacing: normal;
}

.store-recommendations .related-card-title { min-height: 2.7em; overflow-wrap: anywhere; }
.store-recommendations .related-card-price { margin-top: auto; flex-wrap: wrap; padding-top: 0.25rem; }
.store-recommendations .related-card-price-current { font-size: 1.125rem; }

@media (min-width: 640px) {
    .store-content-shell .store-recommendations-grid.store-products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 900px) {
    .store-content-shell .store-recommendations-grid.store-products-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .store-content-shell .store-recommendations-grid.store-products-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}
