/* ==================== MINI CART DRAWER ==================== */
.cart-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9997;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.cart-drawer-overlay.open {
    opacity: 1;
    visibility: visible;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 420px;
    max-width: 92vw;
    background: #fff;
    z-index: 9998;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}
.cart-drawer.open {
    transform: translateX(0);
}

.cart-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 22px;
    border-bottom: 1px solid var(--color-gray-200, #e5e7eb);
    flex-shrink: 0;
}
.cart-drawer-header h3 {
    font-size: 1.1rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cart-drawer-header button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-gray-50, #f9fafb);
    color: var(--color-gray-500, #6b7280);
    font-size: 1rem;
    transition: background 0.15s ease;
}
.cart-drawer-header button:hover {
    background: var(--color-gray-100, #f3f4f6);
}

.cart-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
}

.cart-drawer-loading {
    text-align: center;
    padding: 60px 0;
    color: var(--color-gray-400, #9ca3af);
    font-size: 1.5rem;
}

.cart-drawer-empty {
    text-align: center;
    padding: 60px 10px;
    margin: auto 0;
}
.cart-drawer-empty i {
    font-size: 48px;
    color: var(--color-gray-300, #d1d5db);
    margin-bottom: 14px;
}
.cart-drawer-empty p {
    font-weight: 600;
    margin-bottom: 18px;
    color: var(--color-gray-600, #4b5563);
}

.cart-drawer-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.cart-drawer-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-gray-100, #f3f4f6);
}
.cart-drawer-item img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}
.cart-drawer-item-info {
    flex: 1;
    min-width: 0;
}
.cart-drawer-item-info h5 {
    font-size: 0.9rem;
    margin: 0 0 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cart-drawer-item-price {
    font-size: 0.8rem;
    color: var(--color-gray-500, #6b7280);
    display: block;
    margin-bottom: 8px;
}
.cart-drawer-item-total {
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.cart-drawer-qty {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--color-gray-200, #e5e7eb);
    border-radius: 8px;
    overflow: hidden;
}
.cart-drawer-qty button {
    width: 28px;
    height: 28px;
    background: var(--color-gray-50, #f9fafb);
    font-size: 0.85rem;
    color: var(--color-gray-700, #374151);
}
.cart-drawer-qty button:hover {
    background: var(--color-gray-100, #f3f4f6);
}
.cart-drawer-qty-value {
    width: 30px;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
}
.cart-drawer-qty .js-drawer-remove {
    margin-left: 8px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    color: var(--color-danger, #dc2626);
    background: var(--color-danger-light, #fee2e2);
    border: none;
}

.cart-drawer-footer {
    border-top: 1px solid var(--color-gray-200, #e5e7eb);
    padding: 16px 22px 22px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cart-drawer-subtotal {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 6px;
}

/* ==================== STICKY BOTTOM CART BAR (rounded floating pill) ==================== */
.cart-sticky-wrap {
    position: fixed;
    bottom: 22px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    z-index: 9996;
    pointer-events: none;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.cart-sticky-wrap.show {
    transform: translateY(0);
    opacity: 1;
}
.cart-sticky-pill {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--brand-green, #16a34a);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-full, 999px);
    padding: 12px 22px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    font-weight: 700;
    font-size: 0.95rem;
    max-width: 92vw;
}
.cart-sticky-pill:hover {
    background: var(--brand-green-hover, #15803d);
}
.cart-sticky-count-badge {
    background: #ffffff;
    color: var(--brand-green, #16a34a);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.cart-sticky-label {
    white-space: nowrap;
}
.cart-sticky-amount {
    white-space: nowrap;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.35);
}
@media (max-width: 480px) {
    .cart-sticky-wrap {
        bottom: 14px;
    }
    .cart-sticky-pill {
        padding: 10px 16px;
        gap: 8px;
        font-size: 0.85rem;
    }
    .cart-sticky-amount {
        padding-left: 8px;
    }
}

/* NOTE: the old .cart-qty-inline / .cart-qty-remove / .cart-qty-plus / .cart-qty-value
   classes used to live here. That design (full-width Add to Cart button below the
   product info) was replaced by the floating "+" FAB button + pill stepper that sits
   on the product image itself — see .cart-fab-btn / .cart-fab-stepper in styles.css. */

/* Leave room at the bottom of the page when the sticky bar is visible, so it
   does not cover the footer / last row of content */
/*body:has(.cart-sticky-wrap.show) {*/
/*    padding-bottom: 74px;*/
/*}*/
@media (max-width: 480px) {
    body:has(.cart-sticky-wrap.show) {
        padding-bottom: 96px;
    }
}
