/* ===========================================
   CART.CSS - Halaman Keranjang Belanja
   =========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f8f9fa;
    color: #2c3e50;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== NAVBAR ========== */
.navbar {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: #e67e22;
}

.logo i {
    margin-right: 10px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: #2c3e50;
    font-weight: 600;
    transition: color 0.3s;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: #e67e22;
}

.nav-icons {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.cart-icon, .login-icon {
    font-size: 1.5rem;
    cursor: pointer;
    position: relative;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -12px;
    background-color: #e67e22;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 50%;
}

/* ========== HERO KERANJANG ========== */
.cart-hero {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

.cart-hero h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* ========== MAIN CONTENT ========== */
.cart-container {
    padding: 3rem 0;
    min-height: 60vh;
}

.cart-wrapper {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
}

/* ========== KOLOM KIRI: DAFTAR BARANG ========== */
.cart-items-section {
    background: white;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    overflow: hidden;
}

.cart-header {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr 0.5fr;
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    font-weight: 700;
    border-bottom: 2px solid #e67e22;
}

.cart-items-list {
    padding: 0;
}

/* Item barang di keranjang */
.cart-item {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr 0.5fr;
    align-items: center;
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.cart-item:hover {
    background: #fef9f4;
}

.cart-item-product {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cart-item-product img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 12px;
}

.cart-item-product h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.cart-item-product p {
    font-size: 0.8rem;
    color: #7f8c8d;
}

.cart-item-price {
    font-weight: 600;
    color: #2c3e50;
}

/* Quantity control (tambah/kurang) */
.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.2s;
}

.qty-btn:hover {
    background: #e67e22;
    color: white;
    border-color: #e67e22;
}

.qty-value {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
}

.cart-item-subtotal {
    font-weight: 700;
    color: #e67e22;
}

.remove-item {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #e74c3c;
    transition: transform 0.2s;
}

.remove-item:hover {
    transform: scale(1.1);
}

/* Empty cart */
.empty-cart {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-cart i {
    font-size: 4rem;
    color: #e67e22;
    margin-bottom: 1rem;
}

.empty-cart h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.btn-shop {
    display: inline-block;
    margin-top: 1rem;
    background: #e67e22;
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-shop:hover {
    background: #d35400;
    transform: translateY(-2px);
}

/* ========== KOLOM KANAN: RINGKASAN ========== */
.cart-summary-section {
    position: sticky;
    top: 100px;
}

.cart-summary-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    padding: 1.5rem;
}

.cart-summary-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e67e22;
    display: inline-block;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 0;
    font-size: 1rem;
}

.summary-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 0.8rem 0;
}

.grand-total {
    font-size: 1.2rem;
    font-weight: 800;
    color: #e67e22;
}

.total-price {
    font-weight: 700;
}

.btn-checkout {
    width: 100%;
    background: #27ae60;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-checkout:hover {
    background: #219a52;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39,174,96,0.3);
}

.btn-continue {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    background: #ecf0f1;
    color: #2c3e50;
    text-decoration: none;
    padding: 12px;
    border-radius: 50px;
    font-weight: 600;
    margin-top: 1rem;
    transition: all 0.3s;
}

.btn-continue:hover {
    background: #e0e0e0;
}

/* ========== FOOTER ========== */
.footer {
    background-color: #1a252f;
    color: #ecf0f1;
    padding: 3rem 0 0 0;
    margin-top: 3rem;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-logo {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.footer-logo i {
    color: #e67e22;
}

.social-icons a {
    color: white;
    margin-right: 1rem;
    font-size: 1.2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: #e67e22;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #ecf0f1;
    text-decoration: none;
}

.footer-bottom {
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid #2c3e50;
}

/* ========== MODAL LOGIN ========== */
.login-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.login-modal-content {
    background: white;
    width: 90%;
    max-width: 400px;
    border-radius: 20px;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.login-modal-header {
    display: flex;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #ddd;
}

.login-close {
    font-size: 2rem;
    cursor: pointer;
}

.login-modal-body {
    padding: 1.5rem;
    text-align: center;
}

.btn-primary {
    background-color: #e67e22;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
}

/* ========== NOTIFIKASI ========== */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #27ae60;
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    z-index: 9999;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========== RESPONSIF ========== */
@media (max-width: 900px) {
    .cart-wrapper {
        grid-template-columns: 1fr;
    }
    
    .cart-summary-section {
        position: static;
    }
    
    .cart-header {
        display: none;
    }
    
    .cart-item {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        padding: 1rem;
    }
    
    .cart-item-product {
        grid-row: 1;
    }
    
    .cart-item-price {
        display: flex;
        justify-content: space-between;
    }
    
    .cart-item-price::before {
        content: "Harga:";
        font-weight: 600;
    }
    
    .quantity-control {
        justify-content: space-between;
    }
    
    .quantity-control::before {
        content: "Jumlah:";
        font-weight: 600;
    }
    
    .cart-item-subtotal {
        display: flex;
        justify-content: space-between;
    }
    
    .cart-item-subtotal::before {
        content: "Subtotal:";
        font-weight: 600;
    }
    
    .remove-item {
        position: absolute;
        right: 1rem;
        top: 1rem;
    }
    
    .cart-item {
        position: relative;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
}

/* ========== USER DROPDOWN MENU ========== */
.user-dropdown {
    position: relative;
    cursor: pointer;
}

.user-avatar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.8rem;
    background: #f8f9fa;
    border-radius: 50px;
    transition: all 0.3s;
}

.user-avatar:hover {
    background: #e67e22;
    color: white;
}

.user-avatar i:first-child {
    font-size: 1.2rem;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-avatar .fa-chevron-down {
    font-size: 0.7rem;
    transition: transform 0.3s;
}

.user-dropdown.active .fa-chevron-down {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 45px;
    right: 0;
    background: white;
    min-width: 220px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 1rem;
    background: linear-gradient(135deg, #e67e22, #f39c12);
    color: white;
    text-align: center;
}

.dropdown-header strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.dropdown-header small {
    font-size: 0.7rem;
    opacity: 0.9;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    color: #2c3e50;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.dropdown-item i {
    width: 20px;
    font-size: 1rem;
    color: #7f8c8d;
}

.dropdown-item:hover {
    background: #f8f9fa;
    color: #e67e22;
}

.dropdown-item:hover i {
    color: #e67e22;
}

.dropdown-divider {
    height: 1px;
    background: #e9ecef;
    margin: 0.3rem 0;
}

.logout-item {
    color: #e74c3c;
}

.logout-item i {
    color: #e74c3c;
}

.logout-item:hover {
    background: #fee;
    color: #e74c3c;
}

/* Responsif untuk dropdown */
@media (max-width: 768px) {
    .user-name {
        display: none;
    }
    
    .user-avatar {
        padding: 0.3rem 0.6rem;
    }
    
    .dropdown-menu {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
    }
    
    .dropdown-menu.show {
        transform: translateY(0);
    }
}