body {
    background: #f3f6f9;
    color: #495057;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
}

.public-wrapper {
    width: 100%;
    min-height: 100vh;
    padding: 0;
}

.public-header {
    background: #405189;
    padding: 24px 32px;
}

.public-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.public-title h1 {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
}

.public-title p {
    margin: 8px 0 0;
    color: #ffffff;
    font-size: 15px;
}

.range-count-card {
    min-width: 170px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    padding: 16px 20px;
    text-align: center;
}

.range-count-card .count-number {
    display: block;
    font-size: 32px;
    line-height: 1;
    font-weight: 700;
    color: #ffffff;
}

.range-count-card .count-label {
    display: block;
    margin-top: 5px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.public-content {
    padding: 24px 32px 40px;
}

.toolbar-card {
    margin-bottom: 24px;
}

.card {
    border: 0;
    box-shadow: 0 1px 2px rgba(56, 65, 74, .15);
}

.card-title {
    color: #495057;
    font-weight: 600;
}

.text-muted {
    color: #878a99 !important;
}

.search-input {
    height: 44px;
    border-radius: 6px;
}

.search-input:focus {
    border-color: #405189;
    box-shadow: 0 0 0 .15rem rgba(64, 81, 137, .18);
}

/* ---------- Range Listing Cards ---------- */

.range-card {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
    background: #ffffff;
    border: 1px solid #e9ebec;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(56, 65, 74, .15);
    transition: all .18s ease;
    -webkit-tap-highlight-color: transparent;
}

.range-card:hover,
.range-card:focus {
    color: inherit;
    text-decoration: none;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(56, 65, 74, .18);
    border-color: #cfd4da;
}

.range-image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #eef1f5;
    overflow: hidden;
}

.range-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .25s ease;
}

.range-card:hover .range-image,
.range-card:focus .range-image {
    transform: scale(1.04);
}

.range-card-body {
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.range-name {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #495057;
    line-height: 1.25;
}

.range-badge {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(64, 81, 137, .1);
    color: #405189;
    font-size: 18px;
    transition: all .18s ease;
}

.range-card:hover .range-badge,
.range-card:focus .range-badge {
    background: #405189;
    color: #ffffff;
}

.empty-state,
.no-results {
    background: #ffffff;
    border: 1px solid #e9ebec;
    border-radius: 8px;
    padding: 32px;
    text-align: center;
    color: #878a99;
}

.no-results {
    display: none;
    margin-top: 20px;
}

/* ---------- Public Range Detail Page ---------- */

.public-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
}

.public-back-link:hover,
.public-back-link:focus {
    color: #ffffff;
    text-decoration: none;
}

.public-table {
    font-size: 15px;
}

.public-table thead th {
    background: #f3f6f9;
    color: #495057;
    font-weight: 600;
    border-bottom: 1px solid #e9ebec;
    white-space: nowrap;
    padding: 14px 16px;
}

.public-table tbody td {
    padding: 14px 16px;
    color: #495057;
    vertical-align: middle;
}

.sku-badge {
    display: inline-flex;
    align-items: center;
    background: #f3f6f9;
    color: #405189;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.anti-slip-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(10, 179, 156, .12);
    color: #0ab39c;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

/* ---------- Old Image Card Styling ---------- */
/* Kept here in case you still use the older image grid anywhere */

.image-card {
    height: 100%;
    background: #ffffff;
    border: 1px solid #e9ebec;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(56, 65, 74, .15);
}

.image-card-wrap {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #eef1f5;
    overflow: hidden;
}

.image-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-card-body {
    padding: 12px 14px;
}

.image-card-body strong {
    display: block;
    color: #495057;
    font-size: 13px;
    line-height: 1.3;
    word-break: break-word;
}

.image-card-body span {
    display: block;
    margin-top: 4px;
    color: #878a99;
    font-size: 12px;
}

/* ---------- Stock Display ---------- */

.stock-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 120px;
}

.stock-stack strong {
    color: #495057;
    font-size: 14px;
    line-height: 1.25;
}

.stock-stack span {
    color: #878a99;
    font-size: 13px;
    line-height: 1.25;
}

/* Make the combined card header feel like Tools */

.card-body.border-bottom {
    border-bottom-color: #e9ebec !important;
}

/* Help wide product tables on touchscreen */

.public-table th,
.public-table td {
    white-space: nowrap;
}

.public-table td:nth-child(1),
.public-table td:nth-child(4),
.public-table td:nth-child(5) {
    white-space: normal;
    min-width: 220px;
}

.public-table td:nth-child(9) {
    white-space: nowrap;
}

/* ---------- Range Image Gallery ---------- */

.range-gallery-card {
    overflow: hidden;
}

.image-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(64, 81, 137, .1);
    color: #405189;
    border-radius: 999px;
    padding: 7px 13px;
    font-size: 13px;
    font-weight: 600;
}

.range-image-viewer {
    width: 100%;
}

.range-main-slider {
    width: 100%;
    background: #f3f6f9;
    border-radius: 8px;
    overflow: hidden;
}

.range-main-slider .swiper-slide {
    width: 100%;
    height: auto;
}

.range-main-image-button {
    position: relative;
    width: 100%;
    min-height: 520px;
    border: 0;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f6f9;
    cursor: pointer;
    text-align: left;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.range-main-image {
    width: 100%;
    height: 620px;
    object-fit: contain;
    display: block;
    background: #f3f6f9;
}

.range-main-image-expand {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(17, 24, 39, .72);
    color: #ffffff;
    border-radius: 999px;
    padding: 8px 13px;
    font-size: 13px;
    font-weight: 600;
    pointer-events: none;
}

.range-main-image-caption {
    position: absolute;
    left: 16px;
    bottom: 16px;
    z-index: 5;
    max-width: calc(100% - 32px);
    background: rgba(17, 24, 39, .72);
    color: #ffffff;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    line-height: 1.25;
    word-break: break-word;
    pointer-events: none;
}

.range-main-image-caption small {
    display: block;
    margin-top: 3px;
    color: rgba(255, 255, 255, .72);
}

/* ---------- Swiper Gallery Arrows ---------- */

.range-main-slider .swiper-button-next,
.range-main-slider .swiper-button-prev {
    width: 46px;
    height: 46px;
    margin-top: -23px;
    border-radius: 50%;
    background: #ffffff;
    color: #405189;
    box-shadow: 0 4px 14px rgba(56, 65, 74, .25);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: .95;
    transition: all .18s ease;
    border: 0 !important;
    outline: none !important;
}

.range-main-slider .swiper-button-next:hover,
.range-main-slider .swiper-button-prev:hover {
    background: #405189;
    color: #ffffff;
    transform: scale(1.06);
}

.range-main-slider .swiper-button-next::after,
.range-main-slider .swiper-button-prev::after {
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}

.range-main-slider .swiper-button-next {
    right: 18px;
}

.range-main-slider .swiper-button-prev {
    left: 18px;
}

.range-main-slider .swiper-button-disabled {
    opacity: .35;
}

.range-gallery-next,
.range-gallery-prev {
    border: 0 !important;
    outline: none !important;
}

/* ---------- Gallery Thumbnails ---------- */

.range-thumb-slider {
    width: 100%;
    padding-bottom: 2px;
}

.range-thumb-slider .swiper-slide {
    height: auto;
    opacity: .55;
    cursor: pointer;
}

.range-thumb-slider .swiper-slide-thumb-active {
    opacity: 1;
}

.range-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f3f6f9;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    transition: all .18s ease;
}

.range-thumb-slider .swiper-slide-thumb-active .range-thumb {
    border-color: #405189;
    box-shadow: 0 0 0 3px rgba(64, 81, 137, .12);
}

.range-thumb-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ---------- Simple Image Lightbox ---------- */

body.lightbox-open {
    overflow: hidden;
}

.image-lightbox-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(17, 24, 39, .92);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 28px;
}

.image-lightbox-modal.is-open {
    display: flex;
}

.image-lightbox-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-lightbox-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: #ffffff;
    border-radius: 8px;
}

.image-lightbox-close {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 10000;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 50%;
    background: #ffffff;
    color: #405189;
    font-size: 30px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}

/* ---------- Responsive ---------- */

@media (min-width: 1600px) {
    .col-xxxl-2 {
        flex: 0 0 auto;
        width: 16.66666667%;
    }
}

@media (max-width: 991px) {
    .public-header,
    .public-content {
        padding-left: 18px;
        padding-right: 18px;
    }

    .public-header-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .range-count-card {
        text-align: left;
    }
}

@media (max-width: 767px) {
    .range-main-image-button {
        min-height: 320px;
    }

    .range-main-image {
        height: 360px;
    }

    .range-main-image-expand {
        top: 10px;
        right: 10px;
    }

    .range-main-image-caption {
        left: 10px;
        bottom: 10px;
        max-width: calc(100% - 20px);
    }

    .range-main-slider .swiper-button-next,
    .range-main-slider .swiper-button-prev {
        width: 40px;
        height: 40px;
        margin-top: -20px;
    }

    .range-main-slider .swiper-button-next::after,
    .range-main-slider .swiper-button-prev::after {
        font-size: 15px;
    }

    .range-main-slider .swiper-button-next {
        right: 10px;
    }

    .range-main-slider .swiper-button-prev {
        left: 10px;
    }
}

@media (max-width: 575px) {
    .public-title h1 {
        font-size: 26px;
    }

    .range-name {
        font-size: 17px;
    }
}