* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Montserrat", sans-serif;
}

body {
    background: #f8f8f8;
    color: #333;
}

.cart-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 70vh;
}

/* Header */
.cart-header {
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 20px;
}

.cart-header h1 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 10px;
}

.item-count {
    color: #666;
    font-size: 1.1em;
}

.select-all-container {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.select-all-container label {
    color: #333;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.item-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #048a08;
}

/* Empty Cart State */
.empty-cart {
    text-align: center;
    padding: 80px 20px;
    background: #f9f9f9;
    border-radius: 10px;
}

.empty-cart i {
    font-size: 5em;
    color: #ccc;
    margin-bottom: 20px;
}

.empty-cart h2 {
    font-size: 2em;
    color: #333;
    margin-bottom: 10px;
}

.empty-cart p {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 30px;
}

.continue-shopping-btn {
    display: inline-block;
    background: #048a08;
    color: white;
    padding: 15px 40px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.continue-shopping-btn:hover {
    background: #037007;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(4, 138, 8, 0.3);
}

/* Cart Content */
.cart-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
}

/* Cart Items */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cart-item {
    display: grid;
    grid-template-columns: 40px 120px 1fr 150px 170px 90px;
    gap: 20px;
    align-items: center;
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.item-checkbox-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item .item-checkbox {
    width: 20px;
    height: 20px;
}

.cart-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.item-image {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.item-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.item-name {
    font-size: 1.1em;
    color: #333;
    font-weight: 600;
    line-height: 1.4;
}

.item-brand {
    color: #666;
    font-size: 0.9em;
}

.item-price {
    font-size: 1.2em;
    color: #048a08;
    font-weight: 700;
}

/* Variations (compact + responsive) */
.item-variations-wrapper {
    margin-top: 6px;
}

/* Default: show inline variations, hide dropdown */
.item-variations-desktop {
    display: block;
}

.item-variations-mobile {
    display: none;
}

.item-variations {
    list-style: none;
    padding: 0;
    margin: 6px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.item-variations li {
    font-size: 0.78em;
    color: #4b5563;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    padding: 4px 8px;
    border-radius: 999px;
    line-height: 1.25;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Mobile dropdown styling */
.item-variations-mobile {
    margin-top: 8px;
}

.item-variations-mobile summary {
    cursor: pointer;
    user-select: none;
    font-size: 0.78em;
    font-weight: 600;
    color: #374151;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    padding: 8px 10px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.item-variations-mobile summary::-webkit-details-marker {
    display: none;
}

.item-variations-mobile summary .variations-summary-text {
    flex: 1;
    min-width: 0;
}

.item-variations-mobile summary .variations-summary-icon {
    color: #6b7280;
    font-size: 0.95em;
    transition: transform 0.2s ease;
}

.item-variations-mobile[open] summary .variations-summary-icon {
    transform: rotate(180deg);
}

.item-variations-mobile .item-variations {
    margin-top: 8px;
}

/* Quantity Controls */
.item-quantity {
    display: flex;
    justify-content: center;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 3px;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.qty-btn {
    background: #f5f5f5;
    border: none;
    width: 28px;
    height: 32px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #333;
    font-size: 0.85em;
}

.qty-btn:hover {
    background: #048a08;
    color: white;
}

.qty-input {
    width: 40px;
    height: 32px;
    text-align: center;
    border: none;
    font-size: 0.9em;
    font-weight: 600;
    color: #333;
}

.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.item-total {
    text-align: right;
}

.total-price {
    font-size: 1.3em;
    font-weight: 700;
    color: #333;
    white-space: nowrap;
}

.item-remove {
    display: flex;
    justify-content: center;
}

.item-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    min-width: 90px;
}

.wishlist-btn {
    background: transparent;
    border: none;
    color: #ff4444;
    cursor: pointer;
    font-size: 1.1em;
    padding: 8px;
    transition: all 0.3s ease;
}

.wishlist-btn:hover {
    color: #ff0000;
    transform: scale(1.2);
}

.wishlist-btn .fa-heart {
    transition: all 0.3s ease;
}

.wishlist-btn.active .fa-heart {
    font-weight: 900;
    color: #ff0000;
}

.wishlist-btn:hover .fa-heart {
    font-weight: 900;
}

.remove-btn {
    background: transparent;
    border: none;
    color: #ff4444;
    cursor: pointer;
    font-size: 1.2em;
    padding: 10px;
    transition: all 0.3s ease;
}

.remove-btn:hover {
    color: #cc0000;
    transform: scale(1.2);
}

/* Cart Summary */
.cart-summary {
    background: white;
    padding: 30px;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.cart-summary h2 {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #333;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 1em;
    color: #666;
}

.summary-row.total {
    font-size: 1.3em;
    font-weight: 700;
    color: #333;
    margin-top: 15px;
}

.free-shipping {
    color: #048a08;
    font-weight: 600;
}

.total-amount {
    color: #048a08;
}

.summary-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 20px 0;
}

.checkout-btn {
    display: block;
    width: 100%;
    background: #048a08;
    color: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1em;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.checkout-btn:hover {
    background: #037007;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(4, 138, 8, 0.3);
}

.checkout-btn.disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.checkout-btn.disabled:hover {
    background: #ccc;
    transform: none;
    box-shadow: none;
}

.checkout-btn i {
    margin-right: 8px;
}

.continue-shopping {
    display: block;
    text-align: center;
    color: #666;
    text-decoration: none;
    margin-top: 15px;
    padding: 10px;
    transition: all 0.3s ease;
}

.continue-shopping:hover {
    color: #048a08;
}

.continue-shopping i {
    margin-right: 5px;
}

.clear-cart-form {
    margin-top: 20px;
}

.clear-cart-btn {
    width: 100%;
    background: transparent;
    color: #ff4444;
    padding: 12px;
    border: 1px solid #ff4444;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.clear-cart-btn:hover {
    background: #ff4444;
    color: white;
}

/* Tablet View */
@media (max-width: 1024px) {
    .cart-content {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        position: static;
    }

    .cart-item {
        grid-template-columns: 100px 1fr 140px 120px 80px;
        gap: 15px;
        padding: 15px;
    }

    .item-image {
        width: 100px;
        height: 100px;
    }

    .item-name {
        font-size: 1em;
    }
}

/* Mobile View */
@media (max-width: 768px) {
    .cart-container {
        padding: 20px 10px;
    }

    .cart-header h1 {
        font-size: 1.4em;
        padding: 20px 10px 0px 0;
    }

    .item-name{
        font-size: 0.75em;
    }

    .item-brand {
        font-size: 0.7em;
    }
    
    .item-price {
        font-size: 0.9em;
    }

    /* Variations: use dropdown on mobile */
    .item-variations-desktop {
        display: none;
    }

    .item-variations-mobile {
        display: block;
    }

    .item-variations li {
        font-size: 0.72em;
        padding: 4px 7px;
        white-space: normal;
    }

    .summary-row {
        font-size: 0.9em;
    }

    .cart-item {
        grid-template-columns: 30px 80px 1fr auto;
        grid-template-rows: auto auto auto;
        gap: 8px;
        padding: 12px;
    }

    .item-checkbox-container {
        grid-column: 1;
        grid-row: 1 / 4;
        align-self: center;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .cart-item .item-checkbox {
        margin: 0 auto;
        width: 16px;
        height: 16px;
    }

    .item-image {
        width: 80px;
        height: 80px;
        grid-column: 2;
        grid-row: 1 / 4;
    }

    .item-details {
        text-align: left;
        grid-column: 3;
        grid-row: 1 / 4;
    }

    .item-total {
        text-align: right;
        grid-column: 4;
        grid-row: 1;
        align-self: start;
    }
    
    .item-total .total-price {
        font-size: 1em;
    }

    .item-quantity {
        grid-column: 4;
        grid-row: 2;
        justify-content: flex-end;
        align-self: center;
    }
    
    .item-quantity .qty-btn {
        width: 24px;
        height: 28px;
        font-size: 0.75em;
    }
    
    .item-quantity .qty-input {
        width: 35px;
        height: 28px;
        font-size: 0.8em;
    }

    .item-actions {
        grid-column: 4;
        grid-row: 3;
        justify-content: flex-end;
        align-self: end;
        gap: 3px;
    }

    .wishlist-btn,
    .remove-btn {
        padding: 6px;
        font-size: 0.95em;
    }

    .cart-summary {
        padding: 20px;
    }

    .empty-cart {
        padding: 60px 20px;
    }

    .empty-cart i {
        font-size: 4em;
    }

    .empty-cart h2 {
        font-size: 1.5em;
    }
}

@media (max-width: 480px) {
    .cart-header h1 {
        font-size: 1.4em;
        padding: 20px 0px 0px 0;
    }

    .item-count {
        font-size: 1em;
    }
    
    .cart-item {
        grid-template-columns: 80px 1fr auto;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .cart-item.selected {
        background: #f0f9f0;
        border-color: #048a08;
        box-shadow: 0 2px 8px rgba(4, 138, 8, 0.2);
    }
    
    .item-checkbox-container {
        display: none;
    }
    
    .cart-item .item-checkbox {
        display: none;
    }
    
    .item-image {
        grid-column: 1;
    }
    
    .item-details {
        grid-column: 2;
    }
    
    .item-total {
        grid-column: 3;
    }
    
    .item-quantity {
        grid-column: 3;
    }
    
    .item-actions {
        grid-column: 3;
        justify-content: flex-start;
        gap: 6px;
        margin-top: 4px;
    }

    .item-name {
        font-size: 0.80em;
        padding: 20px 10px 0px 0;
    }

    .item-price,
    .total-price {
        font-size: 1.1em;
    }

    .item-variations-mobile summary {
        font-size: 0.75em;
        padding: 7px 9px;
        border-radius: 9px;
    }

    .item-variations li {
        font-size: 0.70em;
        padding: 3px 6px;
    }

    .cart-summary h2 {
        font-size: 1em;
    }

    .checkout-btn {
        font-size: 1em;
        padding: 12px;
    }
}
