/**
 * Styles pour le bloc Slider d'Offres - VERSION OPTIMISÉE FINALE
 * @package GrimTheme
 */

/* ================================
   PLACEHOLDER POUR L'ÉDITEUR GUTENBERG
================================ */
.components-placeholder {
    min-height: 200px;
    padding: 2rem;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    text-align: center;
    background: #f9fafb;
    margin: 1rem 0;
}

/* Correction pour les boutons du slider offres */
.offre-slide .offre-card a {
    position: relative !important;
    z-index: 140 !important;
    pointer-events: auto !important;
}

/* Et aussi pour les boutons de navigation offres */
.offres-nav-button {
    position: relative !important;
    z-index: 152 !important;
    pointer-events: auto !important;
}

.components-placeholder__label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
    font-size: 1.125rem;
}

.components-placeholder__instructions {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* ================================
   ALIGNEMENTS GUTENBERG
================================ */
.offres-slider-block.alignwide,
.offres-slider-block.alignfull {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    max-width: none;
}

.alignwide .offres-slider-container,
.alignfull .offres-slider-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ================================
   ANIMATION D'ENTRÉE
================================ */
.offres-slider-block {
    opacity: 0;
    animation: slideIn 0.8s ease-out forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================================
   STRUCTURE PRINCIPALE DU SLIDER
================================ */
.offres-slider-block .offres-container {
    display: flex !important;
    gap: 1.25rem;
    width: 100%;
}

/* ================================
   CARTES D'OFFRES - HAUTEURS FIXES
================================ */
.offre-slide.fixed-position {
    height: auto !important;
    min-height: 520px !important;
    max-height: 520px !important;
    display: flex !important;
    flex-direction: column !important;
    transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    transform: translateY(20px);
}

.offre-slide.fixed-position .offre-card {
    height: 520px !important;
    min-height: 520px !important;
    max-height: 520px !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.offre-slide.fixed-position:hover {
    transform: translateY(-12px) scale(1.02) rotateX(2deg);
    z-index: 10;
}

.offre-slide.fixed-position:hover .offre-card {
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.4), 0 0 50px rgba(31, 41, 55, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* ================================
   GLASSMORPHISM SUPPORT
================================ */
.backdrop-blur-xl {
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.backdrop-blur-2xl {
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
}

.bg-white\/10 { background-color: rgba(255, 255, 255, 0.1) !important; }
.bg-white\/20 { background-color: rgba(255, 255, 255, 0.2) !important; }
.bg-white\/30 { background-color: rgba(255, 255, 255, 0.3) !important; }
.bg-black\/20 { background-color: rgba(0, 0, 0, 0.2) !important; }
.bg-black\/30 { background-color: rgba(0, 0, 0, 0.3) !important; }
.bg-black\/40 { background-color: rgba(0, 0, 0, 0.4) !important; }
.bg-black\/50 { background-color: rgba(0, 0, 0, 0.5) !important; }
.bg-black\/70 { background-color: rgba(0, 0, 0, 0.7) !important; }
.bg-black\/80 { background-color: rgba(0, 0, 0, 0.8) !important; }

.border-white\/10 { border-color: rgba(255, 255, 255, 0.1) !important; }
.border-white\/20 { border-color: rgba(255, 255, 255, 0.2) !important; }
.border-white\/30 { border-color: rgba(255, 255, 255, 0.3) !important; }
.border-white\/40 { border-color: rgba(255, 255, 255, 0.4) !important; }
.border-white\/50 { border-color: rgba(255, 255, 255, 0.5) !important; }

.text-white\/95 { color: rgba(255, 255, 255, 0.95) !important; }

/* ================================
   TYPOGRAPHIE
================================ */
.offre-card h3 {
    font-family: 'BasicGrotesque-Regular', 'Helvetica Neue', 'Arial', sans-serif;
    font-weight: 400 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    letter-spacing: -0.025em;
    line-height: 1.2;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ================================
   BOUTONS
================================ */
.offre-card a {
    text-decoration: none !important;
    position: relative;
    overflow: hidden;
    font-weight: 700;
    letter-spacing: 0.025em;
    will-change: transform;
    isolation: isolate;
}

.offre-card a::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255,255,255,0.4), rgba(255,255,255,0.1), rgba(255,255,255,0.4));
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: xor;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.offre-card a:hover::after {
    opacity: 1;
}

.offre-card a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.offre-card a:hover::before {
    left: 100%;
}

/* ================================
   ANIMATIONS
================================ */
@keyframes pulse-glow {
    0%, 100% { 
        opacity: 0.6;
        transform: scale(1);
    }
    50% { 
        opacity: 1;
        transform: scale(1.2);
    }
}

.animate-pulse {
    animation: pulse-glow 2s ease-in-out infinite;
}

.animation-delay-500 {
    animation-delay: 0.5s;
}

.animation-delay-1000 {
    animation-delay: 1s;
}

.offre-card div[class*="absolute"][class*="animate-pulse"] {
    animation-duration: 3s;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
}

/* ================================
   GRADIENTS FALLBACK
================================ */
.offre-card[style*="linear-gradient"] {
    position: relative;
}

.offre-card[style*="linear-gradient"]::before {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    filter: saturate(1.2) brightness(0.9);
    z-index: -1;
}

/* ================================
   BARRE DE PROGRESSION - NOIR/GRIS
================================ */
.offres-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1f2937 0%, #374151 100%);
    border-radius: 9999px;
    transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    width: 0;
    position: relative;
    box-shadow: 0 0 8px rgba(31, 41, 55, 0.3);
}

@keyframes progress-shine {
    0%, 100% { opacity: 0.9; transform: scaleY(1); }
    50% { opacity: 0.6; transform: scaleY(0.8); }
}

/* ================================
   NAVIGATION
================================ */
.offres-navigation {
    position: relative !important;
    z-index: 150 !important;
    pointer-events: auto !important;
}

.offres-nav-buttons {
    position: relative !important;
    z-index: 151 !important;
    pointer-events: auto !important;
}

.offres-nav-button {
    position: relative !important;
    z-index: 152 !important;
    pointer-events: auto !important;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    user-select: none;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.offres-nav-button:hover {
    transform: scale(1.1) translateY(-2px);
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 0 20px rgba(31, 41, 55, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.offres-nav-button:active {
    transform: scale(0.95) translateY(0);
}

.offres-nav-button:focus-visible {
    outline: 2px solid #1f2937;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(31, 41, 55, 0.2), 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* ================================
   ICÔNES
================================ */
.arrow-icon {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px;
    min-height: 24px;
    display: block;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0.9;
    object-fit: contain;
    color: #374151;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.offres-nav-button:hover .arrow-icon {
    opacity: 1;
    transform: scale(1.1);
    color: #1f2937;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.offres-nav-button:active .arrow-icon {
    transform: scale(0.9);
}

/* ================================
   RESPONSIVE
================================ */
@media (max-width: 767px) {
    .alignwide .offres-slider-container,
    .alignfull .offres-slider-container {
        padding: 0 1rem;
    }
    
    .offre-slide.fixed-position,
    .offre-slide.fixed-position .offre-card {
        min-height: 450px !important;
        max-height: 450px !important;
        height: 450px !important;
    }
    
    .offre-card > div:first-child {
        padding: 1.5rem !important;
    }
    
    .offre-card h3 {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
    }
    
    .offre-card a {
        padding: 0.875rem 1.5rem !important;
        font-size: 0.875rem !important;
    }
    
    .offres-nav-button {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
    }
    
    .arrow-icon {
        width: 20px !important;
        height: 20px !important;
        min-width: 20px;
        min-height: 20px;
    }
    
    /* Les positions sont maintenant générées dynamiquement par JavaScript */
}

/* ================================
   LAYOUT DYNAMIQUE - POSITIONS GÉNÉRÉES PAR JS
================================ */

/* Les positions sont maintenant générées dynamiquement par JavaScript */
/* Pas besoin de media queries pour masquer des positions fixes */

@media (min-width: 768px) and (max-width: 1023px) {
    .offre-slide.fixed-position,
    .offre-slide.fixed-position .offre-card {
        min-height: 480px !important;
        max-height: 480px !important;
        height: 480px !important;
    }
}

/* ================================
   UTILITAIRES
================================ */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.offres-data {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    left: -9999px !important;
}

/* ================================
   ÉTATS DE CHARGEMENT
================================ */
.offres-slider-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 520px;
    color: #6b7280;
    font-size: 1rem;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    border-radius: 1.5rem;
}

.offres-slider-loading::before {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #1f2937;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ================================
   OPTIMISATIONS PERFORMANCE
================================ */
.offre-card,
.offres-nav-button,
.offres-progress-fill {
    will-change: transform;
    transform-style: preserve-3d;
}

.offre-slide.fixed-position {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* ================================
   ACCESSIBILITÉ
================================ */
@media (prefers-reduced-motion: reduce) {
    .offre-slide.fixed-position,
    .offres-progress-fill,
    .arrow-icon,
    .offre-card,
    .offres-nav-button,
    .offres-slider-block,
    .animate-pulse {
        transition: none;
        animation: none;
    }
    
    .offres-slider-block {
        opacity: 1;
    }
}

/* ================================
   MODE SOMBRE
================================ */
@media (prefers-color-scheme: dark) {
    .offres-slider-block .offre-card {
        background: #1f2937;
        color: #f9fafb;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
    
    .offres-slider-block .offre-card h3 {
        color: #f9fafb;
    }
    
    .offres-progress-fill {
        background: linear-gradient(90deg, #374151 0%, #4b5563 100%);
        box-shadow: 0 0 20px rgba(55, 65, 81, 0.5);
    }
    
    .offres-nav-button {
        background: rgba(0, 0, 0, 0.2);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .offres-nav-button:hover {
        background: rgba(0, 0, 0, 0.3);
        border-color: rgba(255, 255, 255, 0.2);
    }
    
    .offres-slider-loading::before {
        border-top-color: #374151;
    }
}
