/* ========================================
   CART PAGE STYLES
   ======================================== */

/* Cart Section */
.cart-section {
    padding: 60px 0;
    background: #fafafa;
}

.page-title {
    font-size: 32px;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    margin-bottom: 40px;
    color: var(--primary-color);
}

/* Empty Cart */
.empty-cart {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.empty-cart-icon {
    color: #e0e0e0;
    margin-bottom: 30px;
}

.empty-cart h2 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #666;
}

.empty-cart p {
    color: #999;
    margin-bottom: 30px;
}

/* Cart Content */
.cart-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

/* Cart Table */
.cart-table {
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.cart-table thead {
    background: #f8f8f8;
}

.cart-table th {
    padding: 20px;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    border-bottom: 2px solid #e0e0e0;
}

.cart-table td {
    padding: 20px;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
}

/* Cart Item Image - FIX IMPORTANT */
.cart-item-image {
    width: 100px;
}

.cart-item-image a {
    display: block;
    width: 100px;
    height: 100px;
    position: relative;
    background: #f8f8f8;
    border-radius: 8px;
    overflow: hidden;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Images entièrement visibles */
    object-position: center;
}

.no-image-small {
    width: 100px;
    height: 100px;
    background: #f0f0f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
}

/* Cart Item Details */
.cart-item-details h3 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
}

.cart-item-details h3 a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.cart-item-details h3 a:hover {
    color: var(--accent-color);
}

.sku {
    font-size: 13px;
    color: #999;
    margin: 5px 0;
}

.stock-warning {
    font-size: 13px;
    color: #ff6b6b;
    font-weight: 500;
}

/* Quantity Controls */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    width: fit-content;
}

.qty-btn {
    width: 36px;
    height: 36px;
    background: #f8f8f8;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #666;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: var(--accent-color);
    color: white;
}

.qty-input {
    width: 60px;
    height: 36px;
    border: none;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    background: white;
}

.qty-input:focus {
    outline: none;
}

/* Remove button */
.btn-remove {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.btn-remove:hover {
    background: #ffebee;
    color: #ff5252;
}

/* Cart Actions */
.cart-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

/* Cart Summary */
.cart-summary {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.cart-summary h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    font-size: 15px;
    color: #666;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    padding: 20px 0;
    margin-top: 15px;
    border-top: 2px solid #e0e0e0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.shipping-info {
    color: #999;
    font-size: 14px;
}

/* Promo Code */
.promo-code {
    border: 1px solid #ddd;
    border-radius: 8px;
    margin: 20px 0;
}

.promo-code details {
    padding: 0;
}

.promo-code summary {
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    user-select: none;
    background: #f8f8f8;
}

.promo-code summary:hover {
    background-color: #f0f0f0;
}

.promo-form {
    padding: 16px;
    display: flex;
    gap: 8px;
}

.promo-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.promo-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.1);
}

.btn-secondary {
    padding: 10px 20px;
    background: #666;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #555;
}

.applied-coupon {
    padding: 12px 16px;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #c3e6cb;
    border-radius: 8px;
}

.coupon-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.coupon-code {
    background: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-weight: bold;
    color: #28a745;
    border: 1px solid #28a745;
}

.btn-remove-coupon {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-remove-coupon:hover {
    background-color: #dc3545;
    color: white;
}

.summary-line.text-success {
    color: #28a745 !important;
    font-weight: 600;
}

/* Checkout Button */
.checkout-button {
    margin-top: 20px;
}

.btn-large {
    padding: 16px 30px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
    display: block;
    text-align: center;
}

.checkout-info {
    text-align: center;
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

/* Payment Methods */
.payment-methods {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.payment-methods p {
    font-size: 14px;
    color: #999;
    margin-bottom: 10px;
}

.payment-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.payment-icon {
    font-size: 13px;
    color: #666;
    padding: 5px 10px;
    background: #f8f8f8;
    border-radius: 6px;
}

/* Shipping Info Block */
.shipping-info-block {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #666;
}

.info-item svg {
    color: var(--accent-color);
}

/* Recommended Products Section */
.recommended-products {
    padding: 60px 0;
    background: white;
}

.recommended-products h2 {
    text-align: center;
    font-size: 28px;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 40px;
    color: var(--primary-color);
}

.recommended-products .products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Product Card dans les recommandations */
.recommended-products .product-card {
    background: white;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    max-width: 280px;
    width: 100%;
}

.recommended-products .product-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
}

.recommended-products .product-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recommended-products .product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Images entièrement visibles */
    object-position: center;
    transition: transform 0.3s ease;
}

.recommended-products .product-card:hover .product-image img {
    transform: scale(1.08);
}

.recommended-products .no-image {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f8f8;
    color: #999;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.recommended-products .badge {
    position: absolute;
    top: 10px;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 20px;
    z-index: 2;
    color: white;
}

.recommended-products .badge-featured {
    left: 10px;
    background: var(--accent-color);
}

.recommended-products .badge-new {
    left: 10px;
    background: #4CAF50;
}

.recommended-products .badge-sale {
    right: 10px;
    background: #FF5252;
}

.recommended-products .product-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.recommended-products .product-card:hover .product-overlay {
    transform: translateY(0);
}

.recommended-products .btn-quick-add {
    background: white;
    color: var(--primary-color);
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.recommended-products .btn-quick-add:hover {
    background: var(--accent-color);
    color: white;
}

.recommended-products .product-info {
    padding: 12px;
}

.recommended-products .product-title {
    font-size: 14px;
    font-weight: 400;
    margin-bottom: 8px;
    color: var(--primary-color);
    line-height: 1.3;
    height: 36px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.recommended-products .product-price {
    display: flex;
    align-items: center;
    gap: 10px;
}

.recommended-products .price-current {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
}

.recommended-products .price-old {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
}

/* Responsive */
@media (max-width: 1200px) {
    .recommended-products .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .cart-content {
        grid-template-columns: 1fr;
    }
    
    .cart-summary {
        position: static;
        margin-top: 30px;
    }
    
    .recommended-products .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    .recommended-products .product-image {
        height: 180px;
    }
}

@media (max-width: 768px) {
    .cart-table {
        font-size: 14px;
    }
    
    .cart-table th,
    .cart-table td {
        padding: 12px;
    }
    
    .cart-item-image a {
        width: 80px;
        height: 80px;
    }
    
    .no-image-small {
        width: 80px;
        height: 80px;
    }
    
    .cart-actions {
        flex-direction: column;
    }
    
    .recommended-products .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .recommended-products .product-card {
        max-width: none;
    }
    
    .recommended-products .product-image {
        height: 150px;
    }
}

@media (max-width: 576px) {
    .cart-table th:nth-child(1),
    .cart-table td:nth-child(1) {
        display: none; /* Masquer colonne images sur mobile */
    }
    
    .cart-table {
        font-size: 13px;
    }
    
    .quantity-controls {
        transform: scale(0.9);
    }
}

/* Animation pour les changements de total */
.summary-total.updated {
    animation: highlightTotal 1s ease;
}

@keyframes highlightTotal {
    0% { background-color: #fff3cd; }
    100% { background-color: transparent; }
}