/* Cart ordering page: compact reference UI */
:root {
    --ry-primary: #3975f6;
    --ry-primary-dark: #2e63df;
    --ry-primary-light: #6d9bff;
    --ry-primary-soft: #edf3ff;
    --ry-primary-softer: #f5f8ff;
    --ry-bg: #f3f7fd;
    --ry-card: #ffffff;
    --ry-text: #102e5c;
    --ry-text-2: #5d759d;
    --ry-text-3: #8ea4c5;
    --ry-border: #dbe7f6;
    --ry-border-soft: #edf3fb;
    --ry-radius: 14px;
    --ry-radius-sm: 9px;
    --ry-radius-lg: 18px;
    --ry-shadow: 0 10px 28px rgba(48, 88, 145, .07);
    --ry-shadow-hover: 0 12px 28px rgba(50, 105, 220, .14);
}

html,
body {
    background: var(--ry-bg);
    color: var(--ry-text);
}

body {
    min-width: 320px;
}

/* The shared client-area shell already renders its own cart title and breadcrumb. */
body .page-title-box {
    display: none !important;
}

/* The cart reference layout is a standalone ordering workspace. */
body #page-topbar {
    display: none !important;
}

body .main-content {
    margin-left: 0 !important;
    padding-top: 0 !important;
}

body .page-content {
    padding-top: 18px !important;
}

/* The shared dashboard stylesheet has a more specific shell offset. */
body:has(.ry-page-heading) .main-content {
    margin-left: var(--yc-side-width, 200px) !important;
    padding-top: 0 !important;
    width: calc(100% - var(--yc-side-width, 200px)) !important;
    max-width: none !important;
}

body:has(.ry-page-heading) .page-content {
    padding-top: 18px !important;
    width: 100% !important;
    max-width: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

body:has(.ry-page-heading) .page-content > .container-fluid,
body:has(.ry-page-heading) .page-content > .container,
body:has(.ry-page-heading) .main-content > .container-fluid {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.ry-mobile-menu-toggle,
.ry-mobile-sidebar-backdrop {
    display: none;
}

/* Keep the shared navigation rail available for login, registration and page
 * switching. On small screens it becomes an on-demand drawer. */
@media (min-width: 769px) {
    body:has(.ry-page-heading) .vertical-menu {
        display: block !important;
        visibility: visible !important;
    }
}

@media (max-width: 768px) {
    body:has(.ry-page-heading) .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    body:has(.ry-page-heading) .page-content {
        padding-top: 12px !important;
    }

    /* The intro is useful on desktop but spends the first mobile viewport. */
    body:has(.ry-page-heading) .ry-guide__intro {
        display: none !important;
    }

    body:has(.ry-page-heading) .ry-guide {
        display: none !important;
    }

    body:has(.ry-page-heading) .vertical-menu {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        position: fixed !important;
        z-index: 1200 !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        width: min(286px, calc(100vw - 44px)) !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 18px 18px 0 !important;
        transform: translateX(-105%) !important;
        transition: transform .24s ease, visibility .24s ease !important;
        box-shadow: 18px 0 42px rgba(31, 49, 86, .16) !important;
    }

    body:has(.ry-page-heading) #sidebar-menu {
        padding-right: 12px !important;
        padding-left: 12px !important;
    }

    body:has(.ry-page-heading) #sidebar-menu #side-menu > li > a {
        width: auto !important;
        justify-content: flex-start !important;
        padding: 0 12px 0 8px !important;
    }

    body:has(.ry-page-heading) #sidebar-menu #side-menu > li > a > i {
        margin-right: 12px !important;
    }

    body:has(.ry-page-heading) #sidebar-menu #side-menu > li > a > span {
        display: block !important;
    }

    body:has(.ry-page-heading).sidebar-enable .vertical-menu {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        transform: translateX(0) !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    body:has(.ry-page-heading).sidebar-enable {
        overflow: hidden;
    }

    body:has(.ry-page-heading) .ry-mobile-sidebar-backdrop {
        display: block;
        position: fixed;
        z-index: 1190;
        inset: 0;
        visibility: hidden;
        opacity: 0;
        background: rgba(16, 34, 66, .28);
        pointer-events: none;
        transition: opacity .24s ease, visibility .24s ease;
    }

    body:has(.ry-page-heading).sidebar-enable .ry-mobile-sidebar-backdrop {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
    }

    body:has(.ry-page-heading) .ry-mobile-menu-toggle {
        position: fixed;
        right: 18px;
        bottom: calc(18px + env(safe-area-inset-bottom));
        z-index: 1210;
        width: 52px;
        height: 52px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        border: 1px solid rgba(255, 255, 255, .8);
        border-radius: 16px;
        color: #fff;
        background: linear-gradient(145deg, #3975f6 0%, #596ff9 58%, #6f72ff 100%);
        box-shadow: 0 14px 30px rgba(57, 117, 246, .28), 0 3px 8px rgba(31, 49, 86, .1);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
    }

    body:has(.ry-page-heading) .ry-mobile-menu-toggle::before {
        content: "";
        position: absolute;
        inset: 4px;
        border: 1px solid rgba(255, 255, 255, .2);
        border-radius: 12px;
        pointer-events: none;
    }

    body:has(.ry-page-heading) .ry-mobile-menu-toggle:focus-visible {
        outline: 3px solid rgba(57, 117, 246, .26);
        outline-offset: 3px;
    }

    body:has(.ry-page-heading) .ry-mobile-menu-toggle:active {
        transform: translateY(1px) scale(.96);
        box-shadow: 0 8px 18px rgba(57, 117, 246, .24);
    }

    body:has(.ry-page-heading) .ry-mobile-menu-icon {
        position: relative;
        z-index: 1;
        width: 21px;
        height: 18px;
        display: inline-flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: stretch;
    }

    body:has(.ry-page-heading) .ry-mobile-menu-icon i {
        display: block;
        width: 21px;
        height: 2px;
        flex: 0 0 2px;
        border-radius: 999px;
        background: currentColor;
        transform-origin: center;
        transition: transform .2s ease, opacity .16s ease, width .2s ease;
    }

    body:has(.ry-page-heading) .ry-mobile-menu-toggle:hover {
        transform: translateY(-2px);
        box-shadow: 0 17px 34px rgba(57, 117, 246, .36), 0 4px 10px rgba(31, 49, 86, .12);
    }

    body:has(.ry-page-heading).sidebar-enable .ry-mobile-menu-toggle {
        color: var(--ry-primary);
        background: #fff;
        border-color: rgba(57, 117, 246, .14);
        box-shadow: 0 12px 26px rgba(31, 49, 86, .18), 0 2px 6px rgba(31, 49, 86, .08);
    }

    body:has(.ry-page-heading).sidebar-enable .ry-mobile-menu-icon i:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    body:has(.ry-page-heading).sidebar-enable .ry-mobile-menu-icon i:nth-child(2) {
        opacity: 0;
        width: 0;
    }

    body:has(.ry-page-heading).sidebar-enable .ry-mobile-menu-icon i:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}

/* The shared dashboard shell also controls .vertical-menu on mobile. Keep
 * cart pages on an explicit state class so the drawer cannot remain invisible
 * after the cart toggle has opened it. */
@media (max-width: 768px) {
    body.ry-cart-page .ry-guide {
        display: none !important;
    }

    body.ry-cart-page .vertical-menu {
        display: block !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        position: fixed !important;
        z-index: 1200 !important;
        top: 0 !important;
        right: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        width: min(286px, calc(100vw - 44px)) !important;
        height: 100vh !important;
        max-height: 100vh !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        transform: translateX(-105%) !important;
        border-radius: 0 18px 18px 0 !important;
        transition: transform .24s ease, opacity .2s ease, visibility .24s ease !important;
        box-shadow: 18px 0 42px rgba(31, 49, 86, .16) !important;
    }

    body.ry-cart-page.yc-mobile-sidebar-open .vertical-menu,
    body.ry-cart-page.sidebar-enable .vertical-menu {
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        transform: translateX(0) !important;
    }

    body.ry-cart-page .ry-mobile-sidebar-backdrop {
        display: block !important;
        position: fixed !important;
        z-index: 1190 !important;
        inset: 0 !important;
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
    }

    body.ry-cart-page.yc-mobile-sidebar-open .ry-mobile-sidebar-backdrop,
    body.ry-cart-page.sidebar-enable .ry-mobile-sidebar-backdrop {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
    }

    body.ry-cart-page .ry-mobile-menu-toggle {
        display: inline-flex !important;
        z-index: 1210 !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    body:has(.ry-page-heading) .vertical-menu,
    body:has(.ry-page-heading) .ry-mobile-sidebar-backdrop,
    body:has(.ry-page-heading) .ry-mobile-menu-toggle,
    body:has(.ry-page-heading) .ry-mobile-menu-icon i {
        transition: none !important;
    }
}

@media (max-width: 380px) {
    body:has(.ry-page-heading) .ry-mobile-menu-toggle {
        right: 14px;
        bottom: calc(14px + env(safe-area-inset-bottom));
        width: 50px;
        height: 50px;
        border-radius: 15px;
    }
}

.ry-page-heading,
.ry-guide,
.ry-section,
.ry-region-card {
    width: min(1365px, calc(100% - 48px));
    box-sizing: border-box;
}

.ry-page-heading {
    margin: 0 auto;
    padding: 22px 0 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.ry-page-heading h1 {
    margin: 0;
    color: var(--ry-text);
    font-size: 25px;
    font-weight: 800;
    line-height: 1.2;
}

.ry-breadcrumb {
    display: flex;
    align-items: center;
    gap: 11px;
    color: #6e8cb8;
    font-size: 13px;
    white-space: nowrap;
}

.ry-breadcrumb a {
    color: #6e8cb8;
    text-decoration: none;
}

.ry-breadcrumb a:hover {
    color: var(--ry-primary);
}

.ry-breadcrumb span:nth-child(2) {
    color: #adc0da;
}

.ry-guide {
    min-height: 90px;
    margin: 0 auto 25px;
    padding: 13px 15px;
    display: grid;
    grid-template-columns: 185px repeat(4, minmax(0, 1fr)) 95px;
    align-items: stretch;
    gap: 9px;
    background: #fff;
    border: 1px solid var(--ry-border);
    border-radius: 16px;
    box-shadow: var(--ry-shadow);
}

.ry-guide__intro {
    min-width: 0;
    padding: 11px 0 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ry-guide__intro strong {
    color: var(--ry-text);
    font-size: 15px;
    line-height: 1.45;
    white-space: nowrap;
}

.ry-guide__intro span {
    margin-top: 4px;
    color: var(--ry-text-3);
    font-size: 12px;
    line-height: 1.45;
    white-space: nowrap;
}

.ry-guide__item,
.ry-guide__all {
    min-width: 0;
    border: 1px solid var(--ry-border);
    border-radius: 10px;
    text-decoration: none;
    transition: border-color .2s ease, background-color .2s ease, transform .2s ease;
}

.ry-guide__item {
    display: grid;
    grid-template-columns: 35px minmax(0, 1fr) 15px;
    align-items: center;
    gap: 9px;
    padding: 10px 10px 10px 12px;
}

.ry-guide__item:hover {
    background: #f8fbff;
    border-color: #b9d0f6;
    transform: translateY(-1px);
}

.ry-guide__icon {
    width: 35px;
    height: 35px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    color: var(--ry-primary);
    background: #edf3ff;
    font-size: 14px;
}

.ry-guide__item b,
.ry-guide__item small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ry-guide__item b {
    color: var(--ry-text);
    font-size: 13px;
    line-height: 1.5;
}

.ry-guide__item small {
    margin-top: 1px;
    color: var(--ry-text-3);
    font-size: 11px;
    line-height: 1.4;
}

.ry-guide__item em {
    color: #7298dc;
    font-size: 15px;
    font-style: normal;
    text-align: center;
}

.ry-guide__all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--ry-primary);
    font-size: 12px;
    white-space: nowrap;
}

.ry-guide__all:hover {
    background: #f5f8ff;
    border-color: #b9d0f6;
}

.ry-section,
.ry-region-card {
    max-width: 1365px;
    padding: 0;
    margin-left: auto;
    margin-right: auto;
}

.ry-section {
    margin-bottom: 27px;
}

/* The legacy hero stylesheet offsets this section upward. The ordering page
 * has no hero, so the category block must stay in normal document flow. */
body:has(.ry-page-heading) .ry-section#categories {
    position: static !important;
    z-index: auto !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.ry-section__head {
    margin-bottom: 13px;
    gap: 12px;
    align-items: flex-end;
}

.ry-section__title {
    position: relative;
    padding-left: 12px;
    margin: 0 0 3px;
    color: var(--ry-text);
    font-size: 20px;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: 0;
}

.ry-section__title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 3px;
    width: 4px;
    height: 20px;
    border-radius: 2px;
    background: var(--ry-primary);
}

.ry-section__title-icon {
    display: none;
}

.ry-section__subtitle {
    padding-left: 0;
    color: var(--ry-text-3);
    font-size: 13px;
    line-height: 1.45;
}

.ry-cat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.ry-cat-card {
    min-height: 72px;
    box-sizing: border-box;
    padding: 15px;
    gap: 12px;
    border-radius: 14px;
    border-color: var(--ry-border);
    box-shadow: none;
}

.ry-cat-card::before {
    display: none;
}

.ry-cat-card:hover,
.ry-cat-card.is-active {
    transform: none;
    border-color: #5a83ff;
    box-shadow: 0 6px 18px rgba(54, 105, 224, .1);
    background: #f9fbff;
}

.ry-cat-card__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #edf3ff;
    color: var(--ry-primary);
    font-size: 17px;
}

.ry-cat-card:hover .ry-cat-card__icon {
    background: #edf3ff;
    color: var(--ry-primary);
    transform: none;
}

.ry-cat-card__icon img {
    width: 21px;
    height: 21px;
    object-fit: contain;
}

.ry-cat-card__name {
    margin-bottom: 2px;
    color: var(--ry-text);
    font-size: 14px;
    line-height: 1.4;
}

.ry-cat-card__desc {
    color: var(--ry-text-3);
    font-size: 12px;
    line-height: 1.4;
}

.ry-region-card {
    margin-bottom: 25px;
}

.ry-region-card .ry-section {
    width: 100%;
    margin-bottom: 0;
    padding: 0;
}

.ry-region-card .ry-section__head {
    margin-bottom: 13px;
}

.ry-tabs-wrap,
.ry-region-card .ry-tabs-wrap {
    margin: 0;
    padding: 13px 14px;
    gap: 7px;
    flex-wrap: nowrap;
    overflow-x: auto;
    border-radius: 16px;
    border-color: var(--ry-border);
    box-shadow: var(--ry-shadow);
    scrollbar-width: thin;
}

.ry-tab {
    padding: 9px 14px;
    border-radius: 9px;
    color: #4f6d9c;
    font-size: 13px;
    line-height: 1.2;
}

.ry-tab:hover {
    background: #f1f5ff;
    color: var(--ry-primary);
}

.ry-tab.is-active {
    background: var(--ry-primary);
    box-shadow: 0 5px 12px rgba(57, 117, 246, .2);
}

.ry-group-banner {
    margin: 0 0 25px;
}

.ry-group-banner__card {
    padding: 18px 22px;
    gap: 18px;
    border-radius: 14px;
    box-shadow: var(--ry-shadow);
}

.ry-group-banner__icon {
    flex-basis: 74px;
    width: 74px;
    height: 74px;
    font-size: 0;
}

.ry-group-banner__icon img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.ry-group-banner__title {
    margin-bottom: 9px;
    font-size: 20px;
    letter-spacing: 0;
}

.ry-products-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 35px;
    margin: 0 0 13px;
}

.ry-products-heading > div {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.ry-products-heading__title {
    position: relative;
    margin: 0;
    padding-left: 12px;
    color: var(--ry-text);
    font-size: 20px;
    font-weight: 800;
    line-height: 1.35;
}

.ry-products-heading__title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 3px;
    width: 4px;
    height: 20px;
    border-radius: 2px;
    background: var(--ry-primary);
}

.ry-products-heading__count {
    color: #7a98c1;
    font-size: 13px;
}

.ry-product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 26px;
}

.ry-product-card {
    min-height: 345px;
    border-radius: 16px;
    border-color: var(--ry-border);
    box-shadow: var(--ry-shadow);
}

.ry-product-card:hover {
    transform: translateY(-2px);
    border-color: #a9c6f6;
    box-shadow: var(--ry-shadow-hover);
}

.ry-product-card__head {
    min-height: 57px;
    padding: 16px 18px 11px;
    border-bottom-color: var(--ry-border-soft);
}

.ry-product-card__title {
    color: var(--ry-text);
    font-size: 15px;
    line-height: 1.45;
}

.ry-product-card__body {
    padding: 17px 18px 11px;
}

.ry-product-card__price {
    margin-bottom: 12px;
    gap: 3px;
}

.ry-product-card__price-currency {
    color: var(--ry-primary);
    font-size: 13px;
}

.ry-product-card__price-num {
    color: var(--ry-primary);
    font-size: 32px;
    letter-spacing: 0;
}

.ry-product-card__price-cycle {
    color: #6e8dba;
    font-size: 12px;
}

.ry-product-card__price-original {
    color: #9aacca;
    font-size: 12px;
}

.ry-spec-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
}

.ry-spec-item {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    color: #6e89b2;
    font-size: 12px;
    line-height: 1.35;
}

.ry-spec-icon {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: #edf3ff;
    color: var(--ry-primary);
    font-size: 11px;
}

.ry-spec-icon::before {
    content: '';
    display: none;
}

.ry-spec-icon i {
    position: relative;
    z-index: 1;
}

.ry-spec-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ry-spec-key {
    color: #7390b9;
}

.ry-spec-value {
    margin-left: 4px;
    color: var(--ry-text);
    font-weight: 700;
}

.ry-product-card__config {
    gap: 9px 14px;
}

.ry-product-card__config-item {
    gap: 6px;
    color: #7390b9;
    font-size: 12px;
}

.ry-product-card__config-item i {
    color: var(--ry-primary);
}

.ry-product-card__config-item b {
    color: var(--ry-text);
}

.ry-product-card__stock {
    padding: 5px 8px;
    border-radius: 7px;
    font-size: 11px;
}

.ry-product-card__tags {
    margin-top: 12px;
}

.ry-badge {
    padding: 4px 7px;
    border-radius: 6px;
    font-size: 11px;
}

.ry-product-card__foot {
    margin-top: auto;
    padding: 7px 18px 17px;
}

.ry-product-card__buy {
    min-height: 42px;
    box-sizing: border-box;
    padding: 12px;
    border-radius: 10px;
    background: var(--ry-primary);
    font-size: 13px;
}

.ry-product-card__buy:hover {
    background: var(--ry-primary-dark);
    box-shadow: 0 6px 15px rgba(57, 117, 246, .25);
}

.ry-pagination {
    margin: 10px 0 28px;
}

.ry-empty {
    padding: 48px 16px;
    border: 1px solid var(--ry-border);
    border-radius: 14px;
    background: #fff;
}

@media (max-width: 1120px) {
    .ry-guide {
        grid-template-columns: 170px repeat(2, minmax(0, 1fr));
    }

    .ry-guide__all {
        min-height: 42px;
    }
}

@media (max-width: 900px) {
    .ry-cat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ry-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ry-guide {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ry-guide__intro {
        grid-column: 1 / -1;
        min-height: 50px;
        padding: 3px 5px;
    }
}

@media (max-width: 640px) {
    .ry-page-heading,
    .ry-guide,
    .ry-section,
    .ry-region-card {
        width: calc(100% - 28px);
    }

    .ry-page-heading {
        padding: 17px 0 13px;
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .ry-page-heading h1 {
        font-size: 22px;
    }

    .ry-guide {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 13px;
    }

    .ry-guide__intro {
        grid-column: auto;
        min-height: 0;
    }

    .ry-guide__item {
        min-height: 58px;
    }

    .ry-guide__all {
        min-height: 42px;
    }

    .ry-section,
    .ry-region-card {
        margin-bottom: 22px;
    }

    .ry-section__title,
    .ry-products-heading__title {
        font-size: 18px;
    }

    .ry-cat-grid,
    .ry-product-grid {
        grid-template-columns: 1fr;
    }

    .ry-cat-card {
        min-height: 68px;
    }

    .ry-tabs-wrap,
    .ry-region-card .ry-tabs-wrap {
        margin-right: 0;
        padding: 10px;
    }

    .ry-product-card {
        min-height: 0;
    }

    .ry-group-banner__card {
        flex-direction: row;
        align-items: center;
        padding: 14px;
    }

    .ry-group-banner__icon {
        flex-basis: 56px;
        width: 56px;
        height: 56px;
    }

    .ry-group-banner__title {
        font-size: 17px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ry-cat-card,
    .ry-product-card,
    .ry-guide__item {
        transition: none;
    }
}
