/**
 * Aratice Home Product Slider Styles
 * Slider de produits pour la page d'accueil avec Swiper.js
 * 
 * PERSONNALISATION DES BOUTONS DE NAVIGATION :
 * Pour modifier la taille des boutons de navigation, changez les variables CSS :
 * - --nav-width : largeur du bouton (défaut: 50px)
 * - --nav-height : hauteur du bouton (défaut: 50px) 
 * - --nav-icon-size : taille de l'icône (défaut: 18px)
 * - --nav-offset : distance du slider (défaut: 25px)
 * 
 * Exemple pour des boutons plus petits :
 * .ahps-nav { --nav-width: 40px; --nav-height: 40px; --nav-icon-size: 16px; --nav-offset: 20px; }
 */

/* === Container Principal === */
.ahps-products-slider-wrapper {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
    position: relative;
}

/* === En-tête === */
.ahps-header {
    text-align: center;
    margin-bottom: 40px;
}

.ahps-title {
    font-size: 32px;
    font-weight: 700;
    color: #2C3E50;
    margin: 0 0 12px 0;
    line-height: 1.2;
}

.ahps-subtitle {
    font-size: 18px;
    color: #7F8C8D;
    margin: 0;
    line-height: 1.4;
    max-width: 600px;
    margin: 0 auto;
}

/* === Container Slider === */
.ahps-slider-container {
    position: relative;
    width: 100%;
    margin: 0 auto;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 0 60px;
}

.ahps-swiper {
    flex: 1;
    height: auto;
    padding: 60px 0 60px 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ahps-swiper.swiper-initialized {
    opacity: 1;
}

/* Masquer les slides supplémentaires pendant le chargement */
.ahps-swiper:not(.swiper-initialized) .swiper-slide {
    display: none;
}

.ahps-swiper:not(.swiper-initialized) .swiper-slide:first-child {
    display: block;
}

/* === RESPONSIVE SWIPER === */
/* Le CSS ne force plus les largeurs, on laisse Swiper gérer */

/* === Désactiver le drag & drop dans le slider === */
.ahps-swiper .apg-product-card {
    cursor: default !important;
    user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

.ahps-swiper .apg-product-card[draggable="true"] {
    cursor: default !important;
    draggable: false !important;
}

/* Forcer la désactivation du drag sur les cards du slider */
.ahps-swiper .apg-product-card {
    pointer-events: auto;
}

.ahps-swiper .apg-product-card * {
    pointer-events: auto;
}

.ahps-swiper .apg-product-card:hover {
    transform: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.ahps-swiper .swiper-wrapper {
    align-items: stretch;
}

.ahps-swiper .swiper-slide {
    height: auto;
    display: flex;
}

/* === Cards dans le Slider === */
/* Utilise le CSS de products-card.css - pas de duplication */
.ahps-swiper .apg-product-card {
    height: 100%;
    width: 100%;
    max-width: 100%;
    margin: 0;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box;
}

/* === Structure de la card dans le slider === */
.ahps-swiper .apg-product-content {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    padding: 20px 16px 16px !important;
}

.ahps-swiper .apg-product-info {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}

.ahps-swiper .apg-product-actions {
    margin-top: auto !important;
    padding-top: 16px !important;
}

/* === Description (masquée dans le slider) === */
.ahps-swiper .apg-product-description {
    display: none !important;
}

/* === Forcer les styles corrects dans le slider === */
.ahps-swiper .apg-product-price {
    margin-top: auto !important;
    padding: 0 !important;
}

.ahps-swiper .apg-product-price-wrapper {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}

/* === Espacement entre catégorie et titre === */
.ahps-swiper .apg-product-category {
    font-size: 12px !important;
    color: #163C79 !important;
    font-weight: 500 !important;
}

.ahps-swiper .apg-product-title {
    margin-top: 0 !important;
    margin-bottom: 12px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    color: #2C3E50 !important;
}

.ahps-swiper .apg-product-title a {
    color: inherit !important;
    text-decoration: none !important;
}

.ahps-swiper .apg-product-title a:hover {
    color: #163C79 !important;
}

/* === Forcer le bouton en bas de la card === */
.ahps-swiper .apg-product-card {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}

.ahps-swiper .apg-product-content {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    justify-content: space-between !important;
}

.ahps-swiper .apg-product-info {
    flex: 1 !important;
}

.ahps-swiper .apg-product-actions {
    margin-top: auto !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

.ahps-swiper .apg-add-to-quote {
    background: #163C79 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    padding: 14px 24px !important;
    min-height: 48px !important;
    height: 48px !important;
    box-shadow: 0 2px 4px rgba(59, 89, 152, 0.2) !important;
    width: 100% !important;
    margin-top: auto !important;
}

.ahps-swiper .apg-add-to-quote:hover {
    background: #0f2a5a !important;
    box-shadow: 0 2px 8px rgba(59, 89, 152, 0.3) !important;
    transform: translateY(-1px) !important;
}

/* === Notification de succès === */
.ahps-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #7EAD53;
    color: #fff;
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(126, 173, 83, 0.3);
    z-index: 9999;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.ahps-notification.show {
    transform: translateX(0);
}

.ahps-notification .ahps-notification-icon {
    font-size: 16px;
}

.ahps-notification .ahps-notification-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    margin-left: 8px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.ahps-notification .ahps-notification-close:hover {
    opacity: 1;
}

/* === États du bouton Ajouter au devis === */
.ahps-swiper .apg-add-to-quote:disabled {
    cursor: not-allowed;
    background-color: #7EAD53 !important;
}

/* === Spinner de chargement === */
.ahps-swiper .apg-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.ahps-swiper .apg-spinner-small {
    width: 14px;
    height: 14px;
    border-width: 1.5px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* === Images toujours visibles dans le slider === */
.ahps-swiper .apg-product-image .apg-product-img {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.ahps-swiper .apg-product-image .apg-product-img:not(.active) {
    display: none;
}

.ahps-swiper .apg-product-image .apg-product-img.active {
    display: block;
    opacity: 1;
}

/* === Navigation === */
.ahps-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);

    width: 40px !important;
    height: 40px !important;
    background: #163C79;
    border-radius: 50%;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: none;
    outline: none;
}

.ahps-nav:hover {
    background: #0F2A5C;
    box-shadow: 0 4px 12px rgba(22, 60, 121, 0.3);
}

.ahps-nav:before {
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: var(--nav-icon-size);
    color: #fff;
    line-height: 1;
}

.ahps-nav:after {
    display: none;
}

.swiper-button-prev.ahps-nav.ahps-nav-prev {
    left: 0;
}

.swiper-button-next.ahps-nav.ahps-nav-next, {
    right: 0;
}

.ahps-nav-next {
    /* Pas besoin d'order, c'est déjà dans le bon ordre HTML */
}

.ahps-nav-prev {
    /* Pas besoin d'order, c'est déjà dans le bon ordre HTML */
}

.ahps-nav-next:before {
    content: '\f054';
}

.ahps-nav-prev:before {
    content: '\f053';
}

.ahps-nav.swiper-button-disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: #ccc;
}

.ahps-nav.swiper-button-disabled:hover {
    background: #ccc;
    transform: translateY(-50%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* === Pagination (masquée par défaut) === */
.ahps-pagination {
    display: none !important;
}

.ahps-pagination .swiper-pagination-bullet {
    display: none !important;
}

/* === Responsive === */
@media (max-width: 1200px) {
    .ahps-title {
        font-size: 28px;
    }

    .ahps-subtitle {
        font-size: 16px;
    }

    .ahps-slider-container {
        padding: 0 50px;
        gap: 15px;
    }

    .ahps-nav {
        width: 45px;
        height: 45px;
    }

    .ahps-nav:before {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .ahps-header {
        margin-bottom: 30px;
    }

    .ahps-title {
        font-size: 24px;
    }

    .ahps-subtitle {
        font-size: 15px;
    }

    .ahps-slider-container {
        padding: 0 40px;
        gap: 12px;
    }

    .ahps-swiper {
        padding: 0 0 50px 0;
    }

    .ahps-nav {
        width: 40px;
        height: 40px;
    }

    .ahps-nav:before {
        font-size: 14px;
    }

    .ahps-pagination {
        bottom: 15px;
    }

    .ahps-pagination .swiper-pagination-bullet {
        width: 10px;
        height: 10px;
        margin: 0 4px;
    }
}

@media (max-width: 480px) {
    .ahps-header {
        margin-bottom: 25px;
    }

    .ahps-title {
        font-size: 22px;
    }

    .ahps-subtitle {
        font-size: 14px;
    }

    .ahps-slider-container {
        padding: 0 30px;
        gap: 10px;
    }

    .ahps-swiper {
        padding: 0 0 45px 0;
    }

    .ahps-nav {
        width: 35px;
        height: 35px;
    }

    .ahps-nav:before {
        font-size: 12px;
    }

    .ahps-pagination .swiper-pagination-bullet {
        width: 8px;
        height: 8px;
        margin: 0 3px;
    }
}

/* === Animation d'entrée === */
.ahps-products-slider-wrapper {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === États de chargement === */
.ahps-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: #7F8C8D;
    font-size: 16px;
}

.ahps-loading:before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #E0E0E0;
    border-top: 2px solid #163C79;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* === Message aucun produit === */
.ahps-no-products {
    text-align: center;
    padding: 60px 20px;
    color: #7F8C8D;
    font-size: 18px;
    background: #F8F9FA;
    border-radius: 8px;
    border: 1px solid #E0E0E0;
}

/* === États du bouton Ajouter au devis === */
.ahps-swiper .apg-add-to-quote:disabled {
    cursor: not-allowed;
}