:root {
    --product-red: #d9231c;
    --product-red-dark: #a91510;
    --product-ink: #171a20;
    --product-muted: #626a78;
    --product-line: #e1e5eb;
    --product-soft: #f7f8fa;
    --product-white: #ffffff;
}

.codex-product-page {
    min-height: 70vh;
    padding: 18px 0 70px;
    background:
        linear-gradient(
            90deg,
            #111 0,
            var(--product-red) 32%,
            #ea4d52 100%
        )
        top / 100% 3px no-repeat,
        #ffffff;
}

.codex-product-page__container {
    width: min(1500px, calc(100% - 40px));
    margin: 0 auto;
}

.product-state {
    max-width: 760px;
    margin: 70px auto;
    padding: 55px 30px;
    border: 1px solid var(--product-line);
    border-radius: 18px;
    text-align: center;
}

.product-state__label {
    color: var(--product-red);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.product-state h1 {
    margin: 12px 0;
}

.product-state a {
    display: inline-flex;
    margin-top: 16px;
    color: var(--product-red);
    font-weight: 800;
    text-decoration: none;
}

.product-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 14px 0 26px;
    color: #53606f;
    font-size: 0.9rem;
}

.product-breadcrumbs a,
.product-breadcrumbs strong {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 6px;
    background: #f5f5f5;
    color: inherit;
    text-decoration: none;
}

.product-breadcrumbs a:hover {
    color: var(--product-red);
}

.product-breadcrumbs strong {
    color: var(--product-ink);
    font-weight: 700;
}

.product-breadcrumbs__separator {
    color: #262d37;
    font-size: 0.7rem;
}

.single-product {
    display: grid;
    grid-template-columns:
        minmax(0, 1.08fr)
        minmax(360px, 0.92fr)
        300px;
    gap: 34px;
    align-items: start;
}

.product-gallery {
    min-width: 0;
}

.product-gallery__stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    padding: 16px;
    overflow: hidden;
    background: #fff;
}

.product-gallery__main-image {
    width: 100%;
    max-width: 620px;
    height: 500px;
    object-fit: contain;
    display: block;
}

.product-gallery__empty {
    display: grid;
    place-items: center;
    gap: 10px;
    min-height: 440px;
    color: #8a9099;
}

.product-gallery__empty i {
    font-size: 2rem;
}

.product-gallery__arrow {
    position: absolute;
    top: 50%;
    display: grid;
    place-items: center;
    width: 43px;
    height: 43px;
    border: 0;
    border-radius: 50%;
    background: var(--product-red);
    color: #fff;
    cursor: pointer;
    transform: translateY(-50%);
    box-shadow: 0 9px 24px rgba(217, 35, 28, 0.22);
    z-index: 2;
}

.product-gallery__arrow:hover {
    background: var(--product-red-dark);
}

.product-gallery__arrow--previous {
    left: 0;
}

.product-gallery__arrow--next {
    right: 0;
}

.product-gallery__colour-picker {
    margin-top: 24px;
}

.product-gallery__colour-picker p {
    margin: 0 0 12px;
    color: #353c47;
    font-size: 0.9rem;
}

.product-gallery__colour-picker strong {
    color: var(--product-red);
}

.product-gallery__swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.product-gallery__swatch {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--swatch, #fff);
    cursor: pointer;
    box-shadow: 0 0 0 1px #ccd2da;
}

.product-gallery__swatch.is-active {
    box-shadow:
        0 0 0 2px #fff,
        0 0 0 4px var(--product-red);
}

.product-gallery__thumbnails {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 94px;
    gap: 12px;
    margin-top: 18px;
    padding: 16px;
    overflow-x: auto;
    border: 1px solid var(--product-line);
    border-radius: 8px;
    background: #fff;
    scrollbar-width: thin;
}

.product-gallery__thumbnail {
    display: grid;
    place-items: center;
    width: 94px;
    height: 82px;
    padding: 7px;
    border: 1px solid var(--product-line);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
}

.product-gallery__thumbnail:hover,
.product-gallery__thumbnail.is-active {
    border-color: var(--product-red);
}

.product-gallery__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-information {
    padding-top: 8px;
}

.product-information__code {
    margin: 0 0 6px;
    color: #27303c;
    font-size: 0.85rem;
}

.product-information__code span {
    color: var(--product-red);
    font-weight: 800;
    text-transform: uppercase;
}

.product-information h1 {
    margin: 0 0 18px;
    color: var(--product-ink);
    font-size: clamp(1.65rem, 2.3vw, 2.25rem);
    font-weight: 500;
    line-height: 1.18;
}

.product-information__description {
    color: #2f3743;
    font-size: 0.95rem;
    line-height: 1.52;
}

.product-information__description ul,
.product-information__description ol {
    margin: 0 0 20px;
    padding-left: 22px;
}



.product-information__description p {
    margin: 0 0 14px;
}

.product-information__description strong {
    color: var(--product-red);
}

.product-information__branding {
    margin-top: 32px;
}

.product-information__branding h2 {
    margin: 0 0 10px;
    color: var(--product-red);
    font-size: 1.05rem;
}

.product-information__branding ul {
    margin: 0;
    padding-left: 22px;
    line-height: 1.65;
}

.product-availability {
    padding: 28px 26px;
    border: 1px solid #d7dbe1;
    border-radius: 16px;
    background: #fff;
}

.product-availability__badge {
    display: inline-flex;
    margin-bottom: 18px;
    padding: 7px 13px;
    border: 1px solid #ffb9b5;
    border-radius: 5px;
    color: var(--product-red);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.product-availability__status {
    margin: 0;
    color: #68707c;
    font-size: 0.9rem;
}

.product-availability__status strong {
    color: #2da84e;
}

.product-availability__divider {
    height: 1px;
    margin: 15px 0 22px;
    background: #dfe3e8;
}

.product-availability__brand {
    display: grid;
    place-items: center;
    min-height: 72px;
    margin-bottom: 18px;
}

.product-availability__brand img {
    max-width: 170px;
    max-height: 58px;
    object-fit: contain;
}

.product-availability__brand-name {
    margin-bottom: 20px;
    color: var(--product-ink);
    font-size: 1.25rem;
    font-weight: 800;
    text-align: center;
}

.product-availability__numbers {
    display: grid;
    gap: 10px;
    margin: 0 0 18px;
}

.product-availability__numbers div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid #eef0f3;
}

.product-availability__numbers dt {
    color: #69717d;
    font-size: 0.78rem;
    text-transform: uppercase;
}

.product-availability__numbers dd {
    margin: 0;
    color: var(--product-ink);
    font-weight: 800;
}

.product-availability__button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 46px;
    margin-top: 10px;
    padding: 11px 14px;
    border: 1px solid var(--product-red);
    border-radius: 5px;
    background: var(--product-red);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}

.product-availability__button:hover {
    background: var(--product-red-dark);
    border-color: var(--product-red-dark);
}

.product-availability__button--outline {
    background: #fff;
    color: var(--product-red);
}

.product-availability__button--outline:hover {
    color: #fff;
}

.product-detail-tabs {
    margin-top: 70px;
}

.product-detail-tabs__navigation {
    display: flex;
    justify-content: center;
    gap: 16px;
    border-bottom: 1px solid var(--product-line);
}

.product-detail-tabs__button {
    position: relative;
    padding: 13px 12px;
    border: 0;
    background: transparent;
    color: #252d38;
    font-size: 0.95rem;
    cursor: pointer;
}

.product-detail-tabs__button::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 3px;
    background: transparent;
}

.product-detail-tabs__button.is-active {
    font-weight: 700;
}

.product-detail-tabs__button.is-active::after {
    background: var(--product-red);
}

.product-detail-tabs__panel {
    display: none;
    padding-top: 20px;
}

.product-detail-tabs__panel.is-active {
    display: block;
}

.product-specification-table,
.product-variant-stock__table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.product-specification-table th,
.product-variant-stock__table th {
    padding: 13px 16px;
    background: var(--product-red);
    color: #fff;
    font-size: 0.76rem;
    text-align: left;
    text-transform: uppercase;
}

.product-specification-table td,
.product-variant-stock__table td {
    padding: 13px 16px;
    border-bottom: 1px solid #e7eaf0;
    color: #323a46;
    font-size: 0.86rem;
}

.product-specification-table tbody tr:nth-child(even),
.product-variant-stock__table tbody tr:nth-child(even) {
    background: #f7f8fa;
}

.product-branding-guide {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    padding: 26px;
    border: 1px solid var(--product-line);
}

.product-branding-guide h2 {
    margin: 0 0 6px;
}

.product-branding-guide p {
    margin: 0;
    color: var(--product-muted);
}

.product-branding-guide a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    background: var(--product-red);
    color: #fff;
    font-weight: 800;
    text-decoration: none;
}

.product-variant-stock {
    margin-top: 50px;
    padding-top: 28px;
    border-top: 1px solid var(--product-line);
}

.product-variant-stock__header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.product-variant-stock__header span {
    color: var(--product-red);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.product-variant-stock__header h2 {
    margin: 4px 0 0;
    font-size: 1.55rem;
}

.product-variant-stock__header p {
    margin: 0;
    color: var(--product-muted);
    font-size: 0.8rem;
}

.product-variant-stock__table-wrap {
    overflow-x: auto;
}

@media (max-width: 1180px) {
    .single-product {
        grid-template-columns: minmax(0, 1fr) minmax(330px, 0.9fr);
    }

    .product-availability {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px 25px;
        align-items: center;
    }

    .product-availability__brand,
    .product-availability__brand-name,
    .product-availability__divider,
    .product-availability__numbers {
        margin-bottom: 0;
    }
}

@media (max-width: 820px) {
    .codex-product-page__container {
        width: min(100% - 24px, 1500px);
    }

    .single-product {
        grid-template-columns: 1fr;
        gap: 26px;
    }

    .product-gallery__stage {
        min-height: 360px;
    }

    .product-gallery__main-image {
        height: 350px;
    }

    .product-availability {
        display: block;
    }

    .product-detail-tabs {
        margin-top: 45px;
    }

    .product-detail-tabs__navigation {
        justify-content: flex-start;
        overflow-x: auto;
    }

    .product-detail-tabs__button {
        white-space: nowrap;
    }

    .product-branding-guide,
    .product-variant-stock__header {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 520px) {
    .product-breadcrumbs {
        gap: 7px;
    }

    .product-breadcrumbs a,
    .product-breadcrumbs strong {
        min-height: 31px;
        padding: 0 9px;
        font-size: 0.8rem;
    }

    .product-gallery__stage {
        min-height: 300px;
        padding: 4px;
    }

    .product-gallery__main-image {
        height: 290px;
    }

    .product-gallery__arrow {
        width: 38px;
        height: 38px;
    }
}
.product-gallery__full-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 50px;
    margin-top: 16px;
    padding: 12px 18px;
    border: 1px solid var(--product-red);
    border-radius: 6px;
    background: var(--product-red);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

.product-gallery__full-button:hover {
    border-color: var(--product-red-dark);
    background: var(--product-red-dark);
}

body.product-gallery-modal-open {
    overflow: hidden;
}

.product-gallery-modal[hidden] {
    display: none !important;
}

.product-gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: grid;
    place-items: center;
    padding: 18px;
}

.product-gallery-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 18, 23, 0.78);
    backdrop-filter: blur(3px);
}

.product-gallery-modal__dialog {
    position: relative;
    width: min(1780px, 100%);
    max-height: calc(100vh - 36px);
    overflow: hidden;
    border: 1px solid #ccd2d9;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
}

.product-gallery-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 74px;
    padding: 16px 26px;
    border-bottom: 1px solid #dfe3e8;
}

.product-gallery-modal__header h2 {
    margin: 0;
    color: var(--product-red);
    font-size: 1.35rem;
    font-weight: 500;
}

.product-gallery-modal__close {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #7d838b;
    font-size: 1.25rem;
    cursor: pointer;
}

.product-gallery-modal__close:hover {
    background: #f3f4f6;
    color: var(--product-red);
}

.product-gallery-modal__layout {
    display: grid;
    grid-template-columns: 300px minmax(430px, 1fr) minmax(430px, 0.95fr);
    min-height: 650px;
    max-height: calc(100vh - 110px);
    overflow: auto;
}

.product-gallery-modal__filters {
    padding: 28px 24px;
    border-right: 1px solid #e2e5e9;
}

.product-gallery-modal__filters h3 {
    margin: 0 0 12px;
    color: var(--product-red);
    font-size: 1.15rem;
}

.product-gallery-modal__filters p {
    margin: 0 0 24px;
    color: #4f5866;
    font-size: 0.92rem;
    line-height: 1.65;
}

.product-gallery-modal__colour-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.product-gallery-modal__colour,
.product-gallery-modal__select-all {
    min-width: 0;
    min-height: 112px;
    padding: 8px;
    border: 2px solid #dce1e7;
    border-radius: 8px;
    background: #fff;
    color: #313844;
    cursor: pointer;
}

.product-gallery-modal__colour {
    display: grid;
    grid-template-rows: 74px auto;
    gap: 7px;
    font-size: 0.75rem;
}

.product-gallery-modal__colour.is-selected,
.product-gallery-modal__select-all.is-selected {
    border-color: var(--product-red);
}

.product-gallery-modal__colour-image {
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 5px;
    background: var(--swatch, #fff);
}

.product-gallery-modal__colour-image img {
    width: 100%;
    height: 74px;
    object-fit: contain;
    background: #fff;
}

.product-gallery-modal__select-all {
    display: grid;
    place-items: center;
    background: var(--product-red);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 800;
}

.product-gallery-modal__select-all:not(.is-selected) {
    background: #fff;
    color: var(--product-red);
}

.product-gallery-modal__image-grid {
    align-content: start;
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 14px;
    padding: 28px 22px;
    overflow-y: auto;
    border-right: 1px solid #e2e5e9;
    background: #fbfbfc;
}

.product-gallery-modal__tile {
    display: grid;
    place-items: center;
    min-height: 150px;
    padding: 10px;
    border: 1px solid #dfe3e8;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.product-gallery-modal__tile:hover,
.product-gallery-modal__tile.is-active {
    border: 2px solid var(--product-red);
}

.product-gallery-modal__tile[hidden] {
    display: none !important;
}

.product-gallery-modal__tile img {
    width: 100%;
    height: 145px;
    object-fit: contain;
}

.product-gallery-modal__preview-column {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 26px;
}

.product-gallery-modal__preview {
    position: relative;
    display: grid;
    place-items: center;
    flex: 1;
    min-height: 500px;
    overflow: auto;
    background: #fff;
}

.product-gallery-modal__preview img {
    width: 100%;
    max-width: 640px;
    max-height: 560px;
    object-fit: contain;
    transition: transform 0.24s ease;
    transform-origin: center;
}

.product-gallery-modal__preview.is-zoomed img {
    cursor: zoom-out;
    transform: scale(1.7);
}

.product-gallery-modal__preview-arrow {
    position: absolute;
    top: 50%;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: var(--product-red);
    color: #fff;
    cursor: pointer;
    transform: translateY(-50%);
}

.product-gallery-modal__preview-arrow--previous {
    left: 6px;
}

.product-gallery-modal__preview-arrow--next {
    right: 6px;
}

.product-gallery-modal__actions {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 18px;
}

.product-gallery-modal__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-width: 150px;
    min-height: 48px;
    padding: 11px 18px;
    border: 1px solid var(--product-red);
    border-radius: 7px;
    background: var(--product-red);
    color: #fff;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.product-gallery-modal__action:hover {
    border-color: var(--product-red-dark);
    background: var(--product-red-dark);
}

.product-gallery-modal__action--outline {
    background: #fff;
    color: var(--product-red);
}

.product-gallery-modal__action--outline:hover {
    color: #fff;
}

@media (max-width: 1250px) {
    .product-gallery-modal__layout {
        grid-template-columns: 250px minmax(360px, 1fr);
    }

    .product-gallery-modal__preview-column {
        grid-column: 1 / -1;
        border-top: 1px solid #e2e5e9;
    }

    .product-gallery-modal__preview {
        min-height: 420px;
    }
}

@media (max-width: 760px) {
    .product-gallery-modal {
        padding: 8px;
    }

    .product-gallery-modal__dialog {
        max-height: calc(100vh - 16px);
    }

    .product-gallery-modal__layout {
        display: block;
        max-height: calc(100vh - 82px);
        overflow-y: auto;
    }

    .product-gallery-modal__filters,
    .product-gallery-modal__image-grid {
        border-right: 0;
        border-bottom: 1px solid #e2e5e9;
    }

    .product-gallery-modal__image-grid {
        grid-template-columns: repeat(2, minmax(110px, 1fr));
        max-height: none;
    }

    .product-gallery-modal__preview {
        min-height: 340px;
    }

    .product-gallery-modal__preview img {
        max-height: 330px;
    }

    .product-gallery-modal__actions {
        flex-direction: column;
    }

    .product-gallery-modal__action {
        width: 100%;
    }
}


.product-information__price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 7px 10px;
    margin: -6px 0 22px;
}

.product-information__price span,
.product-information__price small {
    color: var(--product-muted);
    font-size: 0.78rem;
}

.product-information__price strong {
    color: var(--product-red);
    font-size: 1.55rem;
    font-weight: 900;
}

.variant-public-price {
    display: block;
    color: var(--product-red);
    font-size: 0.92rem;
}

.product-variant-stock__table td small {
    display: block;
    margin-top: 2px;
    color: var(--product-muted);
    font-size: 0.68rem;
}
