/* Styles spécifiques pour la page produits */

/* Products Hero */
.products-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
}

.products-hero .hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.products-hero .hero-content p {
    font-size: 1.3rem;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
}

/* Advanced Filters */
.advanced-filters {
    background: white;
    padding: 30px 0;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 80px;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.advanced-filters .filters-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.advanced-filters .filters-left {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.advanced-filters .filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.advanced-filters .filter-group label {
    font-weight: 500;
    color: #2c3e50;
    white-space: nowrap;
}

.advanced-filters .filter-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    cursor: pointer;
    min-width: 120px;
    transition: border-color 0.3s;
}

.advanced-filters .filter-group select:focus {
    outline: none;
    border-color: #3498db;
}

.advanced-filters .filters-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Quantity Controls */
.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 25px;
    border: 1px solid #e9ecef;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: #3498db;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.qty-btn:hover {
    background: #2980b9;
    transform: scale(1.1);
}

.qty-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

.quantity {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
    color: #2c3e50;
    font-size: 16px;
}

/* Enhanced Product Cards */
.product-card .product-info {
    padding: 20px;
    position: relative;
}

.product-card .product-info .quantity-controls {
    margin: 10px 0;
}

/* Payment Modal */
.payment-modal .modal-content {
    max-width: 800px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

.payment-header {
    text-align: center;
    padding: 20px 0;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 30px;
}

.payment-header h2 {
    color: #2c3e50;
    font-size: 1.8rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.payment-header p {
    color: #6c757d;
    margin: 0;
}

.payment-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* Order Summary Section */
.order-summary-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    border: 1px solid #e9ecef;
}

.order-summary-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 600;
}

.order-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
}

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

.order-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.order-item-info {
    flex: 1;
}

.order-item-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 0.95rem;
}

.order-item-details {
    font-size: 13px;
    color: #6c757d;
}

.order-item-price {
    font-weight: 600;
    color: #e74c3c;
    font-size: 0.95rem;
}

.order-totals {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
}

.total-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.total-line.total-final {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    border-top: 1px solid #e9ecef;
    padding-top: 10px;
    margin-top: 10px;
}

/* Payment Methods Section */
.payment-methods-section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    border: 1px solid #e9ecef;
}

.payment-methods-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 600;
}

.payment-methods {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.payment-method {
    flex: 1;
    min-width: 120px;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.payment-method:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
}

.payment-method.selected {
    border-color: #667eea;
    background: #f0f4ff;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.2);
}

.payment-method i {
    font-size: 2rem;
    margin-bottom: 8px;
    display: block;
}

.payment-method.paypal i {
    color: #0070ba;
}

.payment-method.visa i {
    color: #1a1f71;
}

.payment-method.mastercard i {
    color: #eb001b;
}

.payment-method span {
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.9rem;
}

/* Payment Forms */
.payment-form {
    display: none;
    margin-top: 20px;
}

.payment-form.active {
    display: block;
    animation: fadeInUp 0.3s ease;
}

.payment-form .form-group {
    margin-bottom: 20px;
}

.payment-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.9rem;
}

.payment-form input,
.payment-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.payment-form input:focus,
.payment-form textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.btn-pay-card {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.btn-pay-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-pay-card:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.security-note {
    text-align: center;
    margin-top: 15px;
    font-size: 13px;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.security-note i {
    color: #27ae60;
}

/* Customer Info Section */
.customer-info-section {
    grid-column: 1 / -1;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.customer-info-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 600;
}

.customer-info-section .form-group {
    position: relative;
}

.customer-info-section input,
.customer-info-section textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.customer-info-section input:focus,
.customer-info-section textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.customer-info-section label {
    position: absolute;
    top: 15px;
    left: 15px;
    color: #6c757d;
    font-size: 14px;
    transition: all 0.3s ease;
    pointer-events: none;
    background: transparent;
    padding: 0 5px;
}

.customer-info-section input:focus + label,
.customer-info-section textarea:focus + label,
.customer-info-section input:valid + label,
.customer-info-section textarea:valid + label {
    top: -8px;
    left: 10px;
    font-size: 12px;
    color: #667eea;
    background: white;
}

/* PayPal Button */
#paypal-button-container {
    margin: 20px 0;
    text-align: center;
}

/* Payment Messages */
.payment-message {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

.payment-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.payment-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.payment-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Messages de notification */
.payment-message {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    min-width: 300px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.payment-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.payment-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.payment-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.payment-message i {
    font-size: 1.2rem;
}

/* Erreurs de carte */
.card-errors {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    padding: 10px 15px;
    margin: 10px 0;
    font-size: 14px;
    display: none;
}

/* Enhanced Cart Modal */
.enhanced-cart .modal-content {
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #e9ecef;
}

.cart-header h2 {
    margin: 0;
    color: #2c3e50;
}

.cart-count-badge {
    background: #3498db;
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 600;
}

.cart-body {
    padding: 20px 0;
    min-height: 200px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    position: relative;
}

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

.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

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

.cart-item-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 14px;
    line-height: 1.3;
}

.cart-item-price {
    color: #e74c3c;
    font-weight: 600;
    font-size: 14px;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.cart-qty-btn {
    width: 25px;
    height: 25px;
    border: none;
    border-radius: 50%;
    background: #f8f9fa;
    color: #2c3e50;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.cart-qty-btn:hover {
    background: #3498db;
    color: white;
}

.cart-qty-btn:disabled {
    background: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
}

.cart-item-qty {
    min-width: 25px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
}

.cart-item-remove {
    position: absolute;
    top: 10px;
    right: 0;
    background: #e74c3c;
    color: white;
    border: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.3s;
}

.cart-item-remove:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.cart-empty i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #dee2e6;
}

.cart-empty p {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.cart-footer {
    border-top: 1px solid #e9ecef;
    padding: 20px 0;
}

.cart-summary {
    margin-bottom: 20px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.summary-line.total {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    border-top: 1px solid #e9ecef;
    padding-top: 10px;
    margin-top: 10px;
}

.cart-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.cart-actions .btn-secondary {
    flex: 1;
    min-width: 120px;
}

.whatsapp-checkout {
    background: #25D366;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    flex: 1;
    min-width: 150px;
}

.whatsapp-checkout:hover {
    background: #20BA5A;
    transform: translateY(-1px);
}

/* Stock Status Badges */
.badge.low-stock {
    background: #f39c12;
    color: white;
}

.badge.pre-order {
    background: #9b59b6;
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .products-hero .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .advanced-filters .filters-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .advanced-filters .filters-left,
    .advanced-filters .filters-right {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .advanced-filters .filter-group {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }
    
    .advanced-filters .filter-group select {
        min-width: auto;
    }
    
    .quantity-controls {
        margin: 10px 0;
        padding: 6px;
    }
    
    .qty-btn {
        width: 25px;
        height: 25px;
        font-size: 14px;
    }
    
    .quantity {
        font-size: 14px;
    }
    
    .cart-actions {
        flex-direction: column;
    }
    
    .cart-actions .btn-secondary,
    .whatsapp-checkout {
        width: 100%;
    }
    
    /* Payment Modal Responsive */
    .payment-modal .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .payment-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .payment-methods {
        flex-direction: column;
    }
    
    .payment-method {
        min-width: auto;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .customer-info-section {
        grid-column: 1;
    }
    
    .enhanced-cart .modal-content {
        width: 95%;
        margin: 5% auto;
    }
}

@media (max-width: 480px) {
    .products-hero .hero-content h1 {
        font-size: 2rem;
    }
    
    .products-hero .hero-content p {
        font-size: 1.1rem;
    }
    
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 15px 0;
    }
    
    .cart-item-image {
        width: 100%;
        height: 120px;
        object-fit: cover;
    }
    
    .cart-item-info {
        width: 100%;
    }
    
    .cart-item-remove {
        position: static;
        align-self: flex-end;
    }
    
    .whatsapp-body {
        padding: 15px 0;
    }
    
    .order-summary,
    .customer-info {
        padding: 15px;
    }
}

/* Animation pour les quantités */
.quantity-update {
    animation: quantityPulse 0.3s ease-in-out;
}

@keyframes quantityPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Animation pour l'ajout au panier */
.add-to-cart-animation {
    animation: addToCart 0.5s ease-in-out;
}

@keyframes addToCart {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); background: #27ae60; }
    100% { transform: scale(1); }
}

/* Loading state pour WhatsApp */
.whatsapp-pay-btn.loading {
    background: #95a5a6;
    cursor: not-allowed;
}

.whatsapp-pay-btn.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Success state */
.whatsapp-pay-btn.success {
    background: #27ae60;
}

.whatsapp-pay-btn.success i {
    animation: checkmark 0.5s ease-in-out;
}

@keyframes checkmark {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Focus styles pour l'accessibilité */
.qty-btn:focus,
.whatsapp-pay-btn:focus,
.whatsapp-checkout:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .advanced-filters,
    .quantity-controls,
    .product-actions,
    .whatsapp-modal,
    .cart-modal {
        display: none;
    }
    
    .product-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
