/* Offcanvas / Modal plein écran */
.lag-mcm-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999990; /* Élevé mais sous la Bottom App Bar */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex;
    justify-content: flex-end;
}

.lag-mcm-overlay.open {
    opacity: 1;
    visibility: visible;
}

.lag-mcm-container {
    width: 100%;
    max-width: 480px; /* Sur Desktop, cela se comporte comme un offcanvas propre */
    height: 100%;
    background: #fff;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 25px rgba(0,0,0,0.2);
}

@media (max-width: 768px) {
    .lag-mcm-container {
        max-width: 100%; /* Sur mobile, cela prend tout l'écran */
    }
}

.lag-mcm-overlay.open .lag-mcm-container {
    transform: translateX(0);
}

/* En-tête */
.lag-mcm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.lag-mcm-header h2 {
    margin: 0;
    font-size: 1.3rem;
    color: #2c3e50;
    font-weight: 700;
}

.lag-mcm-close {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: #7f8c8d;
    padding: 0 10px;
    transition: color 0.2s;
}

.lag-mcm-close:hover {
    color: #e74c3c;
}

/* Corps du panier (liste des produits) */
.lag-mcm-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.lag-mcm-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Item produit */
.lag-mcm-item {
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
    padding-bottom: 20px;
    border-bottom: 1px solid #f1f2f6;
}

.lag-mcm-item-main {
    display: flex;
    gap: 15px;
    position: relative;
    align-items: flex-start;
}

.lag-mcm-item-extended {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.lag-mcm-item-image {
    width: 90px;
    flex-shrink: 0;
}

.lag-mcm-item-img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.lag-mcm-item-details {
    flex: 1;
    font-size: 0.95rem;
    color: #555;
    padding-right: 20px; /* Espace pour la croix de suppression */
}

.lag-mcm-item-title {
    margin: 0 0 8px;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
}

.lag-mcm-item-title a {
    color: #2c3e50;
    text-decoration: none;
}

.lag-mcm-item-price-qty {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 12px;
}

/* Métadonnées du configurateur */
.lag-mcm-item-meta {
    list-style: none;
    padding: 12px;
    margin: 0;
    font-size: 0.9rem;
    background: #fdfdfd;
    border-left: 3px solid #3498db;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
}

.lag-mcm-item-meta li {
    margin-bottom: 4px;
}

.lag-mcm-item-meta li:last-child {
    margin-bottom: 0;
}

/* Boutons d'action par produit */
.lag-mcm-item-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lag-mcm-btn-design {
    display: block;
    flex: 1;
    box-sizing: border-box;
    padding: 8px 10px;
    background: #f4ecf8;
    color: #8e44ad;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    text-align: center;
    border: 1px solid #e1d4eb;
    transition: background 0.2s;
}

.lag-mcm-btn-design:hover {
    background: #e1d4eb;
}

.lag-mcm-btn-edit {
    display: block;
    flex: 1;
    box-sizing: border-box;
    padding: 8px 10px;
    background: #e8f4fd;
    color: #3498db;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    text-align: center;
    border: 1px solid #d6eaf8;
    transition: background 0.2s;
}

.lag-mcm-btn-edit:hover {
    background: #d6eaf8;
}

/* Ancien label checkbox BAT supprimé - Remplacé par le toggle natif */

/* Croix de suppression WooCommerce (remove from cart) */
.lag-mcm-remove {
    position: absolute;
    top: -5px;
    right: 0;
    color: #e74c3c;
    font-size: 1.5rem;
    text-decoration: none;
    font-weight: bold;
    line-height: 1;
    padding: 5px;
}

.lag-mcm-remove:hover {
    color: #c0392b;
}

/* Pied du panier (Total & Boutons) */
.lag-mcm-footer {
    padding: 25px;
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)); /* Espace supplémentaire pour la Bottom App Bar */
    border-top: 1px solid #e0e0e0;
    background: #fff;
    flex-shrink: 0;
}

.lag-mcm-total {
    font-size: 1.2rem;
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    color: #2c3e50;
}

.lag-mcm-total-price {
    font-weight: 800;
}

.lag-mcm-footer-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lag-mcm-btn {
    display: block;
    width: 100%;
    padding: 15px;
    text-align: center;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.lag-mcm-btn-cart {
    background: #f1f2f6;
    color: #2c3e50;
}

.lag-mcm-btn-cart:hover {
    background: #dfe4ea;
}

.lag-mcm-btn-checkout {
    background: #2c3e50;
    color: #fff;
}

.lag-mcm-btn-checkout:hover {
    background: #1a252f;
}

/* État vide */
.lag-mcm-empty {
    text-align: center;
    color: #7f8c8d;
    margin: 40px 0;
    font-size: 1.1rem;
}

.lag-mcm-btn-shop {
    display: block;
    text-align: center;
    background: #3498db;
    color: #fff;
    padding: 14px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.2s;
}

.lag-mcm-btn-shop:hover {
    background: #2980b9;
}

/* Badge dynamique du panier */
.trigger-panier-mobile {
    position: relative;
}

.lartgrave-cart-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background-color: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    pointer-events: none;
    z-index: 10;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.lartgrave-cart-badge.hidden {
    display: none !important;
}

/* 
 * ESPACEMENT GLOBAL POUR LA BOTTOM APP BAR
 * Applique un padding-bottom sur le body en vue Mobile et Tablette 
 * pour éviter que le contenu en bas de page ne soit masqué par la Bottom App Bar (Elementor).
 * Environ 80px (hauteur moyenne de la barre) + 30px (marge de respiration) = 110px.
 */
@media (max-width: 1024px) {
    body {
        padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

/* ==========================================================================
   GLOBAL Z-INDEX FIXES (Task 1)
   ========================================================================== */
.elementor-location-header {
    z-index: 2147483647 !important;
}
.elementor-location-footer {
    z-index: 2147483645 !important;
}
.lag-mcm-overlay, .lag-ocm-modal, .lartgrave-fav-modal, .lag-bat-modal, .lag-cart-remove-modal, .lag-bat-modal-info, .lag-bat-warning-modal,
.elementor-menu-cart__container, .elementor-popup-modal, .dialog-widget-overlay, .dialog-widget-content {
    z-index: 2147483640 !important;
}
#lartgrave-fav-toast, .lartgrave-fav-toast, .lag-cart-toast {
    z-index: 2147483646 !important;
}
.woocommerce-product-gallery__trigger, .lartgrave-fav-btn, .lartgrave-fav-btn-single {
    z-index: 50 !important;
}
