/* 
   Kanz Ennakhil - Style du panier
   Couleurs : 
   - Orange clair: #F79E1B
   - Orange foncé: #E44D26
   - Fond blanc: #FFFFFF
*/

/* ===== Icône du panier ===== */
.cart-icon {
    position: relative;
    font-size: 1.2rem;
    margin-left: 15px;
}

.cart-counter {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #E44D26;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s ease;
}

.cart-counter.show {
    opacity: 1;
    transform: scale(1);
}

/* ===== Page Panier ===== */
.cart-section {
    padding: 60px 0;
}

.cart-empty {
    text-align: center;
    padding: 40px 0;
}

.cart-empty p {
    margin-bottom: 20px;
    color: #666;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.cart-table th {
    background-color: #f5f5f5;
    text-align: left;
    padding: 15px;
    font-weight: 600;
    color: #333;
}

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

.product-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 5px;
    overflow: hidden;
}

.product-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-details h4 {
    margin-bottom: 5px;
}

.product-details p {
    color: #666;
    font-size: 0.9rem;
}

.quantity-control {
    display: flex;
    align-items: center;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    background-color: #f5f5f5;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.quantity-btn:hover {
    background-color: #F79E1B;
    color: white;
}

.quantity-input {
    width: 40px;
    height: 30px;
    text-align: center;
    border: 1px solid #eee;
    margin: 0 5px;
    font-size: 0.9rem;
}

.product-price,
.product-subtotal {
    font-weight: 600;
    color: #333;
}

.remove-btn {
    background: none;
    border: none;
    color: #E44D26;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.remove-btn:hover {
    color: #F79E1B;
    transform: scale(1.2);
}

/* ===== Résumé de la commande ===== */
.cart-summary {
    background-color: #f9f9f9;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
}

.cart-summary h3 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.summary-label {
    color: #666;
}

.summary-value {
    font-weight: 600;
    color: #333;
}

.summary-total {
    font-size: 1.2rem;
    font-weight: 700;
    color: #E44D26;
    margin-top: 10px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.checkout-btn {
    margin-top: 20px;
    width: 100%;
    padding: 15px;
    font-size: 1rem;
}

/* ===== Notification ===== */
.notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #F79E1B;
    color: white;
    padding: 15px 20px;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Messages de formulaire ===== */
.form-message {
    padding: 15px;
    margin-top: 15px;
    border-radius: 5px;
}

.form-message.success {
    background-color: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
    border: 1px solid #4CAF50;
}

.form-message.error {
    background-color: rgba(244, 67, 54, 0.1);
    color: #F44336;
    border: 1px solid #F44336;
}

/* ===== Adaptation RTL pour l'arabe ===== */
.rtl .cart-counter {
    right: auto;
    left: -8px;
}

.rtl .cart-table th {
    text-align: right;
}

.rtl .summary-row {
    flex-direction: row-reverse;
}

.rtl .notification {
    right: auto;
    left: 30px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .cart-table thead {
        display: none;
    }
    
    .cart-table, 
    .cart-table tbody, 
    .cart-table tr, 
    .cart-table td {
        display: block;
        width: 100%;
    }
    
    .cart-table tr {
        margin-bottom: 20px;
        border: 1px solid #eee;
        border-radius: 5px;
        padding: 15px;
    }
    
    .cart-table td {
        text-align: right;
        position: relative;
        padding: 10px 0;
        border-bottom: none;
    }
    
    .cart-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 50%;
        font-weight: 600;
        text-align: left;
    }
    
    .rtl .cart-table td {
        text-align: left;
    }
    
    .rtl .cart-table td::before {
        left: auto;
        right: 0;
        text-align: right;
    }
    
    .product-thumbnail {
        margin: 0 auto;
    }
}