/* ============================================================
   Cart Sidebar & Checkout styles
   ============================================================ */

/* Overlay */
.cart-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    z-index: 2000;
    transition: opacity 0.3s;
    opacity: 0;
}
.cart-overlay.open { display: block; opacity: 1; }

/* Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0; right: -400px;
    width: 380px; max-width: 90vw;
    height: 100vh;
    background: #fff;
    z-index: 2001;
    box-shadow: -4px 0 25px rgba(0,0,0,0.15);
    transition: right 0.35s ease;
    display: flex;
    flex-direction: column;
}
.cart-sidebar.open { right: 0; }

/* Sidebar header */
.cart-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 22px;
    border-bottom: 2px solid var(--gold, #b8860b);
    background: var(--dark, #2c2c2c);
    color: #fff;
}
.cart-sidebar-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-family: 'Playfair Display', serif;
    color: var(--gold, #b8860b);
}
.cart-sidebar-header button {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.cart-sidebar-header button:hover { color: #fff; }

/* Sidebar body (scrollable) */
.cart-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px 22px;
}

/* Empty message */
.cart-empty-msg {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}
.cart-empty-msg i {
    font-size: 3rem;
    color: #ddd;
    display: block;
    margin-bottom: 15px;
}
.cart-empty-msg p {
    font-size: 1.1rem;
    margin: 0;
}

/* Cart item row */
.cart-sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}
.cart-item-img {
    flex-shrink: 0;
    width: 65px;
    height: 65px;
    border-radius: 4px;
    overflow: hidden;
    background: #f8f5f0;
}
.cart-item-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 5px;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2c2c2c;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cart-item-price {
    font-size: 0.95rem;
    color: var(--gold, #b8860b);
    font-weight: 700;
    margin-bottom: 6px;
}

/* Quantity controls */
.cart-item-qty, .checkout-qty {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1px solid #ddd;
    border-radius: 3px;
    overflow: hidden;
}
.qty-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    transition: 0.2s;
}
.qty-btn:hover { background: var(--gold, #b8860b); color: #fff; }
.qty-val {
    width: 36px;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    line-height: 30px;
}

/* Remove button */
.cart-item-remove {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #ccc;
    font-size: 1rem;
    cursor: pointer;
    padding: 5px;
    transition: 0.2s;
}
.cart-item-remove:hover { color: #e74c3c; }

/* Sidebar footer */
.cart-sidebar-footer {
    padding: 18px 22px;
    border-top: 1px solid #eee;
    background: #fafafa;
}
.cart-sidebar-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 1.15rem;
}
.cart-sidebar-total strong { color: var(--gold, #b8860b); font-size: 1.3rem; }
.cart-sidebar-footer .btn-checkout {
    display: block;
    width: 100%;
    background: var(--gold, #b8860b);
    color: #fff;
    border: none;
    padding: 14px;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 3px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: 0.3s;
}
.cart-sidebar-footer .btn-checkout:hover {
    background: #d4a017;
    color: #fff;
    text-decoration: none;
}
.cart-sidebar-footer .btn-continue {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 10px;
    color: #888;
    font-size: 0.9rem;
    text-decoration: none;
    transition: 0.2s;
}
.cart-sidebar-footer .btn-continue:hover { color: var(--gold, #b8860b); }

/* ============================================================
   Checkout page
   ============================================================ */
.checkout-section { padding: 40px 0 60px; }
.checkout-section h1 {
    text-align: center;
    margin-bottom: 10px;
    font-size: 2.2rem;
}
.checkout-section .line {
    width: 60px;
    height: 2px;
    background: var(--gold, #b8860b);
    margin: 0 auto 35px;
}

.checkout-table {
    width: 100%;
    border-collapse: collapse;
}
.checkout-table th {
    background: var(--dark, #2c2c2c);
    color: #fff;
    padding: 12px 15px;
    font-size: 0.95rem;
    text-align: left;
    font-weight: 600;
}
.checkout-table td {
    padding: 14px 15px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
    font-size: 1rem;
}
.checkout-table tr:hover td { background: #faf9f6; }

.checkout-thumb {
    width: 60px;
    height: 60px;
    object-fit: contain;
    background: #f8f5f0;
    border-radius: 4px;
    padding: 5px;
}

.checkout-summary {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.checkout-summary h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gold, #b8860b);
}
.checkout-summary .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 1.05rem;
    border-bottom: 1px solid #f0f0f0;
}
.checkout-summary .summary-row.total {
    border-bottom: none;
    font-size: 1.3rem;
    font-weight: 700;
    padding-top: 12px;
    margin-top: 5px;
    border-top: 2px solid #eee;
}
.checkout-summary .summary-row.total span:last-child {
    color: var(--gold, #b8860b);
}

/* Payment form */
.checkout-form label {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 5px;
    display: block;
}
.checkout-form input,
.checkout-form select,
.checkout-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 1rem;
    margin-bottom: 15px;
    font-family: 'Open Sans', sans-serif;
}
.checkout-form input:focus,
.checkout-form select:focus {
    border-color: var(--gold, #b8860b);
    outline: none;
}
.btn-order {
    display: block;
    width: 100%;
    background: var(--gold, #b8860b);
    color: #fff;
    border: none;
    padding: 16px;
    font-size: 1.15rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 3px;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 10px;
}
.btn-order:hover { background: #d4a017; }

.checkout-empty {
    text-align: center;
    padding: 80px 20px;
    color: #999;
}
.checkout-empty i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 20px;
    display: block;
}

/* Payment method radios */
.payment-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: 0.2s;
}
.payment-option:hover { border-color: var(--gold, #b8860b); }
.payment-option input[type="radio"] { margin: 0; }
.payment-option i { font-size: 1.2rem; color: var(--gold, #b8860b); }

@media (max-width: 768px) {
    .checkout-table th:first-child,
    .checkout-table td:first-child { display: none; }
}
