/* Modern Cart Page Design */
.cart-container {
    padding-top: 40px;
    padding-bottom: 80px;
    max-width: 1400px;
    margin: 0 auto;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.cart-header h1 {
    font-size: 2.5rem;
    color: var(--primary-dark);
    font-weight: 700;
    margin: 0;
}

.continue-shopping-link {
    font-weight: 600;
    color: var(--primary-blue);
    text-decoration: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    background: var(--bg-light);
}

.continue-shopping-link:hover {
    color: var(--primary-dark);
    background: var(--border-color);
    transform: translateX(-3px);
}

.cart-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
    align-items: flex-start;
}

/* Cart Items List - Modern Card Design */
.cart-items-list {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.cart-list-header {
    display: grid;
    grid-template-columns: 3fr 1fr 1.5fr 1fr 0.5fr;
    padding: 20px 30px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cart-list-header div:nth-child(3),
.cart-list-header div:nth-child(4) {
    text-align: center;
}

.cart-list-header div:last-child {
    text-align: right;
}

#cart-items-container {
    padding: 20px 30px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.cart-item {
    display: grid;
    grid-template-columns: 3fr 1fr 1.5fr 1fr 0.5fr;
    align-items: center;
    gap: 20px;
    padding: 25px 0;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.cart-item:hover {
    background: var(--bg-light);
}

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

.cart-item-product {
    display: flex;
    align-items: center;
    gap: 20px;
}

.cart-item-image {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    background: var(--bg-light);
}

.cart-item-details {
    flex: 1;
    min-width: 0;
}

.cart-item-details .item-name {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    text-decoration: none;
    margin-bottom: 8px;
    font-size: 1.05rem;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.cart-item-details .item-name:hover {
    color: var(--primary-blue);
}

.cart-item-details .item-variant {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.cart-item-price,
.cart-item-total-price {
    font-weight: 600;
    color: var(--text-dark);
    text-align: center;
    font-size: 1.05rem;
}

.cart-item-total-price {
    color: var(--primary-blue);
    font-size: 1.15rem;
    font-weight: 700;
}

.cart-item-quantity {
    display: flex;
    justify-content: center;
    align-items: center;
}

.quantity-control {
    display: flex;
    align-items: center;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    background: var(--white);
}

.quantity-control button {
    background-color: var(--bg-light);
    border: none;
    color: var(--text-dark);
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.quantity-control button:hover:not(:disabled) {
    background-color: var(--primary-blue);
    color: var(--white);
}

.quantity-control button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.quantity-control input {
    width: 50px;
    height: 36px;
    border: none;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    -moz-appearance: textfield;
    background: var(--white);
}

.quantity-control input::-webkit-outer-spin-button,
.quantity-control input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cart-item-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
    flex-direction: column;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 8px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.action-btn:hover {
    background: var(--bg-light);
    color: var(--primary-blue);
    transform: translateY(-1px);
}

.save-later-btn:hover {
    color: #e91e63;
    background: rgba(233, 30, 99, 0.1);
}

.remove-item-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-item-btn:hover {
    color: var(--error-red);
    background: rgba(220, 53, 69, 0.1);
    transform: scale(1.1);
}

/* Order Summary - Modern Card */
.cart-summary-wrapper {
    position: sticky;
    top: 140px;
    align-self: start;
}

.cart-summary {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 30px;
    border: 1px solid var(--border-color);
}

.cart-summary h3 {
    font-size: 1.5rem;
    color: var(--primary-dark);
    font-weight: 700;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    margin-bottom: 18px;
    padding: 8px 0;
}

.summary-row span:first-child {
    color: var(--text-muted);
    font-weight: 500;
}

.summary-row span:last-child {
    color: var(--text-dark);
    font-weight: 600;
    text-align: right;
}

.summary-row.total {
    font-size: 1.3rem;
    font-weight: 700;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
    margin-top: 20px;
    margin-bottom: 25px;
}

.summary-row.total span:first-child {
    color: var(--text-dark);
}

.summary-row.total span:last-child {
    color: var(--primary-blue);
    font-size: 1.4rem;
}

.summary-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: linear-gradient(135deg, rgba(0, 82, 255, 0.05) 0%, rgba(0, 82, 255, 0.02) 100%);
    border: 1px solid rgba(0, 82, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.summary-note i {
    color: var(--primary-blue);
    margin-top: 2px;
    flex-shrink: 0;
}

.checkout-btn {
    width: 100%;
    margin-top: 10px;
    padding: 16px;
    font-size: 1.05rem;
    font-weight: 600;
    gap: 10px;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.checkout-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 82, 255, 0.3);
}

.checkout-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
}

.clear-cart-btn {
    width: 100%;
    margin-top: 12px;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.clear-cart-btn:hover {
    background: var(--error-red);
    color: var(--white);
    border-color: var(--error-red);
}

/* Empty Cart Message */
.info-message {
    text-align: center;
    padding: 80px 40px;
    background: var(--white);
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    color: var(--text-muted);
}

.info-message i {
    font-size: 4rem;
    color: var(--primary-blue);
    opacity: 0.3;
    margin-bottom: 20px;
}

.info-message h3 {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 15px;
    font-weight: 700;
}

/* Saved Items Section */
.saved-items-section {
    margin-top: 50px;
    padding: 30px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.saved-items-section h3 {
    font-size: 1.5rem;
    color: var(--primary-dark);
    font-weight: 700;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.saved-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.saved-item-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: var(--white);
}

.saved-item-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-blue);
}

.saved-item-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: var(--bg-light);
}

.saved-item-info {
    padding: 18px;
}

.saved-item-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.saved-item-info .variant-name {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.saved-item-info .price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 15px;
}

.saved-item-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.saved-item-buttons .btn-sm {
    padding: 10px 14px;
    font-size: 0.9rem;
    border-radius: 8px;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 5px 0;
    transition: color 0.2s ease;
}

.btn-text:hover {
    color: var(--error-red);
}

/* Skeleton Loading */
.cart-item-skeleton {
    display: grid;
    grid-template-columns: 100px 3fr 1fr 1.5fr 1fr 0.5fr;
    align-items: center;
    gap: 20px;
    padding: 25px 0;
}

.skeleton-box,
.skeleton-line {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite linear;
    border-radius: 8px;
}

.skeleton-box {
    height: 100px;
    width: 100px;
}

.skeleton-text-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skeleton-line {
    height: 20px;
}

.skeleton-line.short {
    width: 60%;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Mobile Responsive Design */
@media (max-width: 992px) {
    .cart-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .cart-summary-wrapper {
        position: static;
        top: auto;
    }
    
    .cart-summary {
        position: sticky;
        top: 80px;
        z-index: 10;
        margin-bottom: 0;
    }

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

    .cart-item {
        grid-template-columns: 100px 1fr;
        grid-template-areas:
            "img details"
            "img price"
            "img qty"
            "img total"
            "img actions";
        padding: 20px;
        border: 1px solid var(--border-color);
        border-radius: 12px;
        gap: 15px;
        margin-bottom: 15px;
        background: var(--white);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }

    .cart-item-product {
        grid-area: img;
        flex-direction: column;
    }

    .cart-item-details {
        grid-area: details;
    }

    .cart-item-price {
        grid-area: price;
        text-align: left;
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--text-dark);
    }

    .cart-item-quantity {
        grid-area: qty;
        justify-content: flex-start;
        margin-top: 10px;
    }

    .cart-item-total-price {
        grid-area: total;
        text-align: left;
        font-size: 1.2rem;
        font-weight: 700;
        color: var(--primary-blue);
        margin-top: 10px;
    }

    .cart-item-actions {
        grid-area: actions;
        flex-direction: row;
        justify-content: flex-start;
        margin-top: 10px;
        gap: 10px;
    }

    .cart-item-price::before {
        content: "Price: ";
        color: var(--text-muted);
        font-weight: 500;
        margin-right: 8px;
    }

    .cart-item-total-price::before {
        content: "Total: ";
        color: var(--text-muted);
        font-weight: 500;
        margin-right: 8px;
    }

    #cart-items-container {
        padding: 15px;
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
    
    .cart-item-image {
        width: 100px;
        height: 100px;
    }
    
    .cart-item-details .item-name {
        font-size: 1rem;
        line-height: 1.4;
        margin-bottom: 6px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .saved-items-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .cart-container {
        padding-top: 20px;
        padding-bottom: 40px;
    }

    .cart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-bottom: 25px;
    }

    .cart-header h1 {
        font-size: 2rem;
    }

    .continue-shopping-link {
        width: 100%;
        justify-content: center;
    }

    .cart-item {
        grid-template-columns: 80px 1fr;
        padding: 15px;
        gap: 12px;
    }

    .cart-item-image {
        width: 80px;
        height: 80px;
    }

    .cart-item-details .item-name {
        font-size: 0.95rem;
    }

    .quantity-control input {
        width: 40px;
        height: 32px;
        font-size: 0.9rem;
    }

    .quantity-control button {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .cart-summary {
        padding: 20px;
    }

    .summary-row {
        font-size: 0.95rem;
    }

    .summary-row.total {
        font-size: 1.15rem;
    }

    .summary-row.total span:last-child {
        font-size: 1.25rem;
    }

    .saved-items-grid {
        grid-template-columns: 1fr;
    }
}
