/* Cart drawer, checkout and confirmation styles (loaded after store.css) */

/* Nav cart button */
.store-cart-btn { position: relative; margin-left: auto; margin-right: 14px; background: none; border: 0; cursor: pointer; color: var(--text-dark); padding: 6px; display: flex; }
.store-cart-btn .cart-badge { position: absolute; top: -4px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; font-size: 0.7rem; font-weight: 700; align-items: center; justify-content: center; }
@media (min-width: 993px) { .store-cart-btn { margin-left: 18px; margin-right: 0; order: 5; } }

/* Product actions */
.product-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-order { background: var(--maroon); border: 0; cursor: pointer; font-family: inherit; }
.btn-order:hover { background: var(--maroon-dark); }
.btn-buy { font-size: 0.84rem; font-weight: 700; padding: 10px 16px; border-radius: 50px; border: 1.5px solid var(--maroon); color: var(--maroon); white-space: nowrap; transition: all 0.2s; }
.btn-buy:hover { background: var(--maroon); color: #fff; }
@media (max-width: 640px) { .product-actions { flex-direction: column; width: 100%; } .btn-order, .btn-buy { justify-content: center; text-align: center; } }

/* Cart drawer */
#cart-overlay { position: fixed; inset: 0; background: rgba(26,17,24,0.5); z-index: 1200; display: none; }
#cart-overlay.active { display: block; }
#cart-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 100%); background: #fff; z-index: 1201; display: flex; flex-direction: column; transform: translateX(100%); transition: transform 0.3s ease; box-shadow: var(--shadow-2xl); }
#cart-drawer.active { transform: translateX(0); }
.cart-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--border-light); }
.cart-header h2 { font-family: var(--font-heading); font-size: 1.2rem; }
.cart-close { background: none; border: 0; font-size: 1.1rem; cursor: pointer; color: var(--text-muted); }
#cart-items { flex: 1; overflow-y: auto; padding: 8px 22px; }
.cart-empty { text-align: center; padding: 3rem 0; color: var(--text-muted); }
.cart-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border-light); }
.cart-item-img { width: 60px; height: 60px; border-radius: 10px; overflow: hidden; background: #f3e4c8; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--maroon); }
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 0.88rem; font-weight: 700; line-height: 1.3; }
.cart-item-price { font-size: 0.8rem; color: var(--text-muted); }
.cart-qty { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.cart-qty button { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border-light); background: #fff; cursor: pointer; font-size: 1rem; line-height: 1; }
.cart-qty button:hover { border-color: var(--maroon); color: var(--maroon); }
.cart-qty span { min-width: 22px; text-align: center; font-weight: 700; font-size: 0.88rem; }
.cart-qty button.cart-remove { width: auto; border: 0; font-size: 0.76rem; color: var(--text-muted); margin-left: 6px; }
.cart-qty button.cart-remove:hover { color: #dc2626; }
.cart-item-total { font-weight: 800; font-size: 0.9rem; white-space: nowrap; }
#cart-footer { padding: 18px 22px; border-top: 1px solid var(--border-light); background: var(--cream); }
.cart-subtotal { display: flex; justify-content: space-between; margin-bottom: 14px; }
.btn-checkout { display: block; text-align: center; background: var(--maroon); color: #fff; font-weight: 700; padding: 14px; border-radius: 50px; }
.btn-checkout:hover { background: var(--maroon-dark); }

/* Checkout */
.checkout-wrap { padding: 140px 0 90px; background: var(--cream-light); }
.checkout-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: start; }
.checkout-section { background: #fff; border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 26px; margin-bottom: 22px; box-shadow: var(--shadow-xs); }
.checkout-section h2 { font-family: var(--font-heading); font-size: 1.2rem; margin-bottom: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 700; margin-bottom: 6px; }
.form-group input { width: 100%; font: inherit; padding: 12px 14px; border: 1px solid rgba(26,17,24,0.15); border-radius: 10px; background: #fff; }
.form-group input:focus { outline: 2px solid var(--maroon); outline-offset: 1px; }
.form-group input[readonly] { background: var(--cream); color: var(--text-muted); }
.coupon-row { display: flex; gap: 10px; }
.coupon-row input { flex: 1; font: inherit; padding: 12px 14px; border: 1px solid rgba(26,17,24,0.15); border-radius: 10px; text-transform: uppercase; }
.btn-apply { font: inherit; font-weight: 700; padding: 0 22px; border-radius: 10px; border: 0; background: var(--text-dark); color: #fff; cursor: pointer; }
.coupon-msg { font-size: 0.84rem; margin-top: 8px; }
.coupon-msg.ok { color: #15803d; }
.coupon-msg.err { color: #b91c1c; }
.payment-option { display: flex; gap: 12px; align-items: center; padding: 16px; border: 1.5px solid var(--border-light); border-radius: 12px; margin-bottom: 10px; cursor: pointer; }
.payment-option.selected { border-color: var(--maroon); background: rgba(122,31,43,0.04); }
.payment-option input { accent-color: var(--maroon); }
.payment-option-label { font-weight: 700; }
.payment-option-sub { font-size: 0.82rem; color: var(--text-muted); }
.order-summary { background: #fff; border: 1px solid var(--border-light); border-radius: var(--radius-md); box-shadow: var(--shadow-md); position: sticky; top: 100px; overflow: hidden; }
.order-summary-header { padding: 18px 24px; font-family: var(--font-heading); font-weight: 600; font-size: 1.15rem; background: var(--cream); border-bottom: 1px solid var(--border-light); }
.summary-items { padding: 6px 24px; }
.summary-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-light); }
.summary-item-img { width: 48px; height: 48px; border-radius: 8px; overflow: hidden; background: #f3e4c8; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--maroon); }
.summary-item-img img { width: 100%; height: 100%; object-fit: cover; }
.summary-item-name { flex: 1; font-size: 0.86rem; font-weight: 600; }
.summary-item-price { font-weight: 700; font-size: 0.9rem; }
.summary-totals { padding: 14px 24px; }
.summary-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 0.92rem; color: var(--text-body); }
.summary-row.discount { color: #15803d; }
.summary-row.total { border-top: 1px solid var(--border-light); margin-top: 8px; padding-top: 12px; font-size: 1.1rem; color: var(--text-dark); font-weight: 700; }
.btn-place-order { display: block; width: calc(100% - 48px); margin: 0 24px 24px; padding: 16px; border: 0; border-radius: 50px; background: var(--maroon); color: #fff; font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer; }
.btn-place-order:hover { background: var(--maroon-dark); }
.btn-place-order:disabled { opacity: 0.6; cursor: wait; }
.checkout-empty { text-align: center; padding: 60px 20px; }
.checkout-empty h2 { font-family: var(--font-heading); margin-bottom: 10px; }
.checkout-empty a, .confirm-link { color: var(--maroon); font-weight: 700; }
@media (max-width: 860px) { .checkout-layout { grid-template-columns: 1fr; } .order-summary { position: static; } .form-row { grid-template-columns: 1fr; gap: 0; } }

/* Confirmation */
.confirm-container { max-width: 560px; margin: 0 auto; padding: 0 20px; }
.receipt-card { background: #fff; border-radius: 20px; border: 1px solid var(--border-light); box-shadow: var(--shadow-lg); padding: 38px 32px; }
.receipt-card h1 { font-family: var(--font-heading); font-size: 1.7rem; color: var(--maroon); margin-bottom: 6px; }
.receipt-divider { border-top: 2px dashed var(--border-light); margin: 26px 0; }
.status-badge { display: inline-block; padding: 5px 14px; border-radius: 50px; font-size: 0.8rem; font-weight: 700; }
.status-badge.green { background: #dcfce7; color: #15803d; }
.status-badge.yellow { background: #fef9c3; color: #a16207; }
.detail-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border-light); font-size: 0.92rem; }
.detail-row span:first-child { color: var(--text-muted); }
.confirm-icon { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; font-size: 1.5rem; }
