/* Shop page only */
.rt-shop {
    background: #f8f6f2;
    color: #181818;
    font-family: "Inter", sans-serif;
}

.rt-shop,
.rt-shop * {
    box-sizing: border-box;
}

.rt-shop button,
.rt-shop input {
    font: inherit;
}

.rt-shop button {
    cursor: pointer;
}

.rt-shop button:disabled {
    opacity: 1;
    cursor: default;
}

.rt-shop a {
    color: inherit;
    text-decoration: none;
}

.rt-shop [hidden] {
    display: none;
}

.rt-shop :where(button, a, input, summary):focus-visible,
.rt-shop-grid__item:focus-visible {
    outline: 2px solid #8a6735;
    outline-offset: 3px;
}

.rt-shop-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.rt-shop__container {
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: 16px;
}

/* Banner */
.rt-shop-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: #e9e2d8;
}

.rt-shop-hero__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 72% center;
    z-index: -2;
}

.rt-shop-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(
        90deg,
        rgb(241 235 225 / 96%) 0%,
        rgb(241 235 225 / 74%) 38%,
        rgb(241 235 225 / 0%) 72%
    );
}

.rt-shop-hero__inner {
    display: flex;
    align-items: center;
    min-height: 200px;
    padding-block: 24px;
}

.rt-shop-hero__content {
    width: 52%;
    max-width: 360px;
}

.rt-shop-hero h1 {
    margin: 0 0 8px;
    color: #111111;
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(36px, 9vw, 56px);
    font-weight: 400;
    line-height: 1.02;
    letter-spacing: -0.03em;
}

.rt-shop-hero p {
    max-width: 18ch;
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
}

/* Category shortcuts */
.rt-shop-categories {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-block: 12px 16px;
}

.rt-shop-category {
    display: block;
    min-width: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: 10px;
    background: #f1ede6;
    color: #181818;
    text-align: left;
}

.rt-shop-category[aria-pressed="true"] {
    border-color: #c9a46a;
}

.rt-shop-category__media {
    display: block;
    aspect-ratio: 6 / 5;
    overflow: hidden;
    background: #eeece8;
}

.rt-shop-category__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rt-shop-category__label {
    display: block;
    padding: 8px;
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(14px, 3.8vw, 18px);
    line-height: 1.15;
}

.rt-shop-category__label span {
    margin-left: 3px;
}

/* Category tabs */
.rt-shop-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-bottom: 1px solid #e7e1d8;
}

.rt-shop-tabs__button {
    position: relative;
    min-width: 0;
    min-height: 48px;
    padding: 12px 4px;
    border: 0;
    background: transparent;
    color: #181818;
    font-size: 13px;
}

.rt-shop-tabs__button[aria-pressed="true"] {
    color: #8a6735;
}

.rt-shop-tabs__button[aria-pressed="true"]::after {
    content: "";
    position: absolute;
    right: 12px;
    bottom: -1px;
    left: 12px;
    height: 2px;
    border-radius: 2px;
    background: #b58749;
}

/* Product toolbar */
.rt-shop-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-block: 16px 12px;
}

.rt-shop-toolbar__count {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
}

.rt-shop-toolbar__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rt-shop-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid #e7e1d8;
    border-radius: 8px;
    background: #f8f6f2;
    color: #181818;
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
}

.rt-shop-control__count {
    display: grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    padding-inline: 4px;
    border-radius: 50%;
    background: #c9a46a;
    color: #111111;
    font-size: 11px;
}

/* Sort disclosure */
.rt-shop-sort {
    position: relative;
}

.rt-shop-sort summary {
    list-style: none;
}

.rt-shop-sort summary::-webkit-details-marker {
    display: none;
}

.rt-shop-sort[open] summary {
    border-color: #b58749;
}

.rt-shop-sort__options {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 20;
    width: min(232px, 75vw);
    min-width: 0;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid #e7e1d8;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgb(17 17 17 / 10%);
}

.rt-shop-sort__option {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    padding-block: 10px;
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
}

.rt-shop-sort__option + .rt-shop-sort__option {
    border-top: 1px solid #f1ede6;
}

.rt-shop-sort__check {
    display: grid;
    flex: 0 0 18px;
    place-items: center;
    height: 18px;
    border-radius: 50%;
    background: #c9a46a;
    color: #111111;
    font-size: 12px;
    visibility: hidden;
}

.rt-shop-sort__option input:checked ~ .rt-shop-sort__check {
    visibility: visible;
}

.rt-shop-sort__option input:focus-visible + span {
    outline: 2px solid #8a6735;
    outline-offset: 4px;
}

/* Two-column mobile product grid */
.rt-shop-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.rt-shop-grid__item {
    min-width: 0;
    border-radius: 10px;
}

.rt-shop-product {
    position: relative;
    height: 100%;
    overflow: hidden;
    border: 1px solid #e7e1d8;
    border-radius: 10px;
    background: #ffffff;
}

.rt-shop-product__link {
    display: block;
    height: 100%;
}

.rt-shop-product__link:focus-visible {
    outline-offset: -3px;
}

.rt-shop-product__media {
    position: relative;
    aspect-ratio: 11 / 10;
    background: #f1efeb;
}

.rt-shop-product__media img {
    display: block;
    width: 100%;
    height: 100%;
    padding: 10px;
    object-fit: contain;
}

.rt-shop-product__badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 8px;
    border-radius: 6px;
    background: #c9a46a;
    color: #111111;
    font-size: 11px;
    line-height: 1.4;
}

.rt-shop-product__wishlist {
    position: absolute;
    top: 0;
    right: 0;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #181818;
}

.rt-shop-product__body {
    padding: 8px 10px 10px;
}

.rt-shop-product h2 {
    margin: 0 0 4px;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.rt-shop-product__price {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.rt-shop-product__rating {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #6c6862;
    font-size: 12px;
    line-height: 1.5;
}

.rt-shop-product__star {
    color: #d39a27;
    font-size: 16px;
}

/* Load more and empty results */
.rt-shop-pagination {
    display: flex;
    justify-content: center;
    padding-block: 16px 32px;
}

.rt-shop-gold-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 12px 16px;
    border: 1px solid #b58749;
    border-radius: 8px;
    background: #c9a46a;
    color: #111111;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
}

.rt-shop-pagination .rt-shop-gold-button {
    width: 100%;
    max-width: 360px;
}

.rt-shop-empty {
    padding: 32px 16px;
    text-align: center;
}

.rt-shop-empty p {
    margin: 0 0 12px;
    color: #6c6862;
}

.rt-shop-empty button {
    min-height: 44px;
    padding: 8px 16px;
    border: 1px solid #e7e1d8;
    border-radius: 8px;
    background: #ffffff;
    color: #181818;
}

/* Background scroll lock */
html.rt-shop-filter-open {
    overflow: hidden;
}

html.rt-shop-filter-open body {
    position: fixed;
    top: var(--rt-shop-scroll-y, 0px);
    right: 0;
    left: 0;
    overflow: hidden;
}

/* Right-side filter drawer */
.rt-shop-filter {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: transparent;
    color: #181818;
}

.rt-shop-filter[open] {
    display: block;
}

.rt-shop-filter::backdrop {
    background: rgb(17 17 17 / 0%);
    transition: background-color 300ms ease;
}

.rt-shop-filter.is-open::backdrop {
    background: rgb(17 17 17 / 45%);
}

.rt-shop-filter__panel {
    display: flex;
    flex-direction: column;
    width: 90%;
    max-width: 400px;
    height: 100%;
    margin-left: auto;
    overflow: hidden;
    background: #f8f6f2;
    transform: translateX(100%);
    transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.rt-shop-filter.is-open .rt-shop-filter__panel {
    transform: translateX(0);
}

.rt-shop-filter__header {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 24px;
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
    border-bottom: 1px solid #e7e1d8;
}

.rt-shop-filter__header h2 {
    margin: 0;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 24px;
    font-weight: 400;
}

.rt-shop-filter__close {
    display: grid;
    flex: 0 0 44px;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #181818;
}

.rt-shop-filter__form {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    margin: 0;
}

.rt-shop-filter__body {
    flex: 1;
    min-height: 0;
    padding: 24px;
    overflow-y: auto;
    overscroll-behavior-y: contain;
}

.rt-shop-filter__section {
    min-width: 0;
    margin: 0 0 24px;
    padding: 0 0 24px;
    border: 0;
    border-bottom: 1px solid #e7e1d8;
}

.rt-shop-filter__section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

.rt-shop-filter__section legend {
    margin-bottom: 12px;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
}

.rt-shop-filter__categories {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.rt-shop-filter__choice {
    position: relative;
    min-width: 0;
    cursor: pointer;
}

.rt-shop-filter__choice > span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 4px;
    border: 1px solid #e7e1d8;
    border-radius: 8px;
    background: #f1ede6;
    font-size: 12px;
}

.rt-shop-filter__choice input:checked + span {
    border-color: #b58749;
    background: #ffffff;
    color: #8a6735;
}

.rt-shop-filter__choice input:focus-visible + span {
    outline: 2px solid #8a6735;
    outline-offset: 3px;
}

/* Shared track with two accessible native range inputs */
.rt-shop-filter__price-text {
    margin: 0;
    color: #6c6862;
    font-size: 13px;
    line-height: 1.5;
}

.rt-shop-range {
    --range-start: 0%;
    --range-end: 100%;
    position: relative;
    height: 44px;
    margin-top: 8px;
}

.rt-shop-range__track {
    position: absolute;
    top: 20px;
    right: 22px;
    left: 22px;
    height: 4px;
    overflow: hidden;
    border-radius: 4px;
    background: #e7e1d8;
}

.rt-shop-range__fill {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--range-start);
    right: calc(100% - var(--range-end));
    background: #b58749;
}

.rt-shop-range input {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 44px;
    margin: 0;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    background: transparent;
    pointer-events: none;
}

.rt-shop-range input.is-front {
    z-index: 3;
}

.rt-shop-range input::-webkit-slider-runnable-track {
    height: 44px;
    background: transparent;
}

.rt-shop-range input::-webkit-slider-thumb {
    width: 44px;
    height: 44px;
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    background: radial-gradient(
        circle,
        #f8f6f2 0 9px,
        #a5773b 9.5px 11px,
        transparent 11.5px
    );
    pointer-events: auto;
    cursor: grab;
}

.rt-shop-range input::-moz-range-track {
    height: 44px;
    border: 0;
    background: transparent;
}

.rt-shop-range input::-moz-range-thumb {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 0;
    background: radial-gradient(
        circle,
        #f8f6f2 0 9px,
        #a5773b 9.5px 11px,
        transparent 11.5px
    );
    pointer-events: auto;
    cursor: grab;
}

.rt-shop-filter__price-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.rt-shop-filter__price-fields label {
    min-width: 0;
    color: #6c6862;
    font-size: 12px;
}

.rt-shop-filter__price-fields label > span {
    display: block;
    margin-bottom: 4px;
}

.rt-shop-filter__price-fields input {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 8px;
    border: 1px solid #e7e1d8;
    border-radius: 6px;
    background: #ffffff;
    color: #181818;
    font-size: 14px;
}

.rt-shop-filter__brands {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 12px;
}

.rt-shop-filter__checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    color: #6c6862;
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
}

.rt-shop-filter__checkbox input {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #9c743f;
}

.rt-shop-filter__checkbox span {
    overflow-wrap: anywhere;
}

.rt-shop-filter__footer {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #e7e1d8;
    background: #f8f6f2;
}

.rt-shop-filter__clear {
    flex-shrink: 0;
    min-height: 44px;
    padding: 8px 0;
    border: 0;
    background: transparent;
    color: #8a6735;
    font-size: 13px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.rt-shop-filter__footer .rt-shop-gold-button {
    flex: 1;
    font-size: 13px;
}

/* Larger screens */
@media (min-width: 768px) {
    .rt-shop__container {
        padding-inline: 24px;
    }

    .rt-shop-hero__inner {
        min-height: 300px;
        padding-block: 48px;
    }

    .rt-shop-hero p {
        font-size: 18px;
    }

    .rt-shop-categories {
        gap: 16px;
        margin-block: 24px;
    }

    .rt-shop-category__media {
        aspect-ratio: 3 / 2;
    }

    .rt-shop-category__label {
        padding: 12px 16px;
        font-size: 20px;
    }

    .rt-shop-tabs {
        max-width: 560px;
    }

    .rt-shop-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 24px;
    }

    .rt-shop-product__body {
        padding: 12px 16px 16px;
    }

    .rt-shop-product h2 {
        font-size: 17px;
    }

    .rt-shop-toolbar {
        padding-block: 24px 16px;
    }
}

@media (min-width: 1024px) {
    .rt-shop-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (hover: hover) {
    .rt-shop-control:hover,
    .rt-shop-filter__close:hover {
        border-color: #c9a46a;
        background: #f1ede6;
    }

    .rt-shop-sort__option:hover {
        color: #8a6735;
    }

    .rt-shop-gold-button:hover {
        background: #bf975e;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rt-shop-filter__panel,
    .rt-shop-filter::backdrop {
        transition: none;
    }
}

/* Appears only when a product has an old price. */
.rt-shop-product__old-price {
    display: inline-block;
    margin-left: 4px;
    color: #6c6862;
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
}

/* Keep the media area stable when a real product has no image. */
.rt-shop-product__image-placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: #6c6862;
    font-size: 12px;
    text-align: center;
}

/* Database Shop navigation uses the approved controls and card styling. */
.rt-shop[data-shop-server]:not(.rt-category) .rt-shop-tabs__button {
    display: grid;
    place-items: center;
    text-align: center;
    overflow-wrap: anywhere;
}
.rt-shop[data-shop-server]:not(.rt-category) .rt-shop-tabs__button[aria-current="page"] {
    color: #8a6735;
}
.rt-shop[data-shop-server]:not(.rt-category) .rt-shop-tabs__button[aria-current="page"]::after {
    content: "";
    position: absolute;
    right: 12px;
    bottom: -1px;
    left: 12px;
    height: 2px;
    border-radius: 2px;
    background: #b58749;
}
.rt-shop[data-shop-server] .rt-shop-category[aria-current="page"] {
    border-color: #c9a46a;
}
.rt-shop[data-shop-server] .rt-shop-category__label,
.rt-shop[data-shop-server] .rt-shop-filter__choice > span {
    overflow-wrap: anywhere;
}
.rt-shop-category__placeholder {
    display: grid;
    place-items: center;
    height: 100%;
    padding: 8px;
    color: #6c6862;
    font-size: 12px;
    text-align: center;
}
.rt-shop[data-shop-server] .rt-shop-pagination {
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}
.rt-shop-pagination__position {
    color: #6c6862;
    font-size: 12px;
}
