/* Nimbus ∆P shared cart drawer + header cart button. Loaded on every page. */

/* Header cart button */
.cart-btn {
    position: relative;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 8px;
    background: #fff;
    color: #111827;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.cart-btn:hover { background: #f9fafb; border-color: rgba(0,0,0,0.24); }
.cart-btn svg { width: 20px; height: 20px; }
.cart-count {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: #B5886A;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 19px;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
}

/* Overlay */
.cart-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(15,23,42,0.42);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.cart-overlay.visible { opacity: 1; }

/* Drawer */
.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 310;
    width: min(420px, 92vw);
    background: #fff;
    box-shadow: -16px 0 48px rgba(0,0,0,0.18);
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.16,1,0.3,1);
    display: flex;
    flex-direction: column;
}
.cart-drawer.open { transform: none; }

.cart-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}
.cart-drawer-title { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; margin: 0; color: #111827; }
.cart-close {
    width: 36px; height: 36px;
    border: none; background: transparent;
    font-size: 18px; color: #6B7280; cursor: pointer; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
}
.cart-close:hover { background: #f3f4f6; color: #111827; }

.cart-lines { flex: 1; overflow-y: auto; padding: 16px 24px; display: flex; flex-direction: column; gap: 18px; }
.cart-empty { font-size: 14px; color: #6B7280; margin: 8px 0 18px; }

.cart-line { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: start; }
.cart-line-img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: #f3f4f6; }
.cart-line-name { font-size: 15px; font-weight: 700; color: #111827; }
.cart-line-name:hover { text-decoration: underline; text-underline-offset: 2px; }
.cart-line-unit { font-size: 12px; color: #9CA3AF; margin: 2px 0 8px; }
.cart-qty { display: inline-flex; align-items: center; gap: 6px; }
.cart-qty-btn {
    width: 28px; height: 28px; border-radius: 6px; border: 1px solid rgba(0,0,0,0.14);
    background: #fff; cursor: pointer; font-size: 15px; color: #374151; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
}
.cart-qty-btn:hover { background: #f3f4f6; }
.cart-qty-val { min-width: 24px; text-align: center; font-size: 14px; font-weight: 600; color: #111827; }
.cart-line-right { text-align: right; }
.cart-line-total { font-size: 15px; font-weight: 700; color: #111827; }
.cart-line-remove {
    margin-top: 8px; font-size: 12px; color: #9CA3AF; background: none; border: none;
    cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.cart-line-remove:hover { color: #374151; }

.cart-foot { border-top: 1px solid rgba(0,0,0,0.08); padding: 18px 24px 22px; }
.cart-subtotal-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.cart-subtotal-row span:first-child { font-size: 14px; color: #4B5563; }
.cart-subtotal-row span:last-child { font-size: 22px; font-weight: 900; letter-spacing: -0.02em; color: #111827; }
.cart-fineprint { font-size: 12px; color: #9CA3AF; line-height: 1.5; margin: 0 0 14px; }
.cart-checkout { font-size: 15px; }
.cart-checkout:disabled { opacity: 0.45; cursor: not-allowed; }

@media (max-width: 480px) {
    .cart-drawer-head, .cart-lines, .cart-foot { padding-left: 18px; padding-right: 18px; }
}
