/**
 * Cart Customization Styles
 * Styles pour l'encadré d'installation et la description du kit
 */

/* Masquer la ligne d'installation dans le panier normal */
.cc-cart-product-list.aritg-hidden-cart-item,
.cc-cart-product:has(.remove_from_cart_button[data-product_id="2194"]),
.cc-cart-product:has(.remove[data-product_id="2194"]),
li.woocommerce-mini-cart-item:has(.remove_from_cart_button[data-product_id="2194"]),
li.woocommerce-mini-cart-item:has(.remove[data-product_id="2194"]) {
    display: none !important;
}

/* Masquer aussi le conteneur parent .cc-cart-product-list qui contient l'installation */
.cc-cart-product-list:has(.cc-cart-product[style*="display: none"]) {
    display: none !important;
}

/* Alternative : cibler directement via data-product_id */
.cc-cart-product-list:has([data-product_id="2194"]) {
    display: none !important;
}

/* Description du kit de démarrage - sur la même ligne que la corbeille */
.aritg-kit-description {
    padding: 6px 10px;
    margin: 0 10px 0 0;
    font-size: 12px;
    color: #000;
    background: #f8f9fa;
    border-radius: 4px;
    line-height: 1.4;
    display: inline-block;
    max-width: 80%;
}

/* Ajuster le conteneur pour afficher la description et la corbeille sur la même ligne */
.cc-item-content-bottom-left {
    display: flex !important;
    align-items: flex-start !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
}
.cc-item-content-bottom {
    align-items: center !important;
}

/* Barrer le prix original du kit et armoire - TRÈS SPÉCIFIQUE */
.cc-cart-product .price del,
.cc-cart-product .cc_item_price del,
.cc-cart-product .cc_item_total_price del,
.cc_item_total_price .price del,
div.price del,
del span.woocommerce-Price-amount {
    text-decoration: line-through !important;
    color: #000 !important;
    font-size: 0.9em !important;
    opacity: 1 !important;
}

/* Forcer le line-through sur le span à l'intérieur du del */
del span,
del bdi,
del .woocommerce-Price-amount {
    text-decoration: inherit !important;
}

/* Badge "Offert" */
.aritg-free-badge {
    background: #557255;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
    font-style: normal;
}

/* Encadré vert de l'installation - COMPACT & MODERNE */
.aritg-installation-toggle-box {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-width: 1px 0px 1px 0px;
    padding: 14px 26px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.65;
}

.aritg-installation-toggle-box.active {
    background: #edf0e566;
    border-color: #557255;
    opacity: 1;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.15);
}

/* Header avec titre, prix et toggle */
.aritg-installation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.aritg-installation-title-price {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.aritg-installation-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #557255;
    line-height: 1.3;
}

.aritg-installation-price {
    font-size: 16px;
    font-weight: 700;
    color: #557255;
}

/* Toggle Switch à la Apple - MODERNE & SOPHISTIQUÉ */
.aritg-toggle-switch {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 32px;
    flex-shrink: 0;
    cursor: pointer;
}

.aritg-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.aritg-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, #d0d0d0 0%, #b8b8b8 100%);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 32px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15);
}

.aritg-toggle-slider:before {
    position: absolute;
    content: "";
    height: 28px;
    width: 28px;
    left: 2px;
    bottom: 2px;
    background: linear-gradient(180deg, #ffffff 0%, #f5f5f5 100%);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.1);
}

.aritg-toggle-switch input:checked+.aritg-toggle-slider {
    background: #557255;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(76, 175, 80, 0.3);
}

.aritg-toggle-switch input:focus+.aritg-toggle-slider {
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.aritg-toggle-switch input:checked+.aritg-toggle-slider:before {
    transform: translateX(24px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* Animation hover */
.aritg-toggle-switch:hover .aritg-toggle-slider {
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2), 0 0 8px rgba(0, 0, 0, 0.1);
}

.aritg-toggle-switch:hover input:checked+.aritg-toggle-slider {
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15), 0 0 12px rgba(76, 175, 80, 0.4);
}

/* Description - COMPACT */
.aritg-installation-description {
    margin: 0;
}

.aritg-installation-description p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #000;
    white-space: pre-line;
}

/* Responsive */
@media (max-width: 480px) {
    .aritg-installation-header {
        flex-direction: row;
        gap: 14px;
        margin-bottom: 25px;
    }

    .aritg-installation-title-price {
        width: 100%;
    }

    .aritg-toggle-switch {
        align-self: flex-end;
    }

    .aritg-installation-title {
        font-size: 15px;
    }

    .aritg-installation-price {
        font-size: 16px;
    }

    .aritg-installation-description p {
        font-size: 13px;
    }
}

/* Animation de chargement lors du toggle */
.aritg-installation-toggle-box.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Style pour le prix barré du kit */
.aritg-kit-price-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.aritg-kit-price-wrapper del {
    color: #999;
    font-size: 14px;
}

.aritg-kit-price-wrapper .aritg-free-badge {
    background: #557255;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Conteneur fixe pour l'installation (ne se recharge pas avec AJAX) */
.aritg-installation-container {
    width: 100%;
}

/* Optimisation de l'espace dans le panier Caddy */
.cc-cart-product {
    padding: 12px 0 !important;
    margin-bottom: 8px !important;
}

.cc-cart-product .cc_item_content {
    padding: 0 !important;
}

.cc-cart-product-list {
    margin: 0 15px 1px 15px !important;
}

/* Réduire l'espace autour des images produits */
.cc-cart-product .cc-product-thumb img {
    max-width: 80px !important;
    height: auto !important;
}

/* Compacter les titres de produits */
.cc-cart-product .cc_item_title {
    font-size: 14px !important;
    line-height: 1.3 !important;
    margin-bottom: 4px !important;
}

/* Compacter les prix */
.cc-cart-product .cc_item_total_price {
    font-size: 14px !important;
}

/* Réduire l'espace de la section upsells */
.cc-product-upsells-wrapper {
    margin: 12px 0 !important;
}

.cc-pl-info-wrapper {
    padding: 12px 0 !important;
}

/* Compacter le sous-total */
/* .cc-totals {
    padding: 0px 0 !important;
}

.cc-total-box {
    padding: 12px 0 !important;
} */

/* Style pour "Offert" à la place du prix - COMPACT */
.aritg-free-price {
    background: #557255;
    color: white;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.25);
    display: inline-block;
    font-style: normal;
}

/* Masquer les boutons de quantité pour les produits complémentaires (FluxCheckout) */
/* Le script inline gère le masquage, ce CSS est un fallback */
tr.cart_item.aritg-complementary-product .quantity {
    display: none !important;
}

/* Style pour "Non inclus dans votre commande" dans le checkout FluxCheckout */
.aritg-not-included {
    color: #888 !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    font-style: italic !important;
    display: inline-block !important;
}
/* ============================================
   CORRECTION DU LAYOUT CADDY - SCROLL INTERNE
   ============================================ */

/* Conteneurs parents - s'assurer qu'ils permettent le scroll */
.cc-window,
.cc-window-wrapper {
    height: 100vh !important;
    max-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

/* Le header ne doit pas prendre trop de place */
.cc-header {
    flex-shrink: 0 !important; /* Ne rétrécit pas */
}

/* Forcer le panier à utiliser flexbox pour positionner le bouton en bas */
.cc-cart {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important; /* Prend toute la hauteur disponible */
    max-height: 100% !important;
    overflow: hidden !important; /* Pas de scroll sur le conteneur principal */
    flex: 1 1 auto !important; /* Prend l'espace disponible */
}

/* Le conteneur principal du panier */
.cc-cart-container {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
}

/* Le conteneur du body prend l'espace disponible et gère le scroll */
.cc-body-container {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important; /* Important pour flexbox scroll */
    overflow: hidden !important; /* Pas de scroll ici, c'est .cc-body qui scroll */
}

/* Le body peut scroller si le contenu dépasse - C'EST ICI QUE LE SCROLL SE FAIT */
.cc-body {
    flex: 1 1 auto !important;
    overflow-y: auto !important; /* Scroll interne activé */
    overflow-x: hidden !important;
    min-height: 0 !important; /* Crucial pour flexbox scroll */
    -webkit-overflow-scrolling: touch !important; /* Smooth scroll sur mobile */
}

/* Le bouton reste toujours en bas et visible - NE SCROLL PAS */
.cc-cart-actions {
    flex-shrink: 0 !important; /* Ne rétrécit jamais */
    margin-top: auto !important; /* Poussé en bas par flexbox */
    position: relative !important;
    z-index: 10 !important; /* Au-dessus du contenu scrollable */
    padding-bottom: 15px !important; /* Espace réduit en bas */
    padding-top: 8px !important; /* Espace réduit en haut */
    background: #fff !important; /* Fond blanc pour être visible */
}

/* Padding en bas pour le bouton */
.cc-cart-actions.cc-no-branding {
    padding-bottom: 15px !important; /* Espace réduit en bas */
}

/* Réduire la taille du bouton "Commander maintenant" */
.cc-cart-actions .cc-button,
.cc-cart-actions .cc-button-primary {
    margin-bottom: 0 !important;
    width: 100% !important;
    padding: 12px 20px !important; /* Padding réduit */
    font-size: 14px !important; /* Taille de police réduite */
    line-height: 1.4 !important; /* Hauteur de ligne réduite */
    min-height: auto !important; /* Pas de hauteur minimale imposée */
}

/* Réduire la taille des icônes dans le bouton */
.cc-cart-actions .cc-button svg,
.cc-cart-actions .cc-button-primary svg {
    width: 16px !important;
    height: 16px !important;
}

/* S'assurer que les éléments "logged-in" ne cassent pas le layout */
body.logged-in .cc-cart,
body.logged-in .cc-body-container,
body.logged-in .cc-body {
    min-height: unset !important;
    max-height: none !important;
}

/* S'assurer que l'encadré vert ne casse pas le layout */
.aritg-installation-container {
    flex-shrink: 0 !important; /* Ne rétrécit pas */
    margin: 0 !important;
    padding: 0 !important;
}

/* Pas d'espace entre l'encadré et le bouton */
.aritg-installation-container + .cc-cart-actions {
    margin-top: 0 !important;
}