/**
 * Corrections pour les boutons - ONPhI
 * Ce fichier corrige les conflits entre Bootstrap et nos styles personnalisés
 */

/* ========================================
   CORRECTIONS GÉNÉRALES POUR TOUS LES BOUTONS
   ======================================== */

/* Forcer les styles pour tous les boutons de la boutique */
.shop-container .btn,
.shop-container button[type="submit"],
.shop-container .add-to-cart-btn,
.cart-page .btn,
.cart-page button[type="submit"],
.btn,
.btn-primary,
button,
input[type="button"],
input[type="submit"],
a.btn,
a.button {
    /* Reset des styles Bootstrap */
    --bs-btn-padding-x: 0.75rem;
    --bs-btn-padding-y: 0.375rem;
    --bs-btn-font-family: inherit;
    --bs-btn-font-size: 1rem;
    --bs-btn-font-weight: 700;
    --bs-btn-line-height: 1.5;
    --bs-btn-color: white !important;
    --bs-btn-bg: #f56a6a !important;
    --bs-btn-border-color: #f56a6a !important;
    --bs-btn-border-radius: 8px;
    --bs-btn-box-shadow: none !important;
    --bs-btn-disabled-opacity: 0.65;
    --bs-btn-focus-box-shadow: none !important;
    --bs-btn-active-color: white !important;
    
    /* Forcer les styles directement */
    background: #f56a6a !important;
    color: white !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
    font-weight: 700 !important;
    --bs-btn-active-bg: #d44a4a !important;
    --bs-btn-active-border-color: #d44a4a !important;
    --bs-btn-active-shadow: none !important;
    --bs-btn-disabled-color: white !important;
    --bs-btn-disabled-bg: #f56a6a !important;
    --bs-btn-disabled-border-color: #f56a6a !important;
    
    /* Styles appliqués */
    display: inline-block;
    padding: 0.875rem 1rem !important;
    margin-bottom: 0;
    font-size: 1rem !important;
    font-weight: 700 !important;
    line-height: 1.5 !important;
    color: white !important;
    text-align: center;
    text-decoration: none !important;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    background-color: #f56a6a !important;
    border: none !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    transition: all 0.3s ease !important;
}

/* États hover */
.shop-container .btn:hover,
.shop-container button[type="submit"]:hover,
.shop-container .add-to-cart-btn:hover,
.cart-page .btn:hover,
.cart-page button[type="submit"]:hover {
    color: white !important;
    background-color: #e55a5a !important;
    border-color: #e55a5a !important;
    text-decoration: none !important;
}

/* États focus */
.shop-container .btn:focus,
.shop-container button[type="submit"]:focus,
.shop-container .add-to-cart-btn:focus,
.cart-page .btn:focus,
.cart-page button[type="submit"]:focus {
    color: white !important;
    background-color: #f56a6a !important;
    border-color: #f56a6a !important;
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

/* États active */
.shop-container .btn:active,
.shop-container button[type="submit"]:active,
.shop-container .add-to-cart-btn:active,
.cart-page .btn:active,
.cart-page button[type="submit"]:active {
    color: white !important;
    background-color: #d44a4a !important;
    border-color: #d44a4a !important;
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

/* ========================================
   BOUTONS SPÉCIFIQUES
   ======================================== */

/* Bouton d'ajout au panier */
.shop-container .add-to-cart-btn,
.shop-container button[type="submit"] {
    width: 100% !important;
    background: #f56a6a !important;
    color: white !important;
    border: none !important;
    padding: 0.875rem 1rem !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

.shop-container .add-to-cart-btn:hover,
.shop-container button[type="submit"]:hover {
    background: #e55a5a !important;
    color: white !important;
    text-decoration: none !important;
}

.shop-container .add-to-cart-btn:focus,
.shop-container button[type="submit"]:focus {
    background: #f56a6a !important;
    color: white !important;
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

.shop-container .add-to-cart-btn:active,
.shop-container button[type="submit"]:active {
    background: #d44a4a !important;
    color: white !important;
    text-decoration: none !important;
}

/* Boutons de quantité */
.shop-container .qty-btn {
    width: 40px !important;
    height: 40px !important;
    background: white !important;
    color: #333 !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    outline: none !important;
    box-shadow: none !important;
    transition: all 0.2s ease !important;
}

.shop-container .qty-btn:hover {
    background: #f8f9fa !important;
    border-color: #adb5bd !important;
    color: #333 !important;
}

.shop-container .qty-btn:focus {
    background: white !important;
    border-color: #dee2e6 !important;
    color: #333 !important;
    outline: none !important;
    box-shadow: none !important;
}

/* ========================================
   BOUTONS DU PANIER
   ======================================== */

/* Boutons dans la page panier */
.cart-page .btn-primary {
    background: #f56a6a !important;
    color: white !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

.cart-page .btn-primary:hover {
    background: #e55a5a !important;
    color: white !important;
    text-decoration: none !important;
}

.cart-page .btn-primary:focus {
    background: #f56a6a !important;
    color: white !important;
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

.cart-page .btn-primary:active {
    background: #d44a4a !important;
    color: white !important;
    text-decoration: none !important;
}

/* Bouton de vidage du panier */
.cart-page .btn-clear-cart {
    background: #6c757d !important;
    color: white !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

.cart-page .btn-clear-cart:hover {
    background: #5a6268 !important;
    color: white !important;
    text-decoration: none !important;
}

/* ========================================
   CORRECTIONS POUR LES ICÔNES
   ======================================== */

/* S'assurer que les icônes sont blanches et sans bordures */
.shop-container .btn i,
.shop-container button[type="submit"] i,
.cart-page .btn i,
.cart-page button[type="submit"] i,
.shop-container .fas,
.shop-container .fa,
.cart-page .fas,
.cart-page .fa {
    color: white !important;
    margin-right: 0.5rem;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

/* Supprimer toutes les bordures des icônes */
.shop-container .btn i:focus,
.shop-container button[type="submit"] i:focus,
.cart-page .btn i:focus,
.cart-page button[type="submit"] i:focus,
.shop-container .fas:focus,
.shop-container .fa:focus,
.cart-page .fas:focus,
.cart-page .fa:focus {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.shop-container .btn i:active,
.shop-container button[type="submit"] i:active,
.cart-page .btn i:active,
.cart-page button[type="submit"] i:active,
.shop-container .fas:active,
.shop-container .fa:active,
.cart-page .fas:active,
.cart-page .fa:active {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.shop-container .btn i:hover,
.shop-container button[type="submit"] i:hover,
.cart-page .btn i:hover,
.cart-page button[type="submit"] i:hover,
.shop-container .fas:hover,
.shop-container .fa:hover,
.cart-page .fas:hover,
.cart-page .fa:hover {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* ========================================
   ÉTATS DE CHARGEMENT
   ======================================== */

/* Animation de chargement */
.shop-container .loading,
.cart-page .loading {
    opacity: 0.7 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

.shop-container .cart-loader,
.cart-page .cart-loader {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

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

/* ========================================
   CORRECTIONS POUR BOOTSTRAP
   ======================================== */

/* Désactiver les styles Bootstrap pour nos boutons */
.shop-container .btn:not(.btn-link):not(.btn-outline-*),
.shop-container button[type="submit"],
.cart-page .btn:not(.btn-link):not(.btn-outline-*) {
    /* Désactiver les variables CSS Bootstrap */
    --bs-btn-padding-x: 0.75rem;
    --bs-btn-padding-y: 0.375rem;
    --bs-btn-font-family: inherit;
    --bs-btn-font-size: 1rem;
    --bs-btn-font-weight: 700;
    --bs-btn-line-height: 1.5;
    --bs-btn-color: white;
    --bs-btn-bg: #f56a6a;
    --bs-btn-border-color: #f56a6a;
    --bs-btn-border-radius: 8px;
    --bs-btn-box-shadow: none;
    --bs-btn-disabled-opacity: 0.65;
    --bs-btn-focus-box-shadow: none;
    --bs-btn-active-color: white;
    --bs-btn-active-bg: #d44a4a;
    --bs-btn-active-border-color: #d44a4a;
    --bs-btn-active-shadow: none;
    --bs-btn-disabled-color: white;
    --bs-btn-disabled-bg: #f56a6a;
    --bs-btn-disabled-border-color: #f56a6a;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .shop-container .btn,
    .shop-container button[type="submit"],
    .cart-page .btn,
    .cart-page button[type="submit"] {
        font-size: 0.9rem !important;
        padding: 0.75rem 0.875rem !important;
    }
    
    .shop-container .qty-btn {
        width: 35px !important;
        height: 35px !important;
        font-size: 1rem !important;
    }
}

/* ========================================
   CORRECTIONS SUPPLÉMENTAIRES POUR BOUTONS
   ======================================== */

/* Forcer le texte blanc sur tous les boutons */
.btn, .btn-primary, button[type="submit"], button[type="button"] {
    color: white !important;
    background: #f56a6a !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
    font-weight: 700 !important;
}

.btn:hover, .btn-primary:hover, button[type="submit"]:hover, button[type="button"]:hover,
button:hover, input[type="button"]:hover, input[type="submit"]:hover, a.btn:hover, a.button:hover {
    color: white !important;
    background: #e55a5a !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

.btn:focus, .btn-primary:focus, button[type="submit"]:focus, button[type="button"]:focus {
    color: white !important;
    background: #f56a6a !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

.btn:active, .btn-primary:active, button[type="submit"]:active, button[type="button"]:active {
    color: white !important;
    background: #d44a4a !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

/* ========================================
   CORRECTIONS SPÉCIFIQUES POUR BOUTONS ROUGES
   ======================================== */

/* Forcer le texte blanc sur tous les boutons rouges */
*[style*="background: #f56a6a"],
*[style*="background-color: #f56a6a"],
*[style*="background:#f56a6a"],
*[style*="background-color:#f56a6a"],
button[style*="background"],
input[type="submit"][style*="background"],
input[type="button"][style*="background"],
a[style*="background"] {
    color: white !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3) !important;
}

/* Correction spécifique pour les boutons avec classe onphi-btn */
.onphi-btn,
.onphi-btn-outline,
.onphi-btn-primary {
    color: white !important;
    background: #f56a6a !important;
    border: 2px solid #f56a6a !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3) !important;
}

.onphi-btn:hover,
.onphi-btn-outline:hover,
.onphi-btn-primary:hover {
    color: white !important;
    background: #e55a5a !important;
    border-color: #e55a5a !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3) !important;
}

/* Correction pour tous les boutons dans les sections onphi */
.onphi-content-section button,
.onphi-info-card button,
.onphi-page-header button {
    color: white !important;
    background: #f56a6a !important;
    border: none !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3) !important;
}

/* Correction pour les boutons dans les chroniques */
.chronicle-item button,
.chronicle-action button,
.chronicle-action a {
    color: white !important;
    background: #f56a6a !important;
    border: none !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3) !important;
}

/* Correction générale pour tous les boutons rouges */
button:not([style*="background: white"]):not([style*="background-color: white"]):not([style*="background:white"]):not([style*="background-color:white"]),
input[type="submit"]:not([style*="background: white"]):not([style*="background-color: white"]):not([style*="background:white"]):not([style*="background-color:white"]),
input[type="button"]:not([style*="background: white"]):not([style*="background-color: white"]):not([style*="background:white"]):not([style*="background-color:white"]) {
    color: white !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3) !important;
}

/* Correction pour les classes de boutons spécifiques */
.button,
.button.special,
.button.small,
.button.primary,
.button.secondary,
a.button,
a.button.special,
a.button.small,
a.button.primary,
a.button.secondary {
    color: white !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3) !important;
}

/* Correction pour les boutons avec background rouge */
.button[style*="background"],
.button.special[style*="background"],
.button.small[style*="background"],
a.button[style*="background"],
a.button.special[style*="background"],
a.button.small[style*="background"] {
    color: white !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3) !important;
}

/* Correction pour tous les boutons dans les navbars et menus */
.navbar .button,
.navbar a.button,
.nav-item .button,
.nav-item a.button,
.nav-link.button,
a.nav-link.button {
    color: white !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3) !important;
}
