.rf-product,
.rf-quick {
    --product-pink: #18395C;
    --product-ink: #211b1b;
    --product-muted: #666666;
    --product-border: #e5e5e5;
    color: var(--product-ink);
    font-family: var(--font, 'Plus Jakarta Sans', sans-serif);
    line-height: 1.5;
}

.rf-product *,
.rf-quick * {
    box-sizing: border-box;
}

.rf-product {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    background: #fff;
    border: 1px solid #eee8e4;
    border-radius: 9px;
    overflow: hidden;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.rf-product.is-navigating {
    cursor: progress;
}

.rf-product.is-navigating::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    background: rgba(255, 255, 255, .62);
}

.rf-product.is-navigating::after {
    content: "";
    position: absolute;
    top: 38%;
    left: 50%;
    z-index: 3;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    border: 3px solid #d8d8d8;
    border-top-color: #111;
    border-radius: 50%;
    animation: rf-product-loading .7s linear infinite;
    pointer-events: none;
}

@keyframes rf-product-loading {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .rf-product.is-navigating::after { animation-duration: 1.5s; }
}

.rf-product:hover,
.rf-product:focus-within {
    border-color: #e2d4ce;
    box-shadow: 0 10px 26px rgba(53, 31, 28, .09);
    transform: translateY(-3px);
}

.rf-product a,
.rf-quick a {
    color: inherit;
    text-decoration: none;
}

.rf-product button {
    font-family: inherit;
    cursor: pointer;
}

.flash-sale .owl-stage,
.flash-sale .owl-item {
    display: flex;
}

.flash-sale .owl-item {
    float: none;
}

.rf-flash-slide {
    display: flex;
    width: 100%;
}

.rf-flash-slide>.rf-product {
    width: 100%;
}

.rf-product__visual {
    position: relative;
    overflow: hidden;
    background: #f8f5f2;
}

.rf-product__image {
    display: block;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: #f8f5f2;
}

.rf-product__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 350ms cubic-bezier(.2,.7,.2,1);
}

@media (hover: hover) {
    .rf-product:hover .rf-product__image img {
        transform: scale(1.045);
    }
}

.rf-product__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 5px 9px;
    border-radius: 3px;
    background: #18395C;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    pointer-events: none;
}

.rf-product__preview {
    position: absolute;
    top: 10px;
    right: 10px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(33,27,27,.08);
    border-radius: 50%;
    background: rgba(255,255,255,.94);
    color: #211b1b;
    font-size: 15px;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.rf-product:hover .rf-product__preview,
.rf-product:focus-within .rf-product__preview {
    opacity: 1;
    transform: translateY(0);
}

.rf-product__preview:hover {
    background: #18395C;
    color: #fff;
}

.rf-product__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 12px 13px 14px;
    text-align: left;
}

.rf-product h3 {
    margin: 0;
    min-height: 38px;
    font-size: 13px;
    font-weight: 600;
    line-height: 19px;
    letter-spacing: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
    color: #302727;
}

.rf-product h3 a:hover {
    color: #18395C;
}

.rf-product__price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-start;
    column-gap: 8px;
    row-gap: 2px;
    margin: 8px 0 0;
    color: #18395C;
}

.rf-product__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-top: 12px;
}

.rf-product__actions button {
    min-width: 0;
    min-height: 36px;
    padding: 6px 8px;
    border: 1px solid var(--product-pink);
    border-radius: 5px;
    background: var(--product-pink);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
}

.rf-product__actions .rf-product__add {
    background: #fff;
    color: var(--product-pink);
}

.rf-product__badge-saving {
    display: none;
}

.rf-product__actions button:hover:not(:disabled) {
    filter: brightness(.94);
}

.rf-product__actions button:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.rf-product__price strong {
    font-size: 16px;
    font-weight: 700;
}

.rf-product__price del {
    font-size: 12px;
    color: #8c817d;
}

.rf-product__saving {
    margin-left: auto;
    padding: 2px 6px;
    border-radius: 3px;
    background: #f7efeb;
    font-size: 10px;
    color: #18395C;
}

.rf-product :is(a, button):focus-visible,
.rf-quick :is(a, button, select, input):focus-visible {
    outline: 2px solid #18395C;
    outline-offset: -3px;
}

/* Quick View Dialog */
.rf-quick {
    border: 0;
    padding: 28px 32px;
    width: min(920px, calc(100vw - 32px));
    max-height: calc(100dvh - 40px);
    margin: auto !important;
    background: #ffffff;
    overflow-y: auto;
    border-radius: 14px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.35);
    position: fixed !important;
    inset: 0 !important;
    overscroll-behavior: contain;
}

.rf-quick::backdrop {
    background: rgba(15, 15, 20, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.rf-quick[open] {
    animation: rfQuickModalPop 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes rfQuickModalPop {
    from {
        opacity: 0;
        transform: scale(0.97) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

html:has(#rf-product-dialog[open]),
body:has(#rf-product-dialog[open]) {
    overflow: hidden;
}

.rf-quick [hidden],
.rf-cart-notice[hidden] {
    display: none !important;
}

.rf-quick__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 34px;
    height: 34px;
    padding: 0;
    background: #f4f4f5;
    border: 1px solid #e4e4e7;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    color: #18181b;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.rf-quick__close:hover {
    background: #09090b;
    color: #ffffff;
    border-color: #09090b;
    transform: rotate(90deg);
}

.rf-quick__layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 32px;
    align-items: start;
}

/* Image section: completely free height, unconstrained */
.rf-quick__visual {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.rf-quick__visual>img {
    width: 100%;
    height: auto !important;
    max-height: none !important;
    min-height: 0;
    object-fit: contain;
    background: #fafafa;
    border: 1px solid #f4f4f5;
    border-radius: 10px;
    display: block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.rf-quick__gallery {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 2px 6px;
}

.rf-quick__gallery button {
    flex-shrink: 0;
    width: 62px;
    height: 74px;
    padding: 0;
    border: 1.5px solid #e4e4e7;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.15s ease;
}

.rf-quick__gallery button:hover,
.rf-quick__gallery button.is-active {
    border-color: #09090b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

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

.rf-quick__form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 4px;
    margin: 0;
    min-width: 0;
}

.rf-quick__eyebrow {
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #71717a;
    font-weight: 700;
}

.rf-quick h2 {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
    color: #09090b;
}

.rf-quick__price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 12px;
    font-size: 22px;
    font-weight: 700;
    color: #09090b;
    margin: 2px 0 0;
}

.rf-quick__stock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    width: fit-content;
    margin: 2px 0;
}

.rf-quick__stock.in-stock {
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.rf-quick__stock.out-of-stock {
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.rf-quick p {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.5;
}

.rf-quick__description {
    color: #52525b;
    max-height: 72px;
    overflow-y: auto;
    font-size: 13px !important;
    line-height: 1.6 !important;
}

.rf-quick__attributes {
    display: grid;
    gap: 8px;
    margin: 2px 0 0;
}

.rf-quick-variant-block {
    display: grid;
    gap: 6px;
    margin: 4px 0 8px;
}

.rf-quick-variant-lbl {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13.5px;
    font-weight: 600;
    color: #27272a;
}

.rf-quick-variant-lbl strong {
    color: #09090b;
    font-weight: 700;
}

.rf-quick-variant-select {
    width: 100% !important;
    min-height: 44px !important;
    padding: 8px 36px 8px 12px !important;
    border: 1.5px solid #d4d4d8 !important;
    border-radius: 8px !important;
    background-color: #fff !important;
    color: #09090b !important;
    font-family: inherit !important;
    font-size: 14.5px !important;
    font-weight: 600 !important;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2309090b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 16px !important;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.rf-quick-variant-select:focus {
    outline: none !important;
    border-color: #09090b !important;
    box-shadow: 0 0 0 3px rgba(9, 9, 11, .1) !important;
}

/* Quantity Stepper */
.rf-quick-qty-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 0 6px;
}

.rf-quick-qty-label {
    font-size: 13.5px;
    font-weight: 600;
    color: #27272a;
}

.rf-quick-qty-box {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid #e4e4e7;
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
    height: 42px;
}

.rf-quick-qty-btn {
    width: 40px;
    height: 42px;
    border: 0;
    background: #ffffff;
    color: #111111;
    font-size: 18px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease;
    padding: 0;
}

.rf-quick-qty-btn:hover {
    background: #f4f4f5;
}

.rf-quick-qty-input {
    width: 48px;
    height: 42px;
    border-top: 0 !important;
    border-bottom: 0 !important;
    border-left: 1.5px solid #e4e4e7 !important;
    border-right: 1.5px solid #e4e4e7 !important;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: #111111;
    background: #ffffff;
    outline: none;
    padding: 0 !important;
    -moz-appearance: textfield;
}

.rf-quick-qty-input::-webkit-outer-spin-button,
.rf-quick-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Add to Cart - Luxury Outline */
.rf-quick .rf-product__add {
    width: 100%;
    min-height: 46px;
    border: 2px solid #09090b;
    background: #ffffff;
    color: #09090b;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-top: 4px;
}

.rf-quick .rf-product__add:hover:not(:disabled) {
    background: #09090b;
    border-color: #09090b;
    color: #ffffff;
}

/* Buy Now with continuous, non-pausing periodic shake */
.rf-quick .rf-product__buy {
    width: 100%;
    min-height: 48px;
    border: 1px solid #09090b;
    background: #09090b;
    color: #ffffff;
    border-radius: 8px;
    font-size: 15.5px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    will-change: transform;
    animation: rf-buy-shake-2s 2.2s infinite ease-in-out;
    -webkit-animation: rf-buy-shake-2s 2.2s infinite ease-in-out;
}

.rf-quick .rf-product__buy:hover:not(:disabled) {
    background: #27272a;
    border-color: #27272a;
}

@keyframes rf-buy-shake-2s {
    0%, 52%, 100% {
        transform: translate3d(0, 0, 0);
    }
    8% {
        transform: translate3d(-5px, 0, 0) rotate(-1.5deg);
    }
    16% {
        transform: translate3d(5px, 0, 0) rotate(1.5deg);
    }
    24% {
        transform: translate3d(-4px, 0, 0) rotate(-1deg);
    }
    32% {
        transform: translate3d(4px, 0, 0) rotate(1deg);
    }
    38% {
        transform: translate3d(-2px, 0, 0) rotate(-0.5deg);
    }
    44% {
        transform: translate3d(2px, 0, 0);
    }
    48% {
        transform: translate3d(0, 0, 0);
    }
}

@-webkit-keyframes rf-buy-shake-2s {
    0%, 52%, 100% {
        -webkit-transform: translate3d(0, 0, 0);
    }
    8% {
        -webkit-transform: translate3d(-5px, 0, 0) rotate(-1.5deg);
    }
    16% {
        -webkit-transform: translate3d(5px, 0, 0) rotate(1.5deg);
    }
    24% {
        -webkit-transform: translate3d(-4px, 0, 0) rotate(-1deg);
    }
    32% {
        -webkit-transform: translate3d(4px, 0, 0) rotate(1deg);
    }
    38% {
        -webkit-transform: translate3d(-2px, 0, 0) rotate(-0.5deg);
    }
    44% {
        -webkit-transform: translate3d(2px, 0, 0);
    }
    48% {
        -webkit-transform: translate3d(0, 0, 0);
    }
}

.rf-quick__error {
    color: #b42337;
    font-size: 12.5px;
    font-weight: 500;
    min-height: 18px;
}

.rf-quick__error:empty {
    display: none;
}

.rf-quick__details {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #52525b !important;
    text-decoration: none !important;
    padding: 4px 0 0;
    transition: color 0.15s ease;
}

.rf-quick__details:hover {
    color: #292524 !important;
    text-decoration: underline !important;
}

/* Refined quick view */
.rf-quick {
    width: min(1000px, calc(100vw - 40px));
    padding: 32px;
    border: 1px solid #eee5e0;
    border-radius: 12px;
    background: #fffdfb;
    box-shadow: 0 28px 80px rgba(36, 22, 20, .25);
}

.rf-quick__layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, .92fr);
    gap: clamp(24px, 4vw, 44px);
    align-items: center;
}

.rf-quick__visual>img {
    height: min(58vh, 540px) !important;
    aspect-ratio: 4 / 5;
    object-fit: contain;
    border: 0;
    border-radius: 8px;
    background: #f7f3f0;
    box-shadow: none;
}

.rf-quick__form {
    gap: 12px;
    padding: 12px 4px;
}

.rf-quick__eyebrow {
    color: #292524;
    letter-spacing: .16em;
}

.rf-quick h2 {
    color: #261f1e;
    font-size: clamp(22px, 2.4vw, 29px);
    line-height: 1.25;
}

.rf-quick__price {
    color: #292524;
    font-size: 25px;
}

.rf-quick__description {
    max-height: 96px;
    color: #6f6460;
}

.rf-quick-variant-select {
    border-color: #e6dcd7 !important;
    border-radius: 6px !important;
}

.rf-quick-variant-select:focus {
    border-color: #292524 !important;
    box-shadow: 0 0 0 3px rgba(41, 37, 36, .1) !important;
}

.rf-quick .rf-product__add,
.rf-quick .rf-product__buy {
    min-height: 48px;
    border-radius: 5px;
    animation: none;
    -webkit-animation: none;
    box-shadow: none;
}

.rf-quick .rf-product__add {
    border: 1px solid #292524;
    color: #292524;
}

.rf-quick .rf-product__add:hover:not(:disabled) {
    background: #f4f1ef;
    color: #111111;
}

.rf-quick .rf-product__buy {
    border: 1px solid #292524;
    background: #292524;
}

.rf-quick .rf-product__buy:hover:not(:disabled) {
    background: #111111;
    border-color: #111111;
}

.rf-quick__close {
    top: 12px;
    right: 12px;
    background: #fff;
    color: #554845;
}

.rf-quick__close:hover {
    background: #292524;
    border-color: #292524;
}

.rf-quick__status {
    padding: 40px 16px;
    text-align: center;
    font-size: 15px;
    color: #71717a;
}

@media (max-width: 768px) {
    .rf-quick {
        padding: 22px 18px;
        width: calc(100vw - 24px);
        max-height: calc(100dvh - 24px);
        border-radius: 10px;
    }
    .rf-quick__layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .rf-quick h2 {
        font-size: 19px;
    }

    .rf-quick__visual>img {
        height: min(34vh, 300px) !important;
    }

    .rf-quick__form {
        gap: 10px;
        padding: 0;
    }
}

/* Toast / Notice */
.rf-cart-notice {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    max-width: calc(100% - 32px);
    padding: 12px 22px;
    background: var(--product-ink);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(48, 38, 48, 0.15);
    text-align: center;
    animation: rf-cart-toast-in .2s ease-out;
}

dialog[open] .rf-cart-notice {
    top: 16px !important;
    bottom: auto !important;
}

@keyframes rf-cart-toast-in {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}


@media (max-width: 575px) {
    .rf-product__badge-sale,
    .rf-product__saving {
        display: none;
    }

    .rf-product__badge-saving {
        display: inline;
        white-space: nowrap;
    }

    .rf-product__actions {
        grid-template-columns: minmax(0, 1fr) 38px;
        gap: 6px;
    }

    .rf-product__actions .rf-product__buy {
        white-space: nowrap;
        padding-inline: 4px;
        font-size: 10px;
    }

    .rf-product__actions .rf-product__add {
        width: 38px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 15px;
    }

    .rf-product__add-label {
        display: none;
    }

    .rf-product__body {
        padding: 9px 9px 11px;
    }

    .rf-product__badge {
        padding: 4px 7px;
        font-size: 10px;
    }

    .rf-product h3 {
        min-height: 36px;
        font-size: 12px;
        line-height: 17px;
    }

    .rf-product__price {
        gap: 2px 6px;
    }

    .rf-product__price strong,
    .rf-product__price del,
    .rf-product__saving {
        font-size: 13px;
    }

    .rf-product__badge {
        top: 8px;
        left: 8px;
    }

    .rf-product__preview {
        top: 8px;
        right: 8px;
        width: 32px;
        height: 32px;
        opacity: 1;
        transform: none;
    }

    .rf-quick {
        padding: 24px 16px 20px;
    }

    .rf-quick__layout {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .rf-quick__visual>img {
        height: 220px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .rf-product,
    .rf-product__image img {
        transition: none;
    }
}

/* Product Grid */
.product-grid,
.rf-product-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

@media (max-width: 1200px) {

    .product-grid,
    .rf-product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 14px;
    }
}

@media (max-width: 991px) {

    .product-grid,
    .rf-product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }
}

@media (max-width: 575px) {

    .product-grid,
    .rf-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}

/* Pagination Styling */
.rf-pagination-wrap {
    display: flex;
    justify-content: center;
    margin: 40px 0 20px;
}

.rf-pagination-wrap nav {
    display: flex;
    align-items: center;
}

.rf-pagination-wrap svg {
    width: 18px;
    height: 18px;
}

.rf-pagination-wrap .pagination {
    display: flex;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.rf-pagination-wrap .page-item .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #e5e5e5;
    background: #fff;
    color: #111;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.rf-pagination-wrap .page-item.active .page-link,
.rf-pagination-wrap .page-item .page-link:hover {
    background: #111;
    border-color: #111;
    color: #fff;
}

.rf-pagination-wrap .page-item.disabled .page-link {
    color: #aaa;
    border-color: #eee;
    background: #fafafa;
    pointer-events: none;
}
