/* ==================================== */
/* CART - PALM ANGELS STYLE (TIPIS & MEWAH) */
/* ==================================== */

@import url('https://fonts.googleapis.com/css2?family=Unica+One&family=Tenor+Sans&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    font-family: 'Tenor Sans', sans-serif; 
    background: #fff; 
    color: #000; 
    font-weight: 400; 
    font-size: 0.875rem;
    line-height: 1.6;
}

.cart-page { padding: 100px 0 80px; }
@media (max-width: 768px) { .cart-page { padding-top: 80px; } }

.container { max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* TITLE */
.cart-title {
    font-family: 'Unica One', cursive;
    font-size: 2.2rem;
    letter-spacing: 2.8px;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 48px;
    color: #000;
}
@media (min-width: 992px) { .cart-title { font-size: 2.6rem; letter-spacing: 3.2px; } }

/* GRID */
.cart-grid { display: grid; gap: 40px; }
@media (min-width: 992px) { 
    .cart-grid { grid-template-columns: 1fr 380px; gap: 60px; } 
}

/* ITEM */
.cart-item {
    display: flex;
    padding: 24px 0;
    border-bottom: 1px solid #eee;
    position: relative;
    opacity: 1;
    transition: all 0.4s ease;
}
.cart-item:last-child { border-bottom: none; }

.item-image {
    width: 110px; height: 140px; flex-shrink: 0; overflow: hidden; border-radius: 10px;
    border: 1px solid #eee;
}
.item-image img {
    width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease;
}
.cart-item:hover .item-image img { transform: scale(1.05); }

.item-details { flex: 1; margin-left: 20px; }
.item-name {
    font-family: 'Unica One', cursive;
    font-size: 1.1rem;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    margin: 0 0 12px;
    line-height: 1.2;
    color: #000;
}

.item-options {
    display: flex; gap: 20px; margin: 10px 0 16px; flex-wrap: wrap;
    font-size: 0.8rem;
}
.size-selector, .qty-selector { display: flex; flex-direction: column; }
.size-selector label, .qty-selector label {
    margin-bottom: 4px; color: #666; font-size: 0.75rem; letter-spacing: 0.5px;
}

.size-select {
    padding: 6px 10px; border: 1.4px solid #ddd; border-radius: 6px;
    background: #fff; font-size: 0.8rem; width: 70px; cursor: pointer;
}
.size-select:focus { outline: none; border-color: #000; }

.qty-controls {
    display: flex; border: 1.4px solid #ddd; border-radius: 6px; overflow: hidden;
}
.qty-btn {
    width: 32px; height: 32px; background: #fff; border: none;
    font-size: 1rem; cursor: pointer; color: #666;
}
.qty-btn:hover { background: #f5f5f5; }
.qty-controls input {
    width: 40px; height: 32px; text-align: center; border: none;
    background: transparent; font-size: 0.8rem; color: #000;
}

.item-price {
    font-size: 1rem; letter-spacing: 0.8px; margin: 0; color: #000;
}

/* DELETE BUTTON - MEWAH & ELEGAN */
.delete-btn {
    position: absolute;
    top: 16px;
    right: 0;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: #999;
    transition: all 0.3s ease;
    overflow: hidden;
}

.delete-btn span {
    position: relative;
    display: inline-block;
    transition: transform 0.3s ease;
}

.delete-btn::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: #000;
    transition: width 0.3s ease;
}

.delete-btn:hover {
    color: #000;
}

.delete-btn:hover span {
    transform: translateY(-1px);
}

.delete-btn:hover::before {
    width: 100%;
}

/* Mobile: Delete jadi di bawah */
@media (max-width: 768px) {
    .delete-btn {
        position: static;
        margin-top: 16px;
        text-align: left;
        padding-left: 0;
    }
}
.delete-btn:hover { color: #000; }

/* SUMMARY */
.cart-summary { position: sticky; top: 100px; align-self: start; }
.summary-card {
    background: #fafafa; padding: 24px; border-radius: 12px; border: 1px solid #eee;
}
.summary-card h4 {
    font-size: 0.9rem; letter-spacing: 1.2px; text-transform: uppercase;
    margin-bottom: 16px; color: #000;
}
.summary-row { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 0.9rem; }
.summary-divider { border-top: 1px solid #ddd; margin: 16px 0; }
.summary-total { display: flex; justify-content: space-between; font-size: 1.1rem; letter-spacing: 0.8px; }

.btn-checkout {
    display: block; width: 100%; padding: 14px; background: #000; color: #fff;
    font-size: 0.8rem; font-weight: 500; text-transform: uppercase; letter-spacing: 1.5px;
    text-align: center; border: none; border-radius: 6px; cursor: pointer;
    transition: 0.3s; margin-top: 20px;
}
.btn-checkout:hover { background: #222; transform: translateY(-1px); }

.btn-continue-sm {
    display: block; text-align: center; margin-top: 12px; font-size: 0.8rem;
    color: #666; text-decoration: none; letter-spacing: 0.6px;
}
.btn-continue-sm:hover { color: #000; }

.secure-note {
    display: flex; align-items: center; gap: 8px; margin-top: 20px;
    font-size: 0.75rem; color: #666;
}
.secure-note i { font-size: 1rem; color: #000; }

/* EMPTY */
.empty-cart { text-align: center; padding: 100px 20px; }
.empty-img { width: 120px; margin-bottom: 24px; opacity: 0.6; }
.empty-cart p { font-size: 1rem; color: #666; margin-bottom: 24px; }
.btn-continue {
    display: inline-block; padding: 12px 36px; background: #000; color: #fff;
    font-size: 0.8rem; font-weight: 500; text-transform: uppercase; letter-spacing: 1.5px;
    text-decoration: none; border-radius: 6px; transition: 0.3s;
}
.btn-continue:hover { background: #222; }

/* ALERT */
.cart-alert {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    background: #000; color: #fff; padding: 12px 28px; border-radius: 6px;
    font-size: 0.8rem; font-weight: 500; letter-spacing: 0.5px; z-index: 9999;
    opacity: 0; visibility: hidden; transition: all 0.4s ease;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15); pointer-events: none;
}
.cart-alert.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.cart-alert.error { background: #c00; }

/* RESPONSIVE */
@media (max-width: 992px) {
    .cart-title { font-size: 2.2rem; letter-spacing: 2.4px; }
    .item-image { width: 90px; height: 120px; }
}
@media (max-width: 768px) {
    .cart-item { flex-direction: column; padding: 20px 0; }
    .item-image { width: 100%; height: 200px; margin-bottom: 16px; border-radius: 12px; }
    .item-details { margin-left: 0; }
    .item-options { gap: 16px; justify-content: space-between; }
    .delete-btn { position: static; margin-top: 12px; }
}

/* CART BADGE - ANIMASI HALUS */
.cart-count {
    display: inline-block;
    min-width: 18px;
    height: 18px;
    background: #000;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 18px;
    text-align: center;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

/* ORDER SUMMARY - SMOOTH UPDATE */
#subtotal, #grand_total {
    font-weight: 400;
    letter-spacing: 0.9px;
    transition: all 0.3s ease;
}

/* Custom Confirmation Modal Styling */
.custom-modal {
    position: fixed;
    z-index: 1000; /* Pastikan di atas semua elemen lain */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6); /* Overlay gelap */
    display: none; /* Mulai tersembunyi */
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: fadeIn 0.3s;
}

.modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.modal-close:hover,
.modal-close:focus {
    color: #000;
    text-decoration: none;
}

.modal-header {
    text-align: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-family: 'Tenor Sans', sans-serif;
    margin: 10px 0 0;
    color: #333;
    font-size: 1.5rem;
}

.modal-header i {
    font-size: 2.5rem;
    color: #e74c3c; /* Warna merah untuk ikon hapus */
}

.modal-content p {
    text-align: center;
    margin-bottom: 30px;
    color: #555;
    font-size: 1rem;
}

.modal-footer {
    display: flex;
    justify-content: space-around;
    gap: 10px;
}

.btn-secondary {
    background-color: #ccc;
    color: #333;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    flex-grow: 1;
    transition: background-color 0.2s;
    text-transform: uppercase;
}

.btn-secondary:hover {
    background-color: #bbb;
}

.btn-primary-delete {
    background-color: #e74c3c; /* Warna tombol hapus */
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    flex-grow: 1;
    transition: background-color 0.2s;
    text-transform: uppercase;
}

.btn-primary-delete:hover {
    background-color: #c0392b;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}