/**
 * Custom styles for popup modal on add to cart and checkout button visibility
 * Baseus Côte d'Ivoire
 */

/* ============================================
   POPUP MODAL - Notification d'ajout au panier
   ============================================ */

/* Overlay sombre pour le fond */
.baseus-cart-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 99998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.baseus-cart-popup-overlay.active {
    display: block;
    opacity: 1;
}

/* Container du popup */
.baseus-cart-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: #ffffff;
    border-radius: 16px;
    padding: 0;
    z-index: 99999;
    display: none;
    opacity: 0;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    max-width: 90%;
    width: 480px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.baseus-cart-popup.active {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Header du popup */
.baseus-cart-popup-header {
    background: linear-gradient(135deg, #1558E5 0%, #0d3d9e 100%);
    padding: 20px 24px;
    border-radius: 16px 16px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.baseus-cart-popup-header h3 {
    color: #ffffff;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.baseus-cart-popup-header h3::before {
    content: "✓";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #ffffff;
    color: #1558E5;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
}

/* Bouton fermer */
.baseus-cart-popup-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.baseus-cart-popup-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Corps du popup */
.baseus-cart-popup-body {
    padding: 24px;
}

/* Message de succès */
.baseus-cart-popup-message {
    font-size: 16px;
    color: #333333;
    margin-bottom: 20px;
    line-height: 1.5;
}

.baseus-cart-popup-message strong {
    color: #1558E5;
    font-weight: 600;
}

/* Boutons d'action */
.baseus-cart-popup-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Bouton principal - Voir le panier / Valider commande */
.baseus-cart-popup-btn-primary {
    display: block;
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #1558E5 0%, #0d3d9e 100%);
    color: #ffffff;
    text-align: center;
    text-decoration: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    border: 3px solid #0a2d75;
    box-shadow: 0 4px 15px rgba(21, 88, 229, 0.4);
    transition: all 0.3s ease;
    cursor: pointer;
}

.baseus-cart-popup-btn-primary:hover {
    background: linear-gradient(135deg, #0d3d9e 0%, #1558E5 100%);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(21, 88, 229, 0.5);
    text-decoration: none;
}

/* Bouton secondaire - Continuer les achats */
.baseus-cart-popup-btn-secondary {
    display: block;
    width: 100%;
    padding: 14px 24px;
    background: #ffffff;
    color: #333333;
    text-align: center;
    text-decoration: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    border: 2px solid #dddddd;
    transition: all 0.3s ease;
    cursor: pointer;
}

.baseus-cart-popup-btn-secondary:hover {
    background: #f5f5f5;
    border-color: #bbbbbb;
    color: #333333;
    text-decoration: none;
}

/* Animation d'entrée */
@keyframes baseusPopupSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.baseus-cart-popup.animate-in {
    animation: baseusPopupSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================
   MASQUER L'ANCIEN MESSAGE WOOCOMMERCE
   ============================================ */

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    display: none !important;
}

.elementor *,
.elementor-widget *,
.wc-block-cart *,
.wc-block-checkout * {
    color: inherit;
}
.woocommerce-checkout .woocommerce-info,
.woocommerce-checkout .woocommerce-error,
.woocommerce-account .woocommerce-message,
.woocommerce-account .woocommerce-info,
.woocommerce-account .woocommerce-error {
    display: block !important;
}

/* ============================================
   BOUTON VALIDER LA COMMANDE - STYLE AMÉLIORÉ
   ============================================ */

/* Bouton de validation de commande dans le mini-panier */
.woocommerce-mini-cart__buttons .checkout-button,
.wc-forward.checkout-button,
a.checkout-button,
.button.checkout-button,
.checkout-button.button.alt {
    display: block !important;
    width: 100% !important;
    padding: 18px 20px !important;
    background: linear-gradient(135deg, #1558E5 0%, #0d3d9e 100%) !important;
    color: #ffffff !important;
    text-align: center !important;
    text-decoration: none !important;
    border-radius: 12px !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    border: 4px solid #0a2d75 !important;
    box-shadow: 0 6px 20px rgba(21, 88, 229, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    transition: all 0.3s ease !important;
    margin-top: 10px !important;
    position: relative !important;
    overflow: hidden !important;
}

.woocommerce-mini-cart__buttons .checkout-button::before,
.wc-forward.checkout-button::before,
a.checkout-button::before,
.button.checkout-button::before,
.checkout-button.button.alt::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.woocommerce-mini-cart__buttons .checkout-button:hover,
.wc-forward.checkout-button:hover,
a.checkout-button:hover,
.button.checkout-button:hover,
.checkout-button.button.alt:hover {
    background: linear-gradient(135deg, #0d3d9e 0%, #1558E5 100%) !important;
    color: #ffffff !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 10px 30px rgba(21, 88, 229, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    border-color: #08225c !important;
    text-decoration: none !important;
}

.woocommerce-mini-cart__buttons .checkout-button:hover::before,
.wc-forward.checkout-button:hover::before,
a.checkout-button:hover::before,
.button.checkout-button:hover::before,
.checkout-button.button.alt:hover::before {
    left: 100%;
}

.woocommerce-mini-cart__buttons .checkout-button:active,
.wc-forward.checkout-button:active,
a.checkout-button:active,
.button.checkout-button:active,
.checkout-button.button.alt:active {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 15px rgba(21, 88, 229, 0.4) !important;
}

/* ============================================
   PAGE PANIER - BOUTON VALIDER COMMANDE
   ============================================ */

/* Sélecteurs très spécifiques pour forcer le style */
.cart_totals .wc-proceed-to-checkout .checkout-button,
.woocommerce-cart .wc-proceed-to-checkout .checkout-button,
.wc-proceed-to-checkout .checkout-button,
.woocommerce-cart .cart_totals .checkout-button,
body.woocommerce-cart .cart_totals .wc-proceed-to-checkout a.checkout-button,
body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button,
.woocommerce-cart .checkout-button,
a.checkout-button.button,
.checkout-button,
#page .cart_totals .checkout-button,
#page .wc-proceed-to-checkout .checkout-button,
.elementor-widget-container .checkout-button,
.wc-block-cart__submit-container .wc-block-cart__submit-button,
.wc-block-components-button.wc-block-cart__submit-button {
    display: block !important;
    width: 100% !important;
    padding: 22px 30px !important;
    background: linear-gradient(135deg, #1558E5 0%, #0d3d9e 100%) !important;
    color: #ffffff !important;
    text-align: center !important;
    text-decoration: none !important;
    border-radius: 12px !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    border: 5px solid #0a2d75 !important;
    box-shadow: 0 6px 20px rgba(21, 88, 229, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    transition: all 0.3s ease !important;
    margin-top: 15px !important;
    position: relative !important;
    overflow: hidden !important;
}

.cart_totals .wc-proceed-to-checkout .checkout-button::before,
.woocommerce-cart .wc-proceed-to-checkout .checkout-button::before,
.wc-proceed-to-checkout .checkout-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.cart_totals .wc-proceed-to-checkout .checkout-button:hover,
.woocommerce-cart .wc-proceed-to-checkout .checkout-button:hover,
.wc-proceed-to-checkout .checkout-button:hover {
    background: linear-gradient(135deg, #0d3d9e 0%, #1558E5 100%) !important;
    color: #ffffff !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 10px 30px rgba(21, 88, 229, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    border-color: #08225c !important;
    text-decoration: none !important;
}

.cart_totals .wc-proceed-to-checkout .checkout-button:hover::before,
.woocommerce-cart .wc-proceed-to-checkout .checkout-button:hover::before,
.wc-proceed-to-checkout .checkout-button:hover::before {
    left: 100%;
}

.cart_totals .wc-proceed-to-checkout .checkout-button:active,
.woocommerce-cart .wc-proceed-to-checkout .checkout-button:active,
.wc-proceed-to-checkout .checkout-button:active {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 15px rgba(21, 88, 229, 0.4) !important;
}

/* Animation pulse pour le bouton panier */
.cart_totals .wc-proceed-to-checkout .checkout-button,
.woocommerce-cart .wc-proceed-to-checkout .checkout-button,
.wc-proceed-to-checkout .checkout-button {
    animation: baseusPulse 2s infinite;
}

.cart_totals .wc-proceed-to-checkout .checkout-button:hover,
.woocommerce-cart .wc-proceed-to-checkout .checkout-button:hover,
.wc-proceed-to-checkout .checkout-button:hover {
    animation: none;
}

/* Icône flèche */
.cart_totals .wc-proceed-to-checkout .checkout-button::after,
.woocommerce-cart .wc-proceed-to-checkout .checkout-button::after,
.wc-proceed-to-checkout .checkout-button::after {
    content: "→";
    margin-left: 10px;
    font-size: 1.2em;
    transition: transform 0.3s ease;
    display: inline-block;
}

.cart_totals .wc-proceed-to-checkout .checkout-button:hover::after,
.woocommerce-cart .wc-proceed-to-checkout .checkout-button:hover::after,
.wc-proceed-to-checkout .checkout-button:hover::after {
    transform: translateX(5px);
}

/* ============================================
   PAGE COMMANDE (CHECKOUT) - BOUTON COMMANDER
   ============================================ */

.woocommerce-checkout .checkout-button,
.woocommerce-checkout button[name="woocommerce_checkout_place_order"],
.woocommerce-checkout #place_order,
.woocommerce-checkout .button.alt#place_order,
.wc-block-checkout__actions_row .wc-block-components-button {
    display: block !important;
    width: 100% !important;
    padding: 22px 30px !important;
    background: linear-gradient(135deg, #1558E5 0%, #0d3d9e 100%) !important;
    color: #ffffff !important;
    text-align: center !important;
    text-decoration: none !important;
    border-radius: 12px !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    border: 5px solid #0a2d75 !important;
    box-shadow: 0 6px 20px rgba(21, 88, 229, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    transition: all 0.3s ease !important;
    margin-top: 15px !important;
    position: relative !important;
    overflow: hidden !important;
    cursor: pointer !important;
}

.woocommerce-checkout .checkout-button::before,
.woocommerce-checkout button[name="woocommerce_checkout_place_order"]::before,
.woocommerce-checkout #place_order::before,
.woocommerce-checkout .button.alt#place_order::before,
.wc-block-checkout__actions_row .wc-block-components-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.woocommerce-checkout .checkout-button:hover,
.woocommerce-checkout button[name="woocommerce_checkout_place_order"]:hover,
.woocommerce-checkout #place_order:hover,
.woocommerce-checkout .button.alt#place_order:hover,
.wc-block-checkout__actions_row .wc-block-components-button:hover {
    background: linear-gradient(135deg, #0d3d9e 0%, #1558E5 100%) !important;
    color: #ffffff !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 10px 30px rgba(21, 88, 229, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    border-color: #08225c !important;
    text-decoration: none !important;
}

.woocommerce-checkout .checkout-button:hover::before,
.woocommerce-checkout button[name="woocommerce_checkout_place_order"]:hover::before,
.woocommerce-checkout #place_order:hover::before,
.woocommerce-checkout .button.alt#place_order:hover::before,
.wc-block-checkout__actions_row .wc-block-components-button:hover::before {
    left: 100%;
}

.woocommerce-checkout .checkout-button:active,
.woocommerce-checkout button[name="woocommerce_checkout_place_order"]:active,
.woocommerce-checkout #place_order:active,
.woocommerce-checkout .button.alt#place_order:active,
.wc-block-checkout__actions_row .wc-block-components-button:active {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 15px rgba(21, 88, 229, 0.4) !important;
}

/* Animation pulse pour le bouton commander */
.woocommerce-checkout .checkout-button,
.woocommerce-checkout button[name="woocommerce_checkout_place_order"],
.woocommerce-checkout #place_order,
.woocommerce-checkout .button.alt#place_order,
.wc-block-checkout__actions_row .wc-block-components-button {
    animation: baseusPulse 2s infinite;
}

.woocommerce-checkout .checkout-button:hover,
.woocommerce-checkout button[name="woocommerce_checkout_place_order"]:hover,
.woocommerce-checkout #place_order:hover,
.woocommerce-checkout .button.alt#place_order:hover,
.wc-block-checkout__actions_row .wc-block-components-button:hover {
    animation: none;
}

/* Icône flèche */
.woocommerce-checkout .checkout-button::after,
.woocommerce-checkout button[name="woocommerce_checkout_place_order"]::after,
.woocommerce-checkout #place_order::after,
.woocommerce-checkout .button.alt#place_order::after,
.wc-block-checkout__actions_row .wc-block-components-button::after {
    content: "→";
    margin-left: 10px;
    font-size: 1.2em;
    transition: transform 0.3s ease;
    display: inline-block;
}

.woocommerce-checkout .checkout-button:hover::after,
.woocommerce-checkout button[name="woocommerce_checkout_place_order"]:hover::after,
.woocommerce-checkout #place_order:hover::after,
.woocommerce-checkout .button.alt#place_order:hover::after,
.wc-block-checkout__actions_row .wc-block-components-button:hover::after {
    transform: translateX(5px);
}


@media (max-width: 768px) {
    .baseus-cart-popup {
        width: 92%;
        max-width: 360px;
        border-radius: 14px;
    }
    
    .baseus-cart-popup-header {
        padding: 16px 20px;
        border-radius: 14px 14px 0 0;
    }
    
    .baseus-cart-popup-header h3 {
        font-size: 16px;
    }
    
    .baseus-cart-popup-body {
        padding: 20px;
    }
    
    .baseus-cart-popup-message {
        font-size: 15px;
    }
    
    .baseus-cart-popup-btn-primary {
        padding: 18px 20px;
        font-size: 16px;
        border-width: 3px;
    }
    
    .baseus-cart-popup-btn-secondary {
        padding: 14px 20px;
        font-size: 14px;
    }
    
    /* Bouton valider commande sur mobile */
    .woocommerce-mini-cart__buttons .checkout-button,
    .wc-forward.checkout-button,
    a.checkout-button,
    .button.checkout-button,
    .checkout-button.button.alt {
        padding: 18px 16px !important;
        font-size: 16px !important;
        border-width: 3px !important;
    }
    
    .wc-proceed-to-checkout .checkout-button {
        padding: 20px 24px !important;
        font-size: 18px !important;
    }
    
    /* Bouton commander sur mobile */
    .woocommerce-checkout .checkout-button,
    .woocommerce-checkout button[name="woocommerce_checkout_place_order"],
    .woocommerce-checkout #place_order,
    .woocommerce-checkout .button.alt#place_order,
    .wc-block-checkout__actions_row .wc-block-components-button {
        padding: 20px 24px !important;
        font-size: 18px !important;
        border-width: 4px !important;
    }
}

@media (max-width: 480px) {
    .baseus-cart-popup {
        width: 95%;
    }
    
    .baseus-cart-popup-btn-primary {
        font-size: 15px;
    }
}

/* ============================================
   ANIMATIONS SUPPLÉMENTAIRES
   ============================================ */

/* Pulse animation pour attirer l'attention */
@keyframes baseusPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(21, 88, 229, 0.4);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(21, 88, 229, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(21, 88, 229, 0);
    }
}

.woocommerce-mini-cart__buttons .checkout-button,
.wc-forward.checkout-button,
a.checkout-button,
.button.checkout-button,
.checkout-button.button.alt {
    animation: baseusPulse 2s infinite;
}

.woocommerce-mini-cart__buttons .checkout-button:hover,
.wc-forward.checkout-button:hover,
a.checkout-button:hover,
.button.checkout-button:hover,
.checkout-button.button.alt:hover {
    animation: none;
}

/* Icône panier dans le bouton */
.woocommerce-mini-cart__buttons .checkout-button::after,
.wc-forward.checkout-button::after,
a.checkout-button::after,
.button.checkout-button::after,
.checkout-button.button.alt::after {
    content: "→";
    margin-left: 8px;
    font-size: 1.2em;
    transition: transform 0.3s ease;
    display: inline-block;
}

.woocommerce-mini-cart__buttons .checkout-button:hover::after,
.wc-forward.checkout-button:hover::after,
a.checkout-button:hover::after,
.button.checkout-button:hover::after,
.checkout-button.button.alt:hover::after {
    transform: translateX(5px);
}
