/* ========================================
   MAX ELEMENTOR - STYLES TUILES PRODUITS
   Widget Elementor personnalisé pour afficher
   les produits avec le style bronze/doré
   ======================================== */

/* ----------------------------------------
   BASE: Structure de la tuile
   ---------------------------------------- */
.max-elementor-tile {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    padding: 16px;
    min-height: 400px;
    height: 100%;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.max-elementor-tile:hover {
    transform: translateY(-4px);
}

/* ----------------------------------------
   PLACEHOLDER: État vide / sélection
   ---------------------------------------- */
.max-elementor-tile.max-tile-placeholder {
    background: linear-gradient(180deg, #4a3420 0%, #3d2817 50%, #2a1a0f 100%);
    border: 2px dashed #d4af37;
    border-radius: 8px;
    justify-content: center;
}

.max-placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.max-placeholder-icon {
    font-size: 48px;
    opacity: 0.7;
}

.max-placeholder-text {
    color: #ffffff;
    font-size: 14px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ----------------------------------------
   ERREUR: Produit introuvable
   ---------------------------------------- */
.max-elementor-tile.max-tile-error {
    background: linear-gradient(180deg, #4a2020 0%, #3d1717 50%, #2a0f0f 100%);
    border: 2px solid #af3737;
    border-radius: 8px;
    justify-content: center;
    color: #ffffff;
}

/* ----------------------------------------
   HEADER: Titre et métadonnées
   ---------------------------------------- */
.max-elementor-tile .max-tile-header {
    width: 100%;
    margin-bottom: 12px; /* Valeur par défaut, peut être surchargée par Elementor */
    position: relative;
}

.max-elementor-tile .max-tile-name {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.3;
}

.max-elementor-tile .max-tile-meta {
    font-size: 11px;
    color: #ffffff;
    text-align: center;
    opacity: 0.85;
    line-height: 1.5;
    font-weight: 400;
}

/* ----------------------------------------
   IMAGE: Conteneur et animations
   ---------------------------------------- */
/* Surcharge de tous les styles génériques pour les tuiles Elementor */
.max-elementor-tile .max-tile-image {
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    min-height: 200px;
    width: 90% !important;
    max-width: 90% !important;
    min-width: auto !important;
    margin: 0 auto !important; /* Centrage horizontal */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative;
    /* Suppression de l'ovale et des bordures - surcharge images.css */
    border: none !important;
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
    /* Surcharge spécifique du border de images.css */
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
}

/* Image simple (sans flip) */
.max-elementor-tile .max-tile-image:not(.max-tile-flip-container) img,
.max-elementor-tile .max-tile-image:not(.max-tile-flip-container) .max-product-img {
    width: 100% !important;
    height: auto;
    max-width: 100% !important;
    object-fit: contain;
    object-position: center !important; /* Centrage de l'image */
    border-radius: 50%;
    display: block;
    margin: 0 auto; /* Centrage horizontal */
    /* Suppression de l'ovale et des bordures */
    border: none !important;
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
}

.max-elementor-tile .max-tile-image:not(.max-tile-flip-container) .max-coin-face {
    position: relative;
    width: 100%;
    height: auto;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto; /* Centrage horizontal */
    /* Suppression de l'ovale et des bordures */
    border: none !important;
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
}

/* Surcharge des styles de images.css pour éviter les conflits */
.max-elementor-tile .max-tile-image::before,
.max-elementor-tile .max-tile-image::after {
    display: none !important;
    content: none !important;
}

/* Surcharge spécifique et forte du border de images.css qui crée l'ovale */
.elementor-element .max-elementor-tile .max-tile-image,
.max-elementor-tile .max-tile-image,
.max-elementor-tile .max-tile-image.max-tile-flip-container,
.max-elementor-tile .max-tile-image.max-tile-no-image {
    border: none !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    border-top: none !important;
    border-right: none !important;
    border-bottom: none !important;
    border-left: none !important;
}

/* Conteneur fade animation (avers/revers) */
.max-elementor-tile .max-tile-image.max-tile-flip-container {
    width: 90% !important;
    max-width: 90% !important;
    /* Utiliser aspect-ratio pour maintenir un ratio carré et permettre la superposition */
    aspect-ratio: 1 / 1;
    min-height: 200px;
    margin: 0 auto !important; /* Centrage horizontal */
    position: relative !important;
    display: block !important; /* Changé de flex à block pour permettre la superposition */
    overflow: hidden; /* Pour cacher les débordements */
    /* Suppression de l'ovale et des bordures */
    border: none !important;
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
}

.max-elementor-tile .max-tile-image.max-tile-flip-container .max-coin-face {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    transition: opacity 0.8s ease-in-out;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    /* Suppression de l'ovale et des bordures */
    border: none !important;
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

.max-elementor-tile .max-tile-image.max-tile-flip-container .max-coin-face .max-product-img,
.max-elementor-tile .max-tile-image.max-tile-flip-container .max-coin-face img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center !important; /* Centrage de l'image */
    border-radius: 50%;
    display: block !important;
    margin: 0 !important;
    /* Suppression de l'ovale et des bordures */
    border: none !important;
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
}

/* Avers visible par défaut */
.max-elementor-tile .max-tile-image.max-tile-flip-container .max-coin-obverse {
    opacity: 1 !important;
    z-index: 2 !important;
    position: absolute !important;
}

/* Revers caché par défaut */
.max-elementor-tile .max-tile-image.max-tile-flip-container .max-coin-reverse {
    opacity: 0 !important;
    z-index: 1 !important;
    position: absolute !important;
}

/* Fade au hover : avers disparaît, revers apparaît */
.max-elementor-tile .max-tile-image.max-tile-flip-container:hover .max-coin-obverse {
    opacity: 0;
}

.max-elementor-tile .max-tile-image.max-tile-flip-container:hover .max-coin-reverse {
    opacity: 1;
}

/* Placeholder sans image */
.max-elementor-tile .max-tile-image.max-tile-no-image {
    width: 90% !important;
    max-width: 90% !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.3);
}

.max-elementor-tile .max-tile-image.max-tile-no-image svg {
    width: 80px;
    height: 80px;
}

/* ----------------------------------------
   BODY: Conteneur des prix
   ---------------------------------------- */
.max-elementor-tile .max-tile-body {
    margin-top: auto;
    width: 100%;
    position: relative;
}

.max-elementor-tile .max-tile-prices {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

/* ----------------------------------------
   PRIX: Lignes individuelles
   ---------------------------------------- */
.max-elementor-tile .max-tile-international,
.max-elementor-tile .max-tile-buy,
.max-elementor-tile .max-tile-sell {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

/* Séparateur optionnel */
.max-elementor-tile .max-tile-international.has-separator,
.max-elementor-tile .max-tile-buy.has-separator {
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

/* Labels */
.max-elementor-tile .max-intl-label,
.max-elementor-tile .max-price-label {
    font-size: 11px;
    font-weight: 500;
    text-align: left;
    color: #ffffff;
    opacity: 0.9;
}

/* Valeurs */
.max-elementor-tile .max-intl-price,
.max-elementor-tile .max-price-value {
    font-size: 15px;
    font-weight: 700;
    text-align: right;
    color: #ffffff;
}

/* ----------------------------------------
   RESPONSIVE: Adaptations mobiles
   ---------------------------------------- */

@media (max-width: 768px) {
    .max-elementor-tile {
        min-height: 380px;
        padding: 12px;
    }
    
    .max-elementor-tile .max-tile-name {
        font-size: 14px;
    }
    
    
    .max-elementor-tile .max-intl-price,
    .max-elementor-tile .max-price-value {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .max-elementor-tile {
        min-height: 350px;
        padding: 10px;
    }
    
    .max-elementor-tile .max-tile-name {
        font-size: 13px;
    }
    
    .max-elementor-tile .max-tile-meta {
        font-size: 11px;
    }
    
}

/* ----------------------------------------
   EDITOR: Styles pour l'éditeur Elementor
   ---------------------------------------- */
.elementor-editor-active .max-elementor-tile.max-tile-placeholder {
    cursor: pointer;
}

.elementor-editor-active .max-elementor-tile.max-tile-placeholder:hover {
    border-style: solid;
    background: linear-gradient(180deg, #5a4430 0%, #4d3827 50%, #3a2a1f 100%);
}

