/* Keranjang Shopping Cart Styles */

.keranjang-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.keranjang-header {
    margin-bottom: 2rem;
}

.keranjang-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.keranjang-header p {
    font-size: 1rem;
    color: #666;
}

/* Cart Filter Tabs */
.cart-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e0e0e0;
}

.cart-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 0.95rem;
    font-weight: 600;
    color: #666;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    bottom: -2px;
}

.cart-tab:hover {
    color: #2f2f42;
    background: rgba(47, 47, 66, 0.05);
}

.cart-tab.active {
    color: #2f2f42;
    border-bottom-color: #2f2f42;
}

.cart-tab svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
}

.status-badge.checkout {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

/* Quantity Display (read-only) */
.qty-display {
    padding: 0.5rem 1rem;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #666;
}

/* Empty Cart State */
.empty-cart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    background: #f9f9f9;
    border-radius: 12px;
    margin: 2rem 0;
}

.empty-cart svg {
    color: #ddd;
    margin-bottom: 1.5rem;
}

.empty-cart h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.empty-cart p {
    font-size: 1rem;
    color: #666;
    margin-bottom: 2rem;
}

.empty-cart .btn-primary {
    padding: 0.875rem 2rem;
    background: #2f2f42;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.empty-cart .btn-primary:hover {
    background: #1a1a2e;
}

/* Cart Content Layout */
.cart-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    align-items: start;
}

/* Cart Items Section */
.cart-items {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.cart-header-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 50px;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: #f5f5f5;
    font-weight: 600;
    font-size: 0.875rem;
    color: #666;
    text-transform: uppercase;
    border-bottom: 1px solid #e0e0e0;
}

.cart-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 50px;
    gap: 1rem;
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    align-items: center;
    transition: background 0.3s ease;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item:hover {
    background: #fafafa;
}

/* Item Product Info */
.item-product {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.item-product img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    background-color: #f5f5f5;
}

.item-product img[src*="no-image"] {
    object-fit: contain;
    padding: 10px;
    opacity: 0.6;
}

.item-info h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.stock-warning {
    display: inline-block;
    font-size: 0.75rem;
    color: #d32f2f;
    background: #ffebee;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-top: 0.25rem;
}

/* Item Price */
.item-price {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.price-current {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
}

.price-original {
    font-size: 0.875rem;
    color: #999;
    text-decoration: line-through;
}

/* Item Quantity Controls */
.item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qty-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
}

.qty-btn:hover:not(:disabled) {
    background: #f5f5f5;
    border-color: #2f2f42;
    color: #2f2f42;
}

.qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.qty-input {
    width: 60px;
    height: 32px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1a1a1a;
    transition: border-color 0.2s ease;
}

.qty-input:focus {
    outline: none;
    border-color: #2f2f42;
}

.qty-input:disabled {
    background: #f5f5f5;
    opacity: 0.7;
}

/* Item Subtotal */
.item-subtotal {
    text-align: right;
}

.subtotal-amount {
    font-size: 1.125rem;
    font-weight: 700;
    color: #2f2f42;
}

/* Item Actions */
.item-actions {
    text-align: center;
}

.btn-remove {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
}

.btn-remove:hover:not(:disabled) {
    background: #ffebee;
    border-color: #d32f2f;
    color: #d32f2f;
}

.btn-remove:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Cart Summary Sidebar */
.cart-summary {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
    position: sticky;
    top: 100px;
}

.cart-summary h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #666;
}

.summary-row span:last-child {
    font-weight: 600;
    color: #1a1a1a;
}

.text-discount {
    color: #4caf50 !important;
}

.cart-summary hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 1.5rem 0;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    font-weight: 700;
}

.total-amount {
    font-size: 1.5rem;
    color: #2f2f42;
}

/* Summary Buttons */
.btn-checkout {
    width: 100%;
    padding: 1rem;
    background: #2f2f42;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.btn-checkout:hover {
    background: #1a1a2e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(47, 47, 66, 0.3);
}

.btn-continue-shopping {
    width: 100%;
    padding: 0.875rem;
    background: white;
    color: #2f2f42;
    border: 2px solid #2f2f42;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-continue-shopping:hover {
    background: #f5f5f5;
}

/* Notification System */
.notification {
    position: fixed;
    bottom: 100px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 10000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 350px;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    background: #4caf50;
    color: white;
}

.notification-error {
    background: #f44336;
    color: white;
}

.notification-warning {
    background: #ff9800;
    color: white;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .cart-content {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        position: static;
        order: 2;
    }

    .cart-items {
        order: 1;
    }

    .cart-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .cart-tabs::-webkit-scrollbar {
        display: none;
    }

    .cart-tab {
        white-space: nowrap;
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
    }

    .cart-header-row {
        display: none;
    }

    .cart-item {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .item-product {
        grid-column: 1;
    }

    .item-price,
    .item-quantity,
    .item-subtotal {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .item-price::before {
        content: "Harga:";
        font-size: 0.875rem;
        color: #666;
        font-weight: 500;
    }

    .item-quantity::before {
        content: "Jumlah:";
        font-size: 0.875rem;
        color: #666;
        font-weight: 500;
    }

    .item-subtotal::before {
        content: "Subtotal:";
        font-size: 0.875rem;
        color: #666;
        font-weight: 500;
    }

    .item-actions {
        display: flex;
        justify-content: flex-end;
    }
}

@media (max-width: 640px) {
    .keranjang-container {
        padding: 1rem 0.5rem;
    }

    .keranjang-header h1 {
        font-size: 1.5rem;
    }

    .cart-tabs {
        margin-bottom: 1.5rem;
    }

    .cart-tab {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }

    .cart-tab svg {
        width: 16px;
        height: 16px;
    }

    .item-product img {
        width: 60px;
        height: 60px;
    }

    .cart-summary {
        padding: 1rem;
    }

    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}
