/**
 * Styles pour la page Panier - Design La Boutique de la Mémée
 * Couleurs: #142451 (bleu), #F0B9F0 (rose), #F2E2D0 (crème)
 */

/* ========================================
   MASQUER LE TITRE DE PAGE PAR DÉFAUT
   ======================================== */
.woocommerce-cart .entry-title,
.woocommerce-cart .page-title,
.woocommerce-cart h1.entry-title {
    display: none !important;
}

/* ========================================
   WRAPPER PRINCIPAL
   ======================================== */
.fdlm-cart-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ========================================
   HEADER DU PANIER
   ======================================== */
.fdlm-cart-header {
    text-align: center;
    margin-bottom: 40px;
}

.fdlm-cart-icon {
    width: 80px;
    height: 80px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.fdlm-cart-icon:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(240, 185, 240, 0.4);
}

.fdlm-cart-title {
    font-family: var(--fdlm-font-title);
    font-size: 32px;
    color: #142451;
    margin: 0 0 10px 0;
    letter-spacing: 1px;
}

.fdlm-cart-subtitle {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* ========================================
   CONTENU DU PANIER (2 colonnes)
   ======================================== */
.fdlm-cart-content {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 40px;
    align-items: start;
}

@media (max-width: 968px) {
    .fdlm-cart-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* ========================================
   LISTE DES ARTICLES
   ======================================== */
.fdlm-cart-items {
    background: #fff;
    border-radius: 0;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(20, 36, 81, 0.08);
}

/* Progress bar livraison */
.fdlm-shipping-progress {
    background: rgba(20, 36, 81, 0.03);
    padding: 15px 20px;
    margin-bottom: 25px;
    border: 1px solid rgba(20, 36, 81, 0.1);
}

.fdlm-shipping-progress-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.fdlm-shipping-icon {
    display: flex;
    align-items: center;
    color: #142451;
}

.fdlm-shipping-label {
    font-size: 14px;
    color: #142451;
}

.fdlm-shipping-progress-bar {
    height: 8px;
    background: #e8e8e8;
    overflow: hidden;
    margin-bottom: 8px;
}

.fdlm-shipping-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #142451, #1e3a6d);
    transition: width 0.5s ease;
}

.fdlm-shipping-free .fdlm-shipping-progress-fill {
    background: linear-gradient(90deg, #28a745, #34c759);
}

.fdlm-shipping-free .fdlm-shipping-label {
    color: #28a745;
    font-weight: 600;
}

.fdlm-shipping-free .fdlm-shipping-icon {
    color: #28a745;
}

.fdlm-shipping-progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
}

.fdlm-shipping-weight {
    font-weight: 600;
    color: #142451;
}

.fdlm-shipping-cost-notice {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(20, 36, 81, 0.08);
}

.fdlm-cart-table {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ========================================
   UN ARTICLE DU PANIER
   ======================================== */
.fdlm-cart-item {
    display: grid;
    grid-template-columns: 100px 1fr auto auto auto auto;
    gap: 20px;
    align-items: center;
    padding: 20px;
    background: #fafafa;
    border-radius: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fdlm-cart-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(20, 36, 81, 0.1);
}

@media (max-width: 768px) {
    .fdlm-cart-item {
        grid-template-columns: 80px 1fr auto;
        grid-template-rows: auto auto;
        gap: 15px;
        padding: 15px;
    }

    .fdlm-cart-item-price {
        display: none;
    }

    .fdlm-cart-item-price-mobile {
        display: block !important;
    }

    .fdlm-cart-item-quantity,
    .fdlm-cart-item-subtotal {
        grid-column: 2 / 3;
    }

    .fdlm-cart-item-remove {
        grid-column: 3;
        grid-row: 1 / 3;
    }
}

/* Image produit */
.fdlm-cart-item-image {
    width: 100px;
    height: 100px;
    border-radius: 0;
    overflow: hidden;
    background: #fff;
    border: 2px solid #F2E2D0;
}

.fdlm-cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fdlm-cart-item-image a {
    display: block;
    width: 100%;
    height: 100%;
}

@media (max-width: 768px) {
    .fdlm-cart-item-image {
        width: 80px;
        height: 80px;
    }
}

/* Détails produit */
.fdlm-cart-item-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.fdlm-cart-item-name {
    font-weight: 600;
    font-size: 16px;
    color: #142451;
}

.fdlm-cart-item-name a {
    color: #142451;
    text-decoration: none;
    transition: color 0.2s ease;
}

.fdlm-cart-item-name a:hover {
    color: #F0B9F0;
}

.fdlm-cart-item-meta {
    font-size: 13px;
    color: #666;
}

.fdlm-cart-item-meta dt,
.fdlm-cart-item-meta dd {
    display: inline;
    margin: 0;
}

.fdlm-cart-item-meta dt::after {
    content: ': ';
}

.fdlm-cart-item-meta p {
    margin: 2px 0;
}

.fdlm-cart-item-price-mobile {
    display: none;
    font-size: 14px;
    color: #142451;
    font-weight: 600;
    margin-top: 5px;
}

/* Prix unitaire */
.fdlm-cart-item-price {
    font-size: 15px;
    color: #666;
    white-space: nowrap;
}

/* Quantité */
.fdlm-cart-item-quantity {
    display: flex;
    align-items: center;
}

.fdlm-cart-item-quantity .quantity {
    display: flex;
    align-items: center;
    border: 2px solid #F2E2D0;
    border-radius: 0;
    overflow: hidden;
    background: #fff;
}

.fdlm-cart-item-quantity .quantity input[type="number"] {
    width: 50px;
    height: 40px;
    border: none;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #142451;
    background: transparent;
    -moz-appearance: textfield;
}

.fdlm-cart-item-quantity .quantity input[type="number"]::-webkit-outer-spin-button,
.fdlm-cart-item-quantity .quantity input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Boutons +/- quantité */
.fdlm-qty-btn {
    width: 32px;
    height: 40px;
    border: none;
    background: transparent;
    color: #142451;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s ease;
}

.fdlm-qty-btn:hover {
    background: rgba(20, 36, 81, 0.1);
}

/* Sous-total */
.fdlm-cart-item-subtotal {
    font-size: 18px;
    font-weight: 700;
    color: #142451;
    white-space: nowrap;
}

/* Bouton supprimer */
.fdlm-cart-item-remove {
    display: flex;
    align-items: center;
    justify-content: center;
}

.fdlm-remove-btn {
    width: 40px;
    height: 40px;
    border-radius: 0;
    background: #fff;
    border: 2px solid #F2E2D0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    transition: all 0.2s ease;
    cursor: pointer;
}

.fdlm-remove-btn:hover {
    background: #ff4444;
    border-color: #ff4444;
    color: #fff;
}

/* ========================================
   ACTIONS DU PANIER
   ======================================== */
.fdlm-cart-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #F2E2D0;
    flex-wrap: wrap;
}

/* Code promo */
.fdlm-coupon {
    display: flex;
    gap: 10px;
    flex: 1;
    max-width: 400px;
}

.fdlm-coupon-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #F2E2D0;
    border-radius: 0;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.fdlm-coupon-input:focus {
    outline: none;
    border-color: #F0B9F0;
}

.fdlm-coupon-input::placeholder {
    color: #999;
}

.fdlm-coupon-btn {
    padding: 12px 20px;
    background: #F2E2D0;
    border: none;
    border-radius: 0;
    font-size: 14px;
    font-weight: 600;
    color: #142451;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.fdlm-coupon-btn:hover {
    background: #F0B9F0;
}

/* Bouton mettre à jour */
.fdlm-update-cart-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: 2px solid #142451;
    border-radius: 0;
    font-size: 14px;
    font-weight: 600;
    color: #142451;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fdlm-update-cart-btn:hover {
    background: #142451;
    color: #fff;
}

.fdlm-update-cart-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 600px) {
    .fdlm-cart-actions {
        flex-direction: column;
    }

    .fdlm-coupon {
        width: 100%;
        max-width: none;
    }

    .fdlm-update-cart-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   SIDEBAR - TOTAUX
   ======================================== */
.fdlm-cart-sidebar {
    position: sticky;
    top: 120px;
}

.fdlm-cart-totals {
    background: linear-gradient(135deg, #F2E2D0 0%, #fff 100%);
    border-radius: 0;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(20, 36, 81, 0.08);
    border: 2px solid #F0B9F0;
}

.fdlm-totals-title {
    font-family: var(--fdlm-font-title);
    font-size: 24px;
    color: #142451;
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(20, 36, 81, 0.1);
}

/* Lignes des totaux */
.fdlm-totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(20, 36, 81, 0.08);
}

.fdlm-totals-label {
    font-size: 15px;
    color: #666;
}

.fdlm-totals-value {
    font-size: 15px;
    font-weight: 600;
    color: #142451;
}

.fdlm-totals-value .woocommerce-Price-amount {
    color: #142451;
}

/* Ligne total */
.fdlm-totals-total {
    border-bottom: none;
    margin-top: 10px;
    padding-top: 20px;
    border-top: 2px solid #142451;
}

.fdlm-totals-total .fdlm-totals-label {
    font-size: 18px;
    font-weight: 700;
    color: #142451;
}

.fdlm-totals-total .fdlm-totals-value {
    font-size: 24px;
    font-weight: 700;
    color: #142451;
}

/* Ligne coupon */
.fdlm-coupon-row .fdlm-totals-value {
    color: #28a745;
}

/* Ligne livraison */
.fdlm-shipping-row .fdlm-totals-value {
    text-align: right;
}

.fdlm-shipping-row .woocommerce-shipping-methods {
    list-style: none;
    padding: 0;
    margin: 0;
}

.fdlm-shipping-row .woocommerce-shipping-methods li {
    margin-bottom: 5px;
}

.fdlm-shipping-row .woocommerce-shipping-methods label {
    font-size: 14px;
}

/* Mentions TTC/TVA */
.fdlm-totals-mentions {
    font-size: 11px;
    color: #999;
    font-style: italic;
    text-align: center;
    margin-top: 15px;
    padding-top: 10px;
    line-height: 1.4;
}

/* Connexion/inscription invité */
.fdlm-cart-login-prompt {
    background: rgba(20, 36, 81, 0.03);
    border: 1px solid rgba(20, 36, 81, 0.1);
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.fdlm-login-prompt-text {
    font-size: 14px;
    color: #142451;
    margin: 0 0 12px 0;
    font-weight: 500;
}

.fdlm-cart-login-buttons {
    display: flex;
    gap: 10px;
}

.fdlm-btn-login {
    flex: 1;
    display: block;
    padding: 10px 16px;
    background: #142451;
    color: #fff !important;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.fdlm-btn-login:hover {
    background: #1e3a6d;
    color: #fff !important;
}

.fdlm-btn-register {
    flex: 1;
    display: block;
    padding: 10px 16px;
    background: transparent;
    border: 2px solid #142451;
    color: #142451 !important;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.fdlm-btn-register:hover {
    background: #142451;
    color: #fff !important;
}

/* Bouton commander */
.fdlm-checkout-btn-wrapper {
    margin-top: 25px;
}

.fdlm-checkout-btn-wrapper .checkout-button,
.fdlm-checkout-btn-wrapper .wc-proceed-to-checkout .checkout-button {
    display: block;
    width: 100%;
    padding: 16px 30px;
    background: #142451;
    color: #fff;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 0;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.fdlm-checkout-btn-wrapper .checkout-button:hover {
    background: #F0B9F0;
    color: #142451;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(240, 185, 240, 0.4);
}

/* Continuer les achats */
.fdlm-continue-shopping {
    margin-top: 20px;
    text-align: center;
}

.fdlm-continue-shopping a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #142451;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.fdlm-continue-shopping a:hover {
    color: #F0B9F0;
}

/* Icônes paiement */
.fdlm-payment-icons {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(20, 36, 81, 0.1);
    text-align: center;
}

.fdlm-payment-label {
    display: block;
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
}

.fdlm-payment-methods {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.fdlm-payment-icon {
    font-size: 24px;
}

/* ========================================
   BARRE STICKY RECAP
   ======================================== */
.fdlm-cart-sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: #142451;
    box-shadow: 0 -4px 20px rgba(20, 36, 81, 0.3);
    transition: transform 0.3s ease;
}

.fdlm-sticky-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fdlm-sticky-total {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fdlm-sticky-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.fdlm-sticky-value {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

.fdlm-sticky-value .woocommerce-Price-amount {
    color: #fff;
}

.fdlm-sticky-checkout-btn {
    display: inline-block;
    padding: 12px 30px;
    background: #F2E2D0;
    color: #142451 !important;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s ease;
}

.fdlm-sticky-checkout-btn:hover {
    background: #F0B9F0;
    color: #142451 !important;
}

/* ========================================
   PANIER VIDE
   ======================================== */
.fdlm-cart-empty-wrapper {
    max-width: 600px;
    margin: 60px auto;
    padding: 20px;
}

.fdlm-cart-empty-content {
    background: #fff;
    border-radius: 0;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(20, 36, 81, 0.08);
}

.fdlm-cart-empty-icon {
    width: 120px;
    height: 120px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
}

.fdlm-cart-empty-title {
    font-family: var(--fdlm-font-title);
    font-size: 28px;
    color: #142451;
    margin: 0 0 15px 0;
}

.fdlm-cart-empty-message {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
    margin: 0 0 30px 0;
}

.fdlm-btn-shop {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 30px;
    background: #142451;
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 700;
    border-radius: 0;
    transition: all 0.3s ease;
}

.fdlm-btn-shop:hover {
    background: #F0B9F0;
    color: #142451;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(240, 185, 240, 0.4);
}

/* ========================================
   MASQUER LES ÉLÉMENTS WOOCOMMERCE PAR DÉFAUT
   ======================================== */
.woocommerce-cart .woocommerce > .woocommerce-notices-wrapper:first-child,
.woocommerce-cart .cart_totals,
.woocommerce-cart .cross-sells {
    display: none;
}

/* Mais afficher les notices d'erreur/succès */
.woocommerce-cart .woocommerce-message,
.woocommerce-cart .woocommerce-error,
.woocommerce-cart .woocommerce-info {
    display: block;
    max-width: 1200px;
    margin: 0 auto 20px;
    padding: 15px 20px;
    border-radius: 0;
}

.woocommerce-cart .woocommerce-message {
    background: #d4edda;
    border-left: 4px solid #28a745;
    color: #155724;
}

.woocommerce-cart .woocommerce-error {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.woocommerce-cart .woocommerce-info {
    background: #d1ecf1;
    border-left: 4px solid #17a2b8;
    color: #0c5460;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 480px) {
    .fdlm-cart-wrapper {
        padding: 20px 15px;
    }

    .fdlm-cart-header {
        margin-bottom: 25px;
    }

    .fdlm-cart-title {
        font-size: 24px;
    }

    .fdlm-cart-items {
        padding: 20px 15px;
        border-radius: 0;
    }

    .fdlm-cart-totals {
        padding: 25px 20px;
        border-radius: 0;
    }

    .fdlm-totals-title {
        font-size: 20px;
    }

    .fdlm-cart-empty-content {
        padding: 40px 25px;
    }

    .fdlm-cart-empty-title {
        font-size: 22px;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fdlm-cart-wrapper {
    animation: fadeInUp 0.5s ease-out;
}

.fdlm-cart-item {
    animation: fadeInUp 0.3s ease-out;
}

.fdlm-cart-item:nth-child(1) { animation-delay: 0.1s; }
.fdlm-cart-item:nth-child(2) { animation-delay: 0.15s; }
.fdlm-cart-item:nth-child(3) { animation-delay: 0.2s; }
.fdlm-cart-item:nth-child(4) { animation-delay: 0.25s; }
.fdlm-cart-item:nth-child(5) { animation-delay: 0.3s; }

/* ========================================
   SURCHARGE WOOCOMMERCE - COULEURS LA MÉMÉE
   ======================================== */

/* Bouton Valider la commande - forcer les couleurs */
.woocommerce-cart .checkout-button,
.woocommerce-cart .wc-proceed-to-checkout .checkout-button,
.woocommerce-cart a.checkout-button,
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button,
.fdlm-checkout-btn-wrapper .checkout-button,
.fdlm-checkout-btn-wrapper a.checkout-button {
    display: block !important;
    width: 100% !important;
    padding: 16px 30px !important;
    background: #142451 !important;
    color: #F2E2D0 !important;
    text-align: center !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    border-radius: 0 !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    box-sizing: border-box !important;
}

.woocommerce-cart .checkout-button:hover,
.woocommerce-cart .wc-proceed-to-checkout .checkout-button:hover,
.woocommerce-cart a.checkout-button:hover,
.fdlm-checkout-btn-wrapper .checkout-button:hover,
.fdlm-checkout-btn-wrapper a.checkout-button:hover {
    background: #F0B9F0 !important;
    color: #142451 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 20px rgba(240, 185, 240, 0.4) !important;
}

/* Liens dans le panier - couleur rose Mémée au lieu de rouge */
.woocommerce-cart a,
.fdlm-cart-wrapper a,
.fdlm-cart-totals a {
    color: #F0B9F0;
    transition: color 0.2s ease;
}

.woocommerce-cart a:hover,
.fdlm-cart-wrapper a:hover,
.fdlm-cart-totals a:hover {
    color: #142451;
}

/* Exceptions - liens produits en bleu */
.fdlm-cart-item-name a {
    color: #142451 !important;
}

.fdlm-cart-item-name a:hover {
    color: #F0B9F0 !important;
}

/* Lien supprimer coupon - rose */
.woocommerce-cart .woocommerce-remove-coupon,
.fdlm-cart-totals .woocommerce-remove-coupon {
    color: #F0B9F0 !important;
}

.woocommerce-cart .woocommerce-remove-coupon:hover,
.fdlm-cart-totals .woocommerce-remove-coupon:hover {
    color: #142451 !important;
}

/* Liens restaurer produit - rose */
.woocommerce-cart .restore-item,
.woocommerce-cart .woocommerce-message a {
    color: #F0B9F0 !important;
    font-weight: 600;
}

.woocommerce-cart .restore-item:hover,
.woocommerce-cart .woocommerce-message a:hover {
    color: #142451 !important;
}
