/* =========================================================
   RBT — PREMIUM CART DRAWER
========================================================= */

.rcd-drawer,
.rcd-drawer * {
    box-sizing: border-box;
}

.rcd-drawer {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    visibility: hidden;
    pointer-events: none;
}

.rcd-drawer.active {
    visibility: visible;
    pointer-events: auto;
}

/* Overlay */
.rcd-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(2, 11, 26, 0.72);
    opacity: 0;
    cursor: pointer;
    transition: opacity 0.28s ease;
}

.rcd-drawer.active .rcd-overlay {
    opacity: 1;
}

/* Panel */
.rcd-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    width: min(100%, 430px);
    overflow: hidden;
    background: var(--rbt-header-paper, #f4f0e8);
    box-shadow: -18px 0 55px rgba(2, 11, 26, 0.22);
    transform: translateX(100%);
    transition: transform 0.32s ease;
}

.rcd-drawer.active .rcd-panel {
    transform: translateX(0);
}

/* Header */
.rcd-header {
    display: flex;
    min-height: 64px;
    padding: 0 22px;
    align-items: center;
    justify-content: space-between;
    background: var(--rbt-header-ink, #061225);
    color: #ffffff;
}

.rcd-header h2 {
    margin: 0;
    color: inherit;
    font-family: "DM Mono", monospace;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.17em;
}

.rcd-close {
    display: grid;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 50%;
    background: transparent;
    color: #ffffff;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s ease;
}

.rcd-close:hover {
    border-color: var(--rbt-header-blue, #1262b7);
    background: var(--rbt-header-blue, #1262b7);
    transform: rotate(90deg);
}

/* Body */
.rcd-body {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    background: var(--rbt-header-paper, #f4f0e8);
}

.rcd-body::-webkit-scrollbar {
    width: 5px;
}

.rcd-body::-webkit-scrollbar-thumb {
    background: rgba(6, 18, 37, 0.25);
}

/* Empty cart */
.rcd-empty {
    display: flex;
    min-height: 360px;
    padding: 55px 30px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.rcd-empty-icon {
    display: grid;
    width: 78px;
    height: 78px;
    margin-bottom: 22px;
    place-items: center;
    border: 1px solid rgba(6, 18, 37, 0.14);
    border-radius: 50%;
    background: #ffffff;
    color: var(--rbt-header-blue, #1262b7);
    font-size: 31px;
}

.rcd-empty p {
    margin: 0 0 25px;
    color: var(--rbt-header-muted, #748093);
    font-size: 14px;
}

.rcd-empty-button {
    display: inline-flex;
    min-height: 47px;
    padding: 0 22px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--rbt-header-blue, #1262b7);
    background: var(--rbt-header-blue, #1262b7);
    color: #ffffff;
    font-family: "DM Mono", monospace;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-decoration: none;
    transition: 0.2s ease;
}

.rcd-empty-button:hover {
    border-color: var(--rbt-header-ink, #061225);
    background: var(--rbt-header-ink, #061225);
    color: #ffffff;
    transform: translateY(-2px);
}

/* Cart items */
.rcd-item {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 14px;
    padding: 17px 20px;
    border-bottom: 1px solid rgba(6, 18, 37, 0.12);
    background: transparent;
}

.rcd-item-image {
    display: block;
    width: 82px;
    height: 104px;
    overflow: hidden;
    background: #ffffff;
}

.rcd-item-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rcd-item-content {
    min-width: 0;
}

.rcd-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.rcd-item-name {
    display: -webkit-box;
    overflow: hidden;
    color: var(--rbt-header-ink, #061225);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.45;
    text-decoration: none;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    transition: color 0.2s ease;
}

.rcd-item-name:hover {
    color: var(--rbt-header-blue, #1262b7);
}

.rcd-remove {
    display: grid;
    width: 27px;
    height: 27px;
    flex: 0 0 27px;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(6, 18, 37, 0.12);
    border-radius: 50%;
    background: #ffffff;
    color: var(--rbt-header-muted, #748093);
    font-size: 11px;
    cursor: pointer;
    transition: 0.2s ease;
}

.rcd-remove:hover {
    border-color: #b42318;
    background: #b42318;
    color: #ffffff;
}

.rcd-item-options {
    display: flex;
    margin-top: 9px;
    flex-wrap: wrap;
    gap: 6px;
}

.rcd-item-options span {
    padding: 4px 6px;
    border: 1px solid rgba(6, 18, 37, 0.11);
    background: rgba(255, 255, 255, 0.58);
    color: var(--rbt-header-muted, #748093);
    font-size: 9px;
}

.rcd-item-options strong {
    color: var(--rbt-header-ink, #061225);
    font-weight: 700;
}

.rcd-item-bottom {
    display: flex;
    margin-top: 13px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.rcd-item-quantity {
    color: var(--rbt-header-muted, #748093);
    font-family: "DM Mono", monospace;
    font-size: 10px;
}

.rcd-item-total {
    color: var(--rbt-header-blue, #1262b7);
    font-family: "DM Mono", monospace;
    font-size: 12px;
    font-weight: 700;
}

/* Footer */
.rcd-footer {
    padding: 18px 20px 20px;
    border-top: 1px solid rgba(6, 18, 37, 0.14);
    background: #ffffff;
}

.rcd-summary {
    display: flex;
    margin-bottom: 15px;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.rcd-summary span {
    color: var(--rbt-header-muted, #748093);
    font-family: "DM Mono", monospace;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.11em;
}

.rcd-summary strong {
    color: var(--rbt-header-ink, #061225);
    font-family: "DM Mono", monospace;
    font-size: 17px;
    font-weight: 700;
}

.rcd-footer-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}

.rcd-view-cart,
.rcd-checkout {
    display: flex;
    min-height: 46px;
    padding: 0 10px;
    align-items: center;
    justify-content: center;
    font-family: "DM Mono", monospace;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.11em;
    text-decoration: none;
    transition: 0.2s ease;
}

.rcd-view-cart {
    border: 1px solid var(--rbt-header-ink, #061225);
    background: #ffffff;
    color: var(--rbt-header-ink, #061225);
}

.rcd-view-cart:hover {
    background: var(--rbt-header-ink, #061225);
    color: #ffffff;
}

.rcd-checkout {
    border: 1px solid var(--rbt-header-blue, #1262b7);
    background: var(--rbt-header-blue, #1262b7);
    color: #ffffff;
}

.rcd-checkout:hover {
    border-color: var(--rbt-header-ink, #061225);
    background: var(--rbt-header-ink, #061225);
    color: #ffffff;
}

/* Mobile */
@media (max-width: 575px) {
    .rcd-panel {
        width: calc(100% - 12px);
        max-width: 390px;
    }

    .rcd-header {
        min-height: 58px;
        padding: 0 17px;
    }

    .rcd-header h2 {
        font-size: 11px;
    }

    .rcd-item {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 12px;
        padding: 14px;
    }

    .rcd-item-image {
        width: 72px;
        height: 92px;
    }

    .rcd-item-name {
        font-size: 11px;
    }

    .rcd-footer {
        padding: 15px;
    }

    .rcd-footer-actions {
        gap: 7px;
    }

    .rcd-view-cart,
    .rcd-checkout {
        min-height: 44px;
        font-size: 8px;
    }
}
