/**
* 2007-2024 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author    PrestaShop SA <contact@prestashop.com>
*  @copyright 2007-2024 PrestaShop SA
*  @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*
* Don't forget to prefix your containers with your own identifier
* to avoid any conflicts with others containers.
*/

.product-miniature .btn-inversed {
    border: solid 1px #0972b8;
    background: #fff;
    color: #0972b8;
    margin: 0px 0px 5px 0px;
    padding: 3%;
    transition: .5s ease-in-out;
}

.product-miniature .btn-inversed:hover {
    background: #0972b8;
    color: #fff;
}

.product-miniature-default .thumbnail-container {
    overflow: hidden;
}

#products .product-variations {
    position: fixed;
    /* Initialement caché */
    transition: all .5s ease-in-out;
    overflow:hidden;
    width: 450px;
    max-width: 100%;
    max-height: 100%;
    background-color: rgba(255, 255, 255, 0.98); /* Couleur de fond semi-transparente */
    z-index: 10020; /* Assure que l'overlay est au-dessus de tout le reste */
    right: -100%;
    bottom: -100%;
}

#products  h3.title {
    flex: auto;
    text-align: center;
}

#products .product-variations {
    bottom: 0;
}

#products .product-variations.show {
    right: 0;
}

#products .product-variations .card-title {
    cursor: pointer;
    align-items: center;
}

#products .product-variations .card-title .close {
    font-size: 1.75rem;
}

.scrolling-wrapper {
    overflow-x: hidden;
    overflow-y: scroll;
    /* white-space: nowrap; */
    margin-bottom: 0 !important;
    height: 95vh !important;
    scrollbar-width: thin;
    scrollbar-color: #0972b8 #f3f3f3;
    display: grid;
    grid-auto-rows: 180px;
    grid-template-columns: 45% 45%;
    grid-gap: 15px;
    justify-content: center;
}

#products .product-variations .card {
    max-height: 100%;
    height: 100%;
    background-color: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.bouton-links {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: black;
    cursor: pointer;
}

.VariationTitle {
    color: black;
    font-size: medium;
    text-align: left;
    margin-bottom: 0;
}

.VariationClose {
    font-weight: 600;
    color: black;
    margin: 0px;
    font-size: large;
}

.Variationoverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Couleur de fond semi-transparente */
    z-index: 1000; /* Assure que l'overlay est au-dessus de tout le reste */
    display: none; /* Initialement caché */
}

/* #products .product-variations .variation-item {} */

body#product #col-product-info #iqitreviews-rating-product::after {
    content: ' | ';
}

#products .product-variations .variations-loader {
    border: 5px solid #f3f3f3;
    border-top-color: #0972b8;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin .40s linear infinite;
    margin: auto;
}

.gecodis-alert {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 99999; /* Sit on top */
    left: 0;
    top: 0;
    bottom: 0; /* Full width */
    right: 0; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgb(0,0,0); /* Fallback color */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
  }

  .gecodis-alert.show {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Modal Content */
  .gecodis-alert-content {
    background-color: #fefefe;
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 30%;
    min-width: 350px;
  }

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 767px) {
    #products .product-variations {
        position: fixed;
        height: 33%;
        bottom: -100%;
        border-radius: 20px 20px 0 0;

        display: block;

        right: 0;
    }

    .scrolling-wrapper {
        display: flex;
    }

    #products .product-variations.show {
        bottom: 0;
    }
}

main:after {
    content: ' ';
    position: fixed;
    width: 0;
    height: 0;
}

main:has(#products .product-variations.show):after {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.5);
    transition: background .5s ease-in-out;
    -webkit-transition: background .5s ease-in-out;
    z-index: 10010;
}



/* Configuration pour les écrans de bureau */
.scrolling-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    overflow-y: auto;
    margin-bottom: 0 !important;
    height: 95vh !important;
    scrollbar-width: thin;
    scrollbar-color: #0972b8 #f3f3f3;
    gap: 15px; /* Espace entre les items */
}

.variation-item {
    flex: 1 1 calc(45% - 15px); /* 45% de largeur avec un gap de 15px */
    margin: 0 15px; /* Pour aligner le gap */
    max-width: 45%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Configuration pour les écrans mobiles */
/* Configuration pour les écrans mobiles */
@media (max-width: 767px) {
    .scrolling-wrapper {
        flex-wrap: nowrap; /* Pas de wrap, éléments sur une ligne */
        overflow-x: auto;  /* Scrolling horizontal */
        overflow-y: hidden; /* Pas de scrolling vertical */
        height: auto; /* Ajuster la hauteur automatiquement */
        padding: 10px; /* Ajoute un peu de padding pour éviter que les éléments ne soient coupés au bord */
    }

    .variation-item {
        flex: 0 0 auto; /* Les éléments ne se redimensionnent pas */
        margin: 0 10px; /* Espacement entre les items */
        max-width: 70%; /* Réduit la largeur pour garantir que tout soit visible */
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .variation-item img {
        width: 100%; /* L'image occupe toute la largeur de l'élément */
        height: auto; /* Maintient le ratio de l'image */
        max-height: 120px; /* Limite la hauteur de l'image sur mobile pour s'adapter aux différents écrans */
        object-fit: contain; /* Maintient le contenu de l'image visible */
        margin-bottom: 5px; /* Ajoute un peu d'espace entre l'image et le texte */
    }

    .variation-item p {
        font-size: 14px; /* Ajuste la taille du texte pour qu'il soit lisible sur les petits écrans */
        line-height: 1.2; /* Assure un bon espacement entre les lignes si le texte est sur deux lignes */
        margin: 0; /* Évite tout espacement supplémentaire qui pourrait causer un overflow */
    }
}

