/* ============================================
   Shared Cart / Toast / Checkout Overlay Styles
   ============================================ */

/* ---------- Cart Backdrop ---------- */
.cart-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s;
}
.cart-backdrop.open { opacity: 1; pointer-events: all; }

/* ---------- Cart Panel (slide-in drawer) ---------- */
.cart-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(420px, 100%);
    background: var(--bg-elevated, #121214);
    border-left: 1px solid var(--border, rgba(255,255,255,0.08));
    z-index: 2001;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.cart-panel.open { transform: translateX(0); }

.cart-head {
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.cart-head h3 {
    font-family: var(--font-display, Georgia, serif);
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0;
}

.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.75rem;
}

.cart-empty {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--dim, rgba(244,242,239,0.32));
    text-align: center;
}

/* ---------- Cart Item ---------- */
.cart-item {
    display: grid;
    grid-template-columns: 52px 1fr auto;
    gap: 0.875rem;
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
    align-items: center;
}
.cart-thumb {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    background: var(--surface, rgba(255,255,255,0.04));
    overflow: hidden;
    flex-shrink: 0;
}
.cart-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.cart-item-details {
    min-width: 0;
}
.cart-item-name {
    font-family: var(--font-display, Georgia, serif);
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cart-item-qty {
    font-size: 0.75rem;
    color: var(--dim, rgba(244,242,239,0.32));
    margin-top: 0.15rem;
}
.cart-item-price {
    font-weight: 600;
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}
.cart-remove {
    background: none;
    border: none;
    color: var(--dim, rgba(244,242,239,0.32));
    cursor: pointer;
    padding: 0.25rem;
    align-self: center;
    transition: color 0.25s;
}
.cart-remove:hover { color: #f87171; }

/* ---------- Cart Footer ---------- */
.cart-foot {
    padding: 1.25rem 1.75rem;
    border-top: 1px solid var(--border, rgba(255,255,255,0.08));
}
.cart-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1rem;
}
.cart-subtotal span {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--dim, rgba(244,242,239,0.32));
}
.cart-subtotal strong {
    font-family: var(--font-display, Georgia, serif);
    font-size: 1.35rem;
    font-weight: 700;
}

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.9rem 1.35rem;
    background: var(--text, #f4f2ef);
    color: var(--bg, #0a0a0b);
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 3000;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s;
    box-shadow: 0 24px 80px rgba(0,0,0,0.45);
}
.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.toast svg { color: var(--accent, #e8c547); }

/* ---------- Shared button styles (used by cart/checkout) ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s;
    background: none;
}
.btn-primary {
    background: var(--accent, #e8c547);
    color: var(--bg, #0a0a0b);
    padding: 0.875rem 1.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.btn-primary:hover { opacity: 0.9; }
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

/* ---------- Icon button ---------- */
.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    background: transparent;
    color: var(--text, #f4f2ef);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: border-color 0.2s, background 0.2s;
}
.icon-btn:hover {
    border-color: var(--accent, #e8c547);
    background: var(--surface, rgba(255,255,255,0.04));
}
