/* ============================================
   CART STYLES - WITH PRODUCT IMAGES
   ============================================ */

/* Cart Badge di Navbar */
.cart-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--muted);
    transition: color 0.2s;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.3rem 0.5rem;
}

.cart-link:hover {
    color: var(--fg);
}

.cart-link .cart-icon {
    font-size: 1.2rem;
}

.cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #dc2626;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    border: 2px solid var(--bg);
    padding: 0 4px;
    line-height: 1;
}

.mobile-nav .cart-badge {
    position: relative;
    top: auto;
    right: auto;
    display: none;
    margin-left: 0.5rem;
    font-size: 0.6rem;
    min-width: 16px;
    height: 16px;
}

/* ===== CART PAGE ===== */
.cart-page {
    padding: 2rem 0 1rem;
    min-height: 70vh;
}

.cart-page .container {
    max-width: 600px;
}

.cart-page .page-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

/* Cart Wrapper */
.cart-wrapper {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

/* Cart Items */
.cart-items {
    padding: 0.5rem 0;
}

.cart-item-simple {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.cart-item-simple:last-child {
    border-bottom: none;
}

.cart-item-simple:hover {
    background: rgba(250, 248, 245, 0.5);
}

/* Product Image */
.cart-item-image-wrap {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 0.5rem;
    overflow: hidden;
    background: var(--secondary);
    border: 1px solid var(--border);
}

.cart-item-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cart-item-info-simple {
    flex: 1;
    min-width: 0;
}

.cart-item-info-simple .item-name-simple {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--fg);
}

.cart-item-info-simple .item-price-simple {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 0.1rem;
}

.cart-item-actions-simple {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.cart-item-qty-simple {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
    background: var(--bg);
}

.cart-item-qty-simple button {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fg);
    transition: background 0.2s;
    font-weight: 600;
}

.cart-item-qty-simple button:hover {
    background: var(--secondary);
}

.cart-item-qty-simple .qty-value-simple {
    min-width: 28px;
    text-align: center;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Cart Bottom */
.cart-bottom {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
    gap: 1rem;
    flex-wrap: wrap;
}

.cart-subtotal {
    display: flex;
    flex-direction: column;
}

.cart-subtotal .subtotal-label {
    font-size: 0.7rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.cart-subtotal .subtotal-value {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary);
}

.btn-checkout-cart {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 0.75rem;
    background: var(--accent);
    color: var(--accent-fg);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-checkout-cart:hover {
    background: #dbaa6a;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(200, 151, 88, 0.25);
}

/* Empty Cart */
.cart-empty {
    text-align: center;
    padding: 3rem 1.5rem;
}

.cart-empty .empty-icon {
    font-size: 3rem;
    color: #d4c9bc;
    margin-bottom: 0.75rem;
    display: block;
}

.cart-empty h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.cart-empty p {
    color: var(--muted);
    margin-bottom: 1.5rem;
}

.cart-empty .btn-shop {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.5rem;
    background: var(--accent);
    color: var(--accent-fg);
    border-radius: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.cart-empty .btn-shop:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(200, 151, 88, 0.3);
}

/* ============================================
   CHECKOUT MODAL
   ============================================ */
.checkout-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(42, 31, 23, 0.5);
    backdrop-filter: blur(4px);
    z-index: 100;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
}

.checkout-overlay.open {
    display: flex;
}

.checkout-modal {
    background: var(--card);
    border-radius: 1rem;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(42, 31, 23, 0.25);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.checkout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--card);
    z-index: 2;
    border-radius: 1rem 1rem 0 0;
}

.checkout-header h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 600;
}

.checkout-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--muted);
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s;
}

.checkout-close:hover {
    color: var(--fg);
}

#checkout-form {
    padding: 1.5rem;
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
}

.checkout-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.checkout-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.checkout-section h3 {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--fg);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.checkout-section .field {
    margin-bottom: 0.75rem;
}

.checkout-section .field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--fg);
}

.checkout-section .field input,
.checkout-section .field textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1.5px solid var(--border);
    border-radius: 0.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    background: var(--bg);
    color: var(--fg);
    transition: border-color 0.2s;
}

.checkout-section .field input:focus,
.checkout-section .field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(200, 151, 88, 0.15);
}

.checkout-section .field textarea {
    resize: vertical;
    min-height: 60px;
}

/* Lokasi Input */
.lokasi-input-group {
    display: flex;
    gap: 0.5rem;
}

.lokasi-input-group input {
    flex: 1;
}

.btn-lokasi {
    padding: 0.6rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: 0.5rem;
    background: var(--bg);
    cursor: pointer;
    transition: all 0.2s;
    color: var(--fg);
}

.btn-lokasi:hover {
    background: var(--secondary);
    border-color: var(--accent);
}

/* Payment Options */
.payment-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.payment-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.payment-option:hover {
    border-color: var(--accent);
    background: var(--bg);
}

.payment-option input[type="radio"] {
    margin-top: 0.15rem;
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.payment-option .payment-label {
    display: flex;
    flex-direction: column;
}

.payment-option .payment-label strong {
    font-size: 0.9rem;
    color: var(--fg);
}

.payment-option .payment-label small {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 400;
}

.payment-option:has(input:checked) {
    border-color: var(--accent);
    background: rgba(200, 151, 88, 0.08);
}

/* Transfer Info */
.transfer-info {
    margin-top: 0.75rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: 0.5rem;
    border: 1px solid var(--border);
}

.transfer-info .field {
    margin-bottom: 0;
}

/* Checkout Summary */
.checkout-summary {
    background: var(--bg);
    border-radius: 0.5rem;
    padding: 1rem;
    border: 1px solid var(--border);
}

.checkout-summary .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.checkout-summary .summary-row span:last-child {
    color: var(--fg);
    font-weight: 500;
}

.checkout-summary .summary-total {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0 0;
    margin-top: 0.4rem;
    border-top: 2px solid var(--border);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
}

.checkout-summary .summary-total span:last-child {
    color: var(--accent);
    font-size: 1.1rem;
}

/* Checkout Final Button */
.btn-checkout-final {
    width: 100%;
    padding: 0.8rem;
    border: none;
    border-radius: 0.75rem;
    background: #25D366;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-checkout-final:hover {
    background: #1da851;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3);
}

.btn-checkout-final:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Toast */
.cart-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #2a1f17;
    color: #faf7f2;
    padding: 0.8rem 1.6rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    box-shadow: 0 8px 30px rgba(42, 31, 23, 0.25);
    z-index: 200;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cart-toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.cart-toast.success {
    background: #166534;
}

.cart-toast.error {
    background: #991b1b;
}

.cart-toast-icon {
    font-size: 1.2rem;
}

.cart-toast.success .cart-toast-icon::before {
    content: '✅';
}

.cart-toast.error .cart-toast-icon::before {
    content: '❌';
}

/* Responsive */
@media (max-width: 480px) {
    .cart-item-simple {
        padding: 0.6rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .cart-item-image-wrap {
        width: 40px;
        height: 40px;
    }
    
    .cart-item-info-simple .item-name-simple {
        font-size: 0.85rem;
    }
    
    .cart-item-actions-simple {
        width: 100%;
        justify-content: flex-end;
        margin-top: 0.2rem;
    }
    
    .cart-bottom {
        flex-direction: column;
        align-items: stretch;
        padding: 0.8rem 1rem;
    }
    
    .btn-checkout-cart {
        width: 100%;
        justify-content: center;
        padding: 0.7rem;
    }
    
    .checkout-modal {
        margin: 0.5rem;
        max-height: 95vh;
    }
    
    #checkout-form {
        padding: 1rem;
    }
    
    .checkout-header {
        padding: 1rem;
    }
    
    .payment-option {
        padding: 0.6rem 0.8rem;
    }
    
    .cart-toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        font-size: 0.85rem;
        padding: 0.7rem 1.2rem;
    }
}

/* ============================================
   QRIS STYLES - ONLY QRIS
   ============================================ */

.payment-info {
    padding: 0.75rem 1rem;
    background: var(--bg);
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    margin-bottom: 0.75rem;
}

.payment-method {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.payment-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.payment-detail {
    display: flex;
    flex-direction: column;
}

.payment-detail strong {
    font-size: 0.9rem;
    color: var(--fg);
}

.payment-detail small {
    font-size: 0.75rem;
    color: var(--muted);
}

.qris-info {
    padding: 1rem;
    background: var(--bg);
    border-radius: 0.5rem;
    border: 1px solid var(--border);
}

.qris-container {
    text-align: center;
}

.qris-image {
    max-width: 200px;
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background: white;
    padding: 0.5rem;
    margin: 0 auto;
    display: block;
}

/* ============================================
   CHECKOUT MODAL - UPDATED
   ============================================ */
.checkout-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(42, 31, 23, 0.5);
    backdrop-filter: blur(4px);
    z-index: 100;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
}

.checkout-overlay.open {
    display: flex;
}

.checkout-modal {
    background: var(--card);
    border-radius: 1rem;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(42, 31, 23, 0.25);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.checkout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--card);
    z-index: 2;
    border-radius: 1rem 1rem 0 0;
}

.checkout-header h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 600;
}

.checkout-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--muted);
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s;
}

.checkout-close:hover {
    color: var(--fg);
}

#checkout-form {
    padding: 1.5rem;
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
}

.checkout-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.checkout-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.checkout-section h3 {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--fg);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.checkout-section .field {
    margin-bottom: 0.75rem;
}

.checkout-section .field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--fg);
}

.checkout-section .field input,
.checkout-section .field textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1.5px solid var(--border);
    border-radius: 0.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    background: var(--bg);
    color: var(--fg);
    transition: border-color 0.2s;
}

.checkout-section .field input:focus,
.checkout-section .field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(200, 151, 88, 0.15);
}

.checkout-section .field textarea {
    resize: vertical;
    min-height: 60px;
}

/* Checkout Summary */
.checkout-summary {
    background: var(--bg);
    border-radius: 0.5rem;
    padding: 1rem;
    border: 1px solid var(--border);
}

.checkout-summary .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.checkout-summary .summary-row span:last-child {
    color: var(--fg);
    font-weight: 500;
}

.checkout-summary .summary-total {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0 0;
    margin-top: 0.4rem;
    border-top: 2px solid var(--border);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
}

.checkout-summary .summary-total span:last-child {
    color: var(--accent);
    font-size: 1.1rem;
}

/* Checkout Final Button */
.btn-checkout-final {
    width: 100%;
    padding: 0.8rem;
    border: none;
    border-radius: 0.75rem;
    background: #25D366;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-checkout-final:hover {
    background: #1da851;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3);
}

.btn-checkout-final:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Toast */
.cart-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #2a1f17;
    color: #faf7f2;
    padding: 0.8rem 1.6rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    box-shadow: 0 8px 30px rgba(42, 31, 23, 0.25);
    z-index: 200;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cart-toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.cart-toast.success {
    background: #166534;
}

.cart-toast.error {
    background: #991b1b;
}

.cart-toast-icon {
    font-size: 1.2rem;
}

.cart-toast.success .cart-toast-icon::before {
    content: '✅';
}

.cart-toast.error .cart-toast-icon::before {
    content: '❌';
}

/* Responsive */
@media (max-width: 480px) {
    .cart-item-simple {
        padding: 0.6rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .cart-item-image-wrap {
        width: 40px;
        height: 40px;
    }
    
    .cart-item-info-simple .item-name-simple {
        font-size: 0.85rem;
    }
    
    .cart-item-actions-simple {
        width: 100%;
        justify-content: flex-end;
        margin-top: 0.2rem;
    }
    
    .cart-bottom {
        flex-direction: column;
        align-items: stretch;
        padding: 0.8rem 1rem;
    }
    
    .btn-checkout-cart {
        width: 100%;
        justify-content: center;
        padding: 0.7rem;
    }
    
    .checkout-modal {
        margin: 0.5rem;
        max-height: 95vh;
    }
    
    #checkout-form {
        padding: 1rem;
    }
    
    .checkout-header {
        padding: 1rem;
    }
    
    .qris-image {
        max-width: 150px;
    }
    
    .cart-toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        font-size: 0.85rem;
        padding: 0.7rem 1.2rem;
    }
}

/* ============================================
   ONGKIR STYLES
   ============================================ */

.btn-cek-ongkir {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.5rem;
    background: var(--accent);
    color: var(--accent-fg);
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    justify-content: center;
    margin-top: 0.25rem;
}

.btn-cek-ongkir:hover {
    background: #dbaa6a;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(200, 151, 88, 0.25);
}

.btn-cek-ongkir:active {
    transform: scale(0.97);
}

#ongkir-result {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Loading spin */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 480px) {
    .btn-cek-ongkir {
        padding: 0.7rem;
        font-size: 0.85rem;
    }
}