/* Sticky-footer behavior is already handled at the body/main level (body is a
   flex column at height:100%, main has flex-grow-1) — this min-height:100%
   was redundant with that and, on long pages (e.g. the homepage's full
   product grid), forced the container to compute far taller than its actual
   content needed, leaving a large blank gap below the footer. */
main > .container {
    padding: 16px 15px 20px;
    display: flex;
    flex-direction: column;
}

.rm-front-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.rm-front-logo {
    height: 42px;
    width: auto;
    display: block;
}

.rm-float-cart {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, #28a745, #1e7e34);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    z-index: 1200;
}

.rm-float-cart:hover {
    filter: brightness(1.02);
    transform: translateY(-1px);
}

.rm-float-cart-icon {
    font-size: 20px;
    line-height: 1;
}

.rm-float-cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ff3b30;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.25);
}

.not-set {
    color: var(--bs-danger);
    font-style: italic;
}

/* add sorting icons to gridview sort links */
a.asc:after, a.desc:after {
    content: '';
    left: 3px;
    display: inline-block;
    width: 0;
    height: 0;
    border: solid 5px transparent;
    margin: 4px 4px 2px 4px;
    background: transparent;
}

a.asc:after {
    border-bottom: solid 7px var(--bs-body-color);
    border-top-width: 0;
}

a.desc:after {
    border-top: solid 7px var(--bs-body-color);
    border-bottom-width: 0;
}

.grid-view th {
    white-space: nowrap;
}

.hint-block {
    display: block;
    margin-top: 5px;
    color: var(--bs-secondary-color);
}

.error-summary {
    color: var(--bs-danger-text-emphasis);
    background: var(--bs-danger-bg-subtle);
    border-left: 3px solid var(--bs-danger-border-subtle);
    padding: 10px 20px;
    margin: 0 0 15px 0;
}

.rm-flash-stack {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(92vw, 420px);
    pointer-events: none;
}

.rm-flash {
    border: 0;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
    padding: 14px 16px;
    transition: opacity .25s ease, transform .25s ease;
    animation: rm-flash-in .25s ease;
    pointer-events: auto;
}

@keyframes rm-flash-in {
    from { opacity: 0; transform: scale(.94); }
    to { opacity: 1; transform: scale(1); }
}

.rm-flash.rm-flash-hide {
    opacity: 0;
    transform: scale(.96);
}

.rm-flash .btn-close {
    padding: .95rem;
}

.rm-flash-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.rm-flash-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.72);
}

/* align navbar brand baseline with nav links */
.navbar > .container,
.navbar > .container-fluid {
    align-items: baseline;
}

/* style navbar logout link color, hover state, and mobile layout */
.navbar-nav .nav-link.logout {
    color: var(--bs-navbar-color);
}

@media (max-width: 767.98px) {
    .navbar-nav .nav-link.logout {
        display: block;
        text-align: left;
        width: 100%;
        padding: 10px 0;
    }
}

.navbar-nav .nav-link.logout:focus,
.navbar-nav .nav-link.logout:hover {
    color: var(--bs-navbar-hover-color);
}



/* footer logo: light logo by default (light bg-body-tertiary), dark logo for dark theme */
.footer-logo-dark { display: none; }

[data-bs-theme="dark"] .footer-logo-light { display: none; }
[data-bs-theme="dark"] .footer-logo-dark  { display: inline-block; }

/* Yii brand button */
.btn-yii {
    background: linear-gradient(135deg, #40B3D8, #3a9cbd);
    border: none;
    font-weight: 600;
    letter-spacing: .02em;
    transition: opacity .2s, transform .1s;
}

.btn-yii:hover {
    opacity: .9;
    transform: translateY(-1px);
}

.btn-yii:active {
    transform: translateY(0);
}

/* form inputs: seamless icon inside input (Volt style) */
.form-card .input-group {
    border: var(--bs-border-width) solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    overflow: hidden;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.form-card .input-group .input-group-text {
    background: var(--bs-body-bg);
    border: 0;
    padding-left: 1rem;
    padding-right: .75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-card .input-group .form-control {
    border: 0;
}

.form-card .input-group .form-control:focus {
    box-shadow: none;
}

.form-card .input-group:focus-within {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 .25rem rgba(var(--bs-primary-rgb), .25);
}

/* validation styles for browsers that support :has() */
@supports selector(.input-group:has(.is-invalid)) {
    .form-card .input-group:has(.is-invalid) ~ .invalid-feedback {
        display: block;
        margin-top: .35rem;
        margin-bottom: .5rem;
    }

    .form-card .input-group:has(.is-invalid) {
        border-color: var(--bs-danger);
    }

    .form-card .input-group:has(.is-invalid):focus-within {
        box-shadow: 0 0 0 .25rem rgba(var(--bs-danger-rgb), .25);
    }
}

/* fallback validation styles for browsers without :has() support */
@supports not selector(.input-group:has(.is-invalid)) {
    .form-card .invalid-feedback:not(:empty) {
        display: block;
        margin-top: .35rem;
        margin-bottom: .5rem;
    }

    .form-card .input-group .form-control.is-invalid {
        border: var(--bs-border-width) solid var(--bs-danger);
    }

    .form-card .input-group .form-control.is-invalid:focus {
        box-shadow: 0 0 0 .25rem rgba(var(--bs-danger-rgb), .25);
    }
}

/* login inputs: seamless icon inside input (Volt style) */
.login-split-card .input-group {
    border: var(--bs-border-width) solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    overflow: hidden;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.login-split-card .input-group .input-group-text {
    background: transparent;
    border: 0;
    padding-left: 1rem;
    padding-right: .75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-split-card .input-group .form-control {
    border: 0;
    background: transparent;
}

.login-split-card .input-group .form-control:focus {
    box-shadow: none;
}

.login-split-card .input-group:focus-within {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 .25rem rgba(var(--bs-primary-rgb), .25);
}

/* validation styles for login split card (browsers with :has()) */
@supports selector(.input-group:has(.is-invalid)) {
    .login-split-card .input-group:has(.is-invalid) ~ .invalid-feedback {
        display: block;
        margin-top: .35rem;
        margin-bottom: .5rem;
    }

    .login-split-card .input-group:has(.is-invalid) {
        border-color: var(--bs-danger);
    }

    .login-split-card .input-group:has(.is-invalid):focus-within {
        box-shadow: 0 0 0 .25rem rgba(var(--bs-danger-rgb), .25);
    }
}

/* fallback validation styles for login split card (browsers without :has()) */
@supports not selector(.input-group:has(.is-invalid)) {
    .login-split-card .invalid-feedback:not(:empty) {
        display: block;
        margin-top: .35rem;
        margin-bottom: .5rem;
    }

    .login-split-card .input-group .form-control.is-invalid {
        border: var(--bs-border-width) solid var(--bs-danger);
    }

    .login-split-card .input-group .form-control.is-invalid:focus {
        box-shadow: 0 0 0 .25rem rgba(var(--bs-danger-rgb), .25);
    }
}

/* login split card */
.login-split-card {
    border-radius: 1rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .10);
    background-color: var(--bs-gray-100);
    width: 100%;
    max-width: 900px;
}

.login-split-card-wide {
    max-width: 960px;
}

.login-brand-title {
    font-size: 1.75rem;
    line-height: 1.3;
}

.login-brand-text {
    font-size: .9rem;
}

.login-brand-panel {
    background: linear-gradient(135deg, #40B3D8 0%, #3a9cbd 40%, #83C933 100%);
    position: relative;
    min-height: 480px;
}

.login-brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(241, 138, 42, .25) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(131, 201, 51, .2) 0%, transparent 40%);
    pointer-events: none;
}

.login-btn {
    background: linear-gradient(135deg, #40B3D8, #3a9cbd);
    border: none;
    font-weight: 600;
    letter-spacing: .02em;
    transition: opacity .2s, transform .1s;
}

.login-btn:hover {
    opacity: .9;
    transform: translateY(-1px);
}

.login-btn:active {
    transform: translateY(0);
}

/* dark mode login card */
[data-bs-theme="dark"] .login-split-card {
    background-color: var(--bs-body-bg);
    box-shadow: 0 0 0 1px var(--bs-border-color), 0 4px 24px rgba(0, 0, 0, .4);
}

[data-bs-theme="dark"] .login-mobile-logo {
    filter: invert(1);
}

/* contact form textarea height */
.site-contact textarea.form-control {
    height: 140px;
}

/* form cards */
.form-card {
    border-radius: 1rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .10);
}

/* dark mode: elevate form cards against dark background */
[data-bs-theme="dark"] .form-card {
    box-shadow: 0 0 0 1px var(--bs-border-color), 0 4px 24px rgba(0, 0, 0, .4);
}

/* captcha: blend with card background */
.site-contact img[src*="captcha"] {
    border-radius: var(--bs-border-radius);
    mix-blend-mode: multiply;
}

/* dark mode: invert captcha for visibility on dark background */
[data-bs-theme="dark"] .site-contact img[src*="captcha"] {
    mix-blend-mode: screen;
    filter: invert(1) hue-rotate(180deg);
}

/* centered page layout */
.site-login,
.site-signup,
.site-contact,
.site-index,
.site-error,
.site-about {
    flex: 1;
}

/* =========================
   Richmart Auth (premium)
   ========================= */
.rich-auth {
    min-height: calc(100vh - 70px);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: clamp(24px, 5vw, 56px) 0;
    background:
        radial-gradient(1200px 700px at 20% 20%, rgba(40, 167, 69, 0.28), transparent 55%),
        radial-gradient(900px 600px at 80% 10%, rgba(13, 110, 253, 0.20), transparent 55%),
        radial-gradient(1100px 800px at 60% 90%, rgba(255, 193, 7, 0.16), transparent 55%),
        linear-gradient(180deg, #0b1220 0%, #0b1220 100%);
}

.rich-auth::before {
    content: "";
    position: absolute;
    inset: 0;
    /* Premium supermarket wallpaper (remote, lightweight) */
    background-image:
        linear-gradient(180deg, rgba(10, 15, 25, 0.78), rgba(10, 15, 25, 0.78)),
        url("https://images.unsplash.com/photo-1542838132-92c53300491e?auto=format&fit=crop&w=1800&q=70");
    background-size: cover;
    background-position: center;
    transform: scale(1.02);
    filter: saturate(1.05) contrast(1.05);
}

.rich-auth::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(40, 167, 69, 0.20), transparent 45%),
        radial-gradient(circle at 80% 0%, rgba(13, 110, 253, 0.18), transparent 50%);
    pointer-events: none;
}

.rich-auth .rich-auth-shell {
    position: relative;
    width: 100%;
}

.rich-auth-card {
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.32);
    box-shadow: 0 18px 70px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    overflow: hidden;
}

[data-bs-theme="dark"] .rich-auth-card {
    background: rgba(17, 24, 39, 0.72);
    border-color: rgba(255, 255, 255, 0.10);
}

.rich-auth-brand {
    background:
        radial-gradient(900px 480px at 30% 20%, rgba(40, 167, 69, 0.35), transparent 55%),
        radial-gradient(800px 480px at 90% 0%, rgba(13, 110, 253, 0.22), transparent 55%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.92));
    color: #fff;
}

.rich-auth-brand .brand-badge {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    font-weight: 800;
    letter-spacing: .02em;
    font-size: 1.05rem;
}

.rich-auth-brand .brand-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #28a745;
    box-shadow: 0 0 0 6px rgba(40, 167, 69, 0.15);
}

.rich-auth-tabs .nav-link {
    border: 0;
    border-bottom: 2px solid transparent;
    font-weight: 700;
    color: rgba(17, 24, 39, 0.65);
    padding: .75rem 1rem;
}

[data-bs-theme="dark"] .rich-auth-tabs .nav-link {
    color: rgba(255, 255, 255, 0.75);
}

.rich-auth-tabs .nav-link.active {
    color: #28a745;
    border-bottom-color: #28a745;
    background: transparent;
}

.rich-auth-input .input-group {
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.62);
}

[data-bs-theme="dark"] .rich-auth-input .input-group {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(17, 24, 39, 0.30);
}

.rich-auth-input .input-group-text {
    border: 0;
    background: transparent;
    padding-left: 1rem;
    padding-right: .75rem;
    color: rgba(17, 24, 39, 0.65);
}

[data-bs-theme="dark"] .rich-auth-input .input-group-text {
    color: rgba(255, 255, 255, 0.65);
}

.rich-auth-input .form-control {
    border: 0;
    background: transparent;
    padding: .9rem 1rem;
}

.rich-auth-input .form-control:focus {
    box-shadow: none;
}

.rich-auth-input .input-group:focus-within {
    border-color: rgba(40, 167, 69, 0.9);
    box-shadow: 0 0 0 .22rem rgba(40, 167, 69, 0.18);
}

.rich-auth-cta {
    border-radius: 14px;
    font-weight: 800;
    letter-spacing: .01em;
    padding: .9rem 1rem;
    background: linear-gradient(135deg, #28a745, #1e7e34);
    border: 0;
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.22);
}

.rich-auth-cta:hover {
    filter: brightness(1.02);
    transform: translateY(-1px);
}

.rich-auth-cta:active {
    transform: translateY(0);
}

.site-error .site-error-content,
.site-about .site-about-content {
    width: 100%;
    max-width: 90%;
}

@media (min-width: 576px) {
    .site-error .site-error-content,
    .site-about .site-about-content {
        max-width: 80%;
    }
}

@media (min-width: 768px) {
    .site-error .site-error-content,
    .site-about .site-about-content {
        max-width: 60%;
    }
}

@media (min-width: 992px) {
    .site-error .site-error-content,
    .site-about .site-about-content {
        max-width: 50%;
    }
}

/* hero banner */
.hero-banner {
    background: linear-gradient(135deg, #83C933 0%, #3a9cbd 40%, #40B3D8 100%);
    position: relative;
}

.hero-lead {
    max-width: 520px;
}

.hero-logo {
    height: 120px;
    opacity: .45;
    right: 2.5rem;
    top: 50%;
    transform: translateY(-50%);
}

.hero-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        radial-gradient(circle at 15% 85%, rgba(241, 138, 42, .3) 0%, transparent 45%),
        radial-gradient(circle at 85% 15%, rgba(131, 201, 51, .25) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 50%, rgba(64, 179, 216, .15) 0%, transparent 60%);
    pointer-events: none;
}

/* extension cards */
.extension-card {
    transition: transform .15s ease-in-out, box-shadow .15s ease-in-out;
}

.extension-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12) !important;
}

.extension-icon {
    font-size: 1.5rem;
    line-height: 1;
}

/* dark mode: extension cards */
[data-bs-theme="dark"] .extension-card {
    background-color: var(--bs-body-bg);
    box-shadow: 0 0 0 1px var(--bs-border-color), 0 2px 8px rgba(0, 0, 0, .3);
}

[data-bs-theme="dark"] .extension-card:hover {
    box-shadow: 0 0 0 1px var(--bs-border-color), 0 8px 24px rgba(0, 0, 0, .4) !important;
}

.rm-add-to-cart-btn .rm-add-icon {
    display: none;
}

@media (max-width: 400px) {
    .rm-add-to-cart-btn {
        min-width: 34px;
        width: 34px;
        height: 34px;
        padding: 0 !important;
        border-radius: 50% !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }

    .rm-add-to-cart-btn .rm-add-label {
        display: none;
    }

    .rm-add-to-cart-btn .rm-add-icon {
        display: inline;
        font-size: 18px;
        font-weight: 700;
        line-height: 1;
    }
}

/* ── Richmart mobile shop UI ─────────────────────────────────────────── */
.rm-main-fluid > .container {
    max-width: 100%;
}

/* The fixed bottom nav itself is mobile-only (.rm-bottom-nav has d-md-none),
   but this reserved space was applying unconditionally — on desktop, where
   there's no fixed nav to clear, it just left a blank gap below the footer. */
@media (max-width: 767.98px) {
    .rm-has-bottom-nav {
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    }

    .rm-has-bottom-nav #footer {
        padding-bottom: 12px;
    }

    main.rm-main-fluid > .alert {
        margin: 0 12px;
    }
}

.rm-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    gap: 2px;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid rgba(15, 23, 42, 0.1);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
}

.rm-bottom-nav__item {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    color: #6b7280;
    font-size: 11px;
    font-weight: 600;
    min-height: 48px;
}

.rm-bottom-nav__item.is-active {
    color: #28a745;
}

.rm-bottom-nav__ic {
    font-size: 20px;
    line-height: 1;
}

.rm-bottom-nav__badge {
    position: absolute;
    top: 2px;
    right: calc(50% - 22px);
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ff3b30;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rm-view-all {
    color: #28a745;
    font-weight: 600;
    text-decoration: none;
}

.rm-view-all:hover {
    color: #1e7e34;
}

.rm-category-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 2px 10px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.rm-category-scroll::-webkit-scrollbar {
    display: none;
}

.rm-auto-scroll-strip .rm-category-scroll {
    scroll-snap-type: none;
}

.rm-category-card {
    position: relative;
    flex: 0 0 92px;
    scroll-snap-align: start;
    text-decoration: none;
    color: #1a1a1a;
    text-align: center;
}

.rm-category-card__img {
    width: 92px;
    height: 92px;
    border-radius: 14px;
    border: 1px solid #eceff3;
    background: #f8fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 8px;
}

.rm-category-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rm-category-card__img i {
    font-size: 28px;
    color: #28a745;
}

.rm-category-card.active .rm-category-card__img {
    border-color: #28a745;
    border-width: 2px;
    background: #eaf7ee;
}

.rm-category-card.active .rm-category-card__label {
    color: #28a745;
}

.rm-category-card__label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.rm-category-card__arrow {
    display: none;
}

@media (max-width: 767.98px) {
    .rm-home-section {
        margin-top: 20px !important;
        padding: 0 14px;
    }

    .rm-home-section .section-header {
        margin-bottom: 12px;
    }

    .rm-home-section .section-header h2 {
        font-size: 23px;
        letter-spacing: -.03em;
    }

    #rm-category-strip .rm-category-scroll {
        display: flex;
        flex-direction: column;
        gap: 7px;
        overflow: visible;
        padding: 0;
    }

    #rm-category-strip .rm-category-card {
        flex: 0 0 auto;
        min-height: 62px;
        width: 100%;
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 7px 14px 7px 9px;
        text-align: left;
        border: 1px solid #edf0f3;
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 2px 8px rgba(15, 23, 42, .07);
    }

    #rm-category-strip .rm-category-card__img {
        flex: 0 0 76px;
        width: 76px;
        height: 48px;
        margin: 0;
        border: 0;
        border-radius: 11px;
        background: #f5f7f8;
    }

    #rm-category-strip .rm-category-card__label {
        flex: 1;
        font-size: 16px;
        font-weight: 700;
        color: #17213a;
    }

    #rm-category-strip .rm-category-card__arrow {
        display: block;
        color: #17213a;
        font-size: 32px;
        font-weight: 300;
        line-height: 1;
    }

    #rm-category-strip .rm-category-card.active {
        border-color: #b8e3c4;
        background: #f3fbf5;
    }

    .cart-index {
        background: #f8faf9;
        margin: -16px -12px -20px;
        padding: 8px 12px 24px;
    }

    .rm-cart-heading {
        min-height: 48px;
        margin-bottom: 12px !important;
    }

    .rm-cart-heading h1 {
        font-size: 23px;
        color: #14213d;
    }

    .rm-cart-back {
        color: #14213d;
        font-size: 38px;
        font-weight: 300;
        line-height: .8;
        text-decoration: none;
    }

    .rm-cart-count {
        padding: 8px 14px;
        border-radius: 999px;
        background: #e0f3e5;
        color: #1b6e35;
        font-weight: 700;
        white-space: nowrap;
    }

    .cart-index .vstack {
        gap: 8px !important;
    }

    .cart-item-row {
        border-radius: 14px !important;
        border: 1px solid #edf0f3 !important;
        box-shadow: 0 2px 8px rgba(15, 23, 42, .07) !important;
    }

    .cart-item-row .card-body {
        padding: 10px !important;
    }

    .cart-item-row .card-body > .d-flex {
        gap: 12px !important;
    }

    .cart-item-row .flex-shrink-0 {
        width: 92px !important;
        height: 92px !important;
        border-radius: 12px !important;
    }

    .rm-cart-product-name {
        color: #101b3d;
        font-size: 16px;
        line-height: 1.18;
        overflow-wrap: anywhere;
    }

    .rm-cart-unit-price {
        font-size: 16px;
        margin-top: 5px;
    }

    .rm-cart-desktop-subtotal {
        display: none;
    }

    .rm-cart-quantity-form {
        width: auto;
    }

    .rm-cart-quantity {
        width: 104px !important;
        border: 1px solid #d5dbe2;
        border-radius: 10px;
        overflow: hidden;
    }

    .rm-cart-quantity .btn,
    .rm-cart-quantity .form-control {
        border: 0;
        background: #fff;
        min-width: 34px;
        padding-left: 6px;
        padding-right: 6px;
    }

    .rm-cart-remove {
        color: #f02d35 !important;
        font-weight: 600;
        white-space: nowrap;
    }

    .cart-index .col-md-4 > .card {
        border-radius: 14px !important;
        border: 1px solid #ccebd3 !important;
        box-shadow: none !important;
        margin-top: 12px;
    }

    .cart-index .col-md-4 > .card .card-body {
        padding: 12px !important;
    }
}

.rm-featured-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 2px 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.rm-featured-scroll::-webkit-scrollbar {
    display: none;
}

/* On mouse/trackpad devices a fully-hidden scrollbar gives no hint the strip
   scrolls horizontally — show a slim one once there's room for a cursor. */
@media (min-width: 768px) {
    .rm-featured-scroll {
        scrollbar-width: thin;
        padding-bottom: 14px;
    }

    .rm-featured-scroll::-webkit-scrollbar {
        display: block;
        height: 6px;
    }

    .rm-featured-scroll::-webkit-scrollbar-thumb {
        background: #d8dde3;
        border-radius: 999px;
    }

    .rm-featured-scroll::-webkit-scrollbar-thumb:hover {
        background: #b9c0c9;
    }
}

/* Continuously auto-scrolling strips (e.g. the low-visibility discovery strip)
   nudge scrollLeft via JS — mandatory scroll-snap fights that, so it's disabled
   for this variant only. The cards/markup are otherwise identical. */
.rm-auto-scroll-strip .rm-featured-scroll {
    scroll-snap-type: none;
}

.rm-featured-card-wrap {
    flex: 0 0 110px;
    scroll-snap-align: start;
}

.rm-home-product-card {
    border-radius: 14px !important;
    border-color: #eceff3 !important;
    overflow: hidden;
}

.rm-home-product-img {
    position: relative;
    height: 84px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.rm-home-product-img > a {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    overflow: hidden;
}

.rm-home-product-img .rm-product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rm-home-product-placeholder {
    font-size: 22px;
}

.rm-home-product-body {
    padding: 8px;
    min-height: 78px;
}

.rm-home-product-name {
    font-size: 11px;
    line-height: 1.25;
    margin-bottom: 6px;
    color: #1a1a1a;
}

.rm-home-product-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}

.rm-home-product-price {
    font-size: 12px;
}

.rm-home-add-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 16px !important;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

/* Featured Today renders on every screen size, not just mobile — the 110px
   card was sized for a phone-width scroll strip and looks cramped once
   there's real desktop width to use. */
@media (min-width: 768px) {
    .rm-featured-card-wrap {
        flex: 0 0 170px;
    }

    .rm-home-product-img {
        height: 130px;
    }

    .rm-home-product-img > a {
        height: 130px;
    }

    .rm-home-product-name {
        font-size: 13px;
    }

    .rm-home-product-price {
        font-size: 14px;
    }
}

/* Homepage categories remain one full-width row per category on desktop too. */
#rm-category-strip .rm-category-scroll {
    display: flex;
    flex-direction: column;
    gap: 7px;
    overflow: visible;
    padding: 0;
}

#rm-category-strip .rm-category-card {
    flex: 0 0 auto;
    min-height: 62px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 7px 14px 7px 9px;
    text-align: left;
    border: 1px solid #edf0f3;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .07);
}

#rm-category-strip .rm-category-card__img {
    flex: 0 0 76px;
    width: 76px;
    height: 48px;
    margin: 0;
    border: 0;
    border-radius: 11px;
    background: #f5f7f8;
}

#rm-category-strip .rm-category-card__label {
    flex: 1;
    font-size: 16px;
    font-weight: 700;
    color: #17213a;
}

#rm-category-strip .rm-category-card__arrow {
    display: block;
    color: #17213a;
    font-size: 32px;
    font-weight: 300;
    line-height: 1;
}

#rm-category-strip .rm-category-card.active {
    border-color: #b8e3c4;
    background: #f3fbf5;
}

.rm-merch-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 2;
}

.rm-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #fff;
}

.rm-badge-offer {
    background: #28a745;
}

.rm-badge-value {
    background: #17a2b8;
}

.rm-badge-new {
    background: #dc3545;
}

.rm-badge-trending {
    background: #fd7e14;
}

.rm-badge-clearance {
    background: #6f42c1;
}

.rm-badge-limited-offer {
    background: #b02a37;
}

.rm-badge-discount {
    background: #e63946;
}

.rm-original-price {
    font-size: 11px;
    color: #9aa0a6;
    text-decoration: line-through;
}

.rm-wishlist-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #9ca3af;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

@media (max-width: 767.98px) {
    .main-header .container {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .main-header-top {
        width: 100%;
        flex-wrap: wrap;
        gap: 10px;
    }

    .main-header-top .logo {
        flex: 1 1 auto;
    }

    .main-header-top .search-bar {
        order: 3;
        flex: 1 1 100%;
        min-width: 0;
        margin: 0;
    }

    .main-header-top .search-bar input {
        width: 100%;
        padding: 12px 44px 12px 16px;
        border: 1px solid #e5e7eb;
        border-radius: 999px;
        background: #f9fafb;
        font-size: 14px;
    }

    .main-header-top .search-bar button {
        right: 6px;
        padding: 8px 14px;
        border-radius: 999px;
    }

    .header-actions {
        margin-left: auto;
        gap: 10px;
        flex-shrink: 0;
    }

    .account-info > div {
        display: none;
    }

    .cart-summary--pill > div {
        display: none !important;
    }

    .cart-summary--pill {
        padding: 0;
        border: none;
        background: transparent;
    }

    .section-header h2 {
        font-size: 1.15rem !important;
    }
}

.rm-splash {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: opacity 0.4s ease;
}

.rm-splash-hide {
    opacity: 0;
    pointer-events: none;
}

.rm-splash-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-bottom: 110px;
    padding: 0 24px;
}

.rm-splash-logo {
    width: 220px;
    max-width: 62vw;
    height: auto;
}

.rm-splash-tagline {
    font-size: 15px;
    font-weight: 600;
    color: #198754;
    letter-spacing: 0.3px;
    text-align: center;
}

.rm-splash-spinner {
    width: 26px;
    height: 26px;
    border: 3px solid #d7ecdf;
    border-top-color: #198754;
    border-radius: 50%;
    margin-top: 6px;
    animation: rm-splash-spin 0.8s linear infinite;
}

@keyframes rm-splash-spin {
    to {
        transform: rotate(360deg);
    }
}

.rm-splash-wave {
    position: absolute;
    left: -15%;
    right: -15%;
    bottom: 0;
    height: 130px;
    background: #198754;
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 24px;
}

.rm-splash-basket {
    font-size: 34px;
    color: #ffffff;
}
