/* Lightbox2 overlay for product code and name */
.lb-data .lb-caption {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-red);
    text-align: left;
    padding-left: 8px;
}
.lb-data .lb-number {
    font-size: 16px;
    color: #1f2937;
    font-weight: 600;
    text-align: right;
    padding-right: 8px;
}
.lb-data {
    background: #fff;
    border-radius: 0 0 10px 10px;
    padding: 8px 12px 6px 12px;
}
:root {
    --primary-red: #e63a3a;
    --text-dark: #1f2937;
    --bg-light: #f5f5f5;
}

.products-page {
    max-width: 1240px;
    margin: 0 auto;
    padding: 26px 0 42px;
}

.products-breadcrumb {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    width: fit-content;
    margin: 0 0 14px auto;
    padding: 6px 10px;
    border: 1px solid #ececec;
    border-radius: 999px;
    background: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    color: #6b7280;
}

.products-breadcrumb a {
    color: #6b7280;
    text-decoration: none;
}

.products-breadcrumb .crumb-sep {
    color: #b6b6b6;
}

.products-breadcrumb a:hover {
    color: var(--primary-red);
}

.products-breadcrumb #crumbItem {
    color: var(--text-dark);
    font-weight: 700;
}

.products-main-header {
    margin-bottom: 22px;
}

.products-main-header h3 {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.1;
}

.sub-category-section {
    position: relative;
    margin-bottom: 30px;
}

.sub-section-header {
    margin-bottom: 16px;
}

.sub-section-header h3 {
    font-size: 22px;
    font-weight: 700;
}

.sub-section-header a {
    color: var(--primary-red);
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
}

.sub-scroll-wrap {
    position: relative;
    padding: 0;
}

.sub-category-track {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding: 8px 2px 12px;
}

.sub-category-track::-webkit-scrollbar {
    display: none;
}

.sub-cat-card {
    flex: 0 0 clamp(240px, 28vw, 330px);
    max-width: 330px;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.12);
    border: 1px solid #e7e2d8;
    cursor: pointer;
    text-decoration: none;
    scroll-snap-align: start;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
}

.sub-cat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.sub-cat-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.sub-cat-title {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    text-align: center;
    color: #fff;
    padding: 18px 14px;
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.05));
}

.sub-cat-card.active {
    outline: 2px solid var(--primary-red);
}

.sub-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border: 1px solid #ececec;
    border-radius: 50%;
    background: #ffffff;
    color: #333;
    font-size: 20px;
    cursor: pointer;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.sub-arrow:hover {
    background: var(--primary-red);
    color: #fff;
}

.sub-arrow:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.sub-arrow.left {
    left: 10px;
}

.sub-arrow.right {
    right: 10px;
}

.product-track {
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    padding: 8px 2px 12px;
}

.product-track .product-card {
    flex: 0 0 clamp(240px, 70vw, 320px);
    min-width: clamp(240px, 70vw, 320px);
    scroll-snap-align: start;
}

.grid-section h3 {
    font-size: 22px;
    margin: 8px 0 22px;
    font-weight: 700;
    line-height: 1.15;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
    gap: 24px;
    padding-bottom: 32px;
}

.product-card {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e7e2d8;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.product-image-wrap {
    position: relative;
}

.product-image-wrap img {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    object-fit: cover;
    display: block;
}

.product-code {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--primary-red);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    padding: 8px 14px;
}

.product-name {
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    padding: 14px 12px 18px;
}

#productGrid .product-image-wrap a {
    display: block;
    cursor: zoom-in;
}

.custom-lightbox {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.custom-lightbox.is-open {
    display: flex;
}

.custom-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
}

.custom-lightbox-content {
    position: relative;
    z-index: 2;
    width: min(92vw, 920px);
}

.custom-lightbox-image-wrap {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
}

.custom-lightbox-image-wrap img {
    display: block;
    width: 100%;
    max-height: 74vh;
    object-fit: contain;
}

.custom-lightbox-code {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--primary-red);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 7px 12px;
    border-radius: 6px;
}

.custom-lightbox-name {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    padding-top: 12px;
}

.custom-lightbox-close,
.custom-lightbox-nav {
    position: absolute;
    z-index: 3;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #1f2937;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.custom-lightbox-close:hover,
.custom-lightbox-nav:hover {
    background: var(--primary-red);
    color: #fff;
}

.custom-lightbox-close {
    top: 24px;
    right: 24px;
}

.custom-lightbox-nav.prev {
    left: 24px;
}

.custom-lightbox-nav.next {
    right: 24px;
}

@media (max-width: 991px) {
    .products-main-header h3,
    .sub-section-header h3,
    .grid-section h3 {
        font-size: 22px;
    }

    .sub-scroll-wrap {
        padding: 0;
    }

    .sub-cat-card {
        flex: 0 0 clamp(230px, 44vw, 300px);
        max-width: 300px;
    }

    .product-image-wrap img {
        height: 230px;
    }
}

@media (max-width: 767px) {
    .products-breadcrumb {
        justify-content: flex-start;
        margin: 0 0 12px;
        font-size: 11px;
        padding: 5px 8px;
    }

    .sub-scroll-wrap {
        padding: 0;
    }

    .sub-arrow {
        width: 38px;
        height: 38px;
        font-size: 14px;
        top: 42%;
    }

    .sub-arrow.left {
        left: 6px;
    }

    .sub-arrow.right {
        right: 6px;
    }

    .sub-cat-card {
        flex: 0 0 calc(100% - 34px);
        max-width: calc(100% - 34px);
    }

    .product-track {
        gap: 14px;
        padding: 8px 0 10px;
    }

    .product-track .product-card {
        flex: 0 0 84vw;
        min-width: 84vw;
        max-width: 84vw;
        height: 190px;
    }

    .product-slider-section .nav-arrow {
        display: none;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .grid-section h3 {
        font-size: 20px;
    }

    .sub-section-header h3 {
        font-size: 20px;
    }

    .sub-section-header a {
        font-size: 14px;
    }

    .sub-cat-card img {
        height: 200px;
    }

    .sub-cat-title {
        font-size: 16px;
        padding: 14px 10px;
    }

    .product-code {
        font-size: 14px;
        padding: 6px 12px;
    }

    .product-name {
        font-size: 16px;
    }

    .custom-lightbox-content {
        width: min(94vw, 840px);
    }

    .custom-lightbox-nav.prev {
        left: 12px;
    }

    .custom-lightbox-nav.next {
        right: 12px;
    }

}

@media (max-width: 575px) {
    .custom-lightbox-code {
        font-size: 12px;
        padding: 6px 10px;
    }

    .custom-lightbox-name {
        font-size: 16px;
    }

    .custom-lightbox-close {
        top: 12px;
        right: 12px;
    }

    .custom-lightbox-nav {
        width: 34px;
        height: 34px;
    }

    .custom-lightbox-nav.prev {
        left: 8px;
    }

    .custom-lightbox-nav.next {
        right: 8px;
    }
}
