/* Cart Page Styles */

.cart-page {
    padding: 60px 0;
    background-color: #f9f9f9;
}

.page-title {
    font-size: 32px;
    margin-bottom: 30px;
    text-align: center;
    color: #333;
    font-weight: 600;
}

/* Cart Grid Layout */
.cart-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    grid-gap: 30px;
}

@media (max-width: 992px) {
    .cart-grid {
        grid-template-columns: 1fr;
    }
}

/* Cart Items Section */
.cart-items {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 0;
    overflow: hidden;
}

.cart-header {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr 50px;
    padding: 15px 20px;
    background-color: #f0f0f0;
    font-weight: 600;
    color: #444;
}

.cart-item {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr 50px;
    padding: 20px;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.cart-item-details {
    display: flex;
    align-items: center;
}

.item-image {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    margin-right: 15px;
    background-color: #f0f0f0;
    position: relative;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-quantity {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #38a169;
    color: white;
    font-size: 12px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-info {
    flex: 1;
}

.item-name {
    font-weight: 500;
    margin-bottom: 5px;
}

.item-name a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s;
}

.item-name a:hover {
    color: #38a169;
}

.item-subscription {
    margin-top: 8px;
}

.subscription-tag {
    font-size: 12px;
    background-color: #ebf8ff;
    color: #3182ce;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
}

.subscription-interval {
    margin-top: 8px;
    font-size: 14px;
}

.interval-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.interval-form select {
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.item-discount {
    margin-top: 5px;
    font-size: 14px;
}

.regular-price {
    text-decoration: line-through;
    color: #888;
    margin-right: 8px;
}

.savings {
    color: #e53e3e;
}

.bundle-savings {
    margin-top: 5px;
    font-size: 14px;
    color: #38a169;
}

.subscription-toggle {
    margin-top: 8px;
}

.btn-link {
    background: none;
    border: none;
    color: #3182ce;
    padding: 0;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
}

.btn-link:hover {
    color: #2c5282;
}

.cart-item-price,
.cart-item-total {
    font-weight: 500;
    color: #333;
}

.cart-item-quantity {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Quantity Selector */
.quantity-selector {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    width: 100px;
}

.quantity-btn {
    width: 30px;
    height: 36px;
    background-color: #f0f0f0;
    border: none;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.quantity-btn:hover {
    background-color: #e0e0e0;
}

.quantity-selector input {
    width: 40px;
    height: 36px;
    border: none;
    padding: 0;
    text-align: center;
    font-size: 14px;
    -moz-appearance: textfield;
}

.quantity-selector input::-webkit-outer-spin-button,
.quantity-selector input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.update-btn {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
}

.cart-item-remove {
    text-align: center;
}

.remove-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 16px;
    cursor: pointer;
    transition: color 0.2s;
}

.remove-btn:hover {
    color: #e53e3e;
}

.cart-actions {
    display: flex;
    justify-content: space-between;
    padding: 20px;
}

.clear-cart-form {
    display: inline-block;
}

.btn-text {
    background: none;
    border: none;
    color: #666;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

.btn-text:hover {
    color: #e53e3e;
}

/* Cart Summary */
.cart-summary {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 25px;
    position: sticky;
    top: 20px;
}

.cart-summary h2 {
    font-size: 22px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.cart-coupon {
    margin-bottom: 25px;
}

.coupon-input {
    display: flex;
    gap: 10px;
}

.coupon-input input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.remove-coupon {
    padding: 8px 15px;
    font-size: 14px;
    font-weight: 500;
}

.summary-lines {
    margin-bottom: 20px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 15px;
}

.savings {
    color: #38a169;
}

.discount {
    color: #e53e3e;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    font-size: 18px;
    font-weight: 600;
}

.free-shipping {
    color: #38a169;
}

.free-shipping-message {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #f0fff4;
    border: 1px solid #c6f6d5;
    border-radius: 4px;
    padding: 15px;
    margin: 20px 0;
    color: #2f855a;
}

.free-shipping-message i {
    font-size: 18px;
}

.free-shipping-message p {
    margin: 0;
    font-size: 14px;
}

.checkout-btn {
    margin-top: 20px;
}

.secure-checkout {
    text-align: center;
    margin: 20px 0;
    color: #666;
    font-size: 14px;
}

.secure-checkout i {
    margin-right: 5px;
    color: #38a169;
}

.payment-icons {
    display: flex;
    justify-content: center;
    gap: 10px;
    font-size: 24px;
    color: #999;
}

/* Empty Cart */
.empty-cart {
    text-align: center;
    padding: 60px 20px;
}

.empty-cart-message {
    max-width: 500px;
    margin: 0 auto;
}

.empty-cart-message i {
    font-size: 60px;
    color: #ccc;
    margin-bottom: 20px;
}

.empty-cart-message h2 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #333;
}

.empty-cart-message p {
    color: #666;
    margin-bottom: 30px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .cart-header {
        display: none;
    }
    
    .cart-item {
        grid-template-columns: 1fr;
        grid-gap: 15px;
    }
    
    .cart-item-price,
    .cart-item-quantity,
    .cart-item-total,
    .cart-item-remove {
        padding-left: 95px; /* Align with item details */
    }
    
    .cart-item-quantity {
        flex-direction: row;
        align-items: center;
    }
    
    .cart-item-price::before,
    .cart-item-quantity::before,
    .cart-item-total::before {
        content: attr(data-label);
        font-weight: 600;
        margin-right: 10px;
    }
    
    .cart-item-price::before {
        content: "Price:";
    }
    
    .cart-item-quantity::before {
        content: "Quantity:";
    }
    
    .cart-item-total::before {
        content: "Total:";
    }
    
    .cart-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .cart-actions .btn,
    .cart-actions .btn-text {
        width: 100%;
        text-align: center;
    }
}