.popup-flex-box.image-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

/*25% image gauches -75% texte droite*/
.\32 5i-75t {
  display: flex;
  align-items:center;
  gap: 1rem;
  width: 100%;
}

.\32 5i-75t img {
  width: 25%;
  height: auto;
  object-fit:none;
  display: block;
}

.\32 5i-75t p {
  width: 75%;
  margin: 0;
}

.popup-flex-box.image-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-actions .action-btn {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    padding: 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    opacity: 1 !important;
    visibility: visible !important;
}

.card-actions .action-btn.info-btn,
.card-actions .action-btn.video-btn {
    display: flex !important;
}

.card-actions .action-btn[style*="display: none"] {
    display: none !important;
}

.card-actions .action-btn.info-btn,
.card-actions .action-btn.video-btn {
    background: #808088;
    background: linear-gradient(145deg, 
        #b0b0b8 0%,
        #9898a0 25%,
        #808088 50%,
        #686870 75%,
        #505058 100%);
}

.card-actions .action-btn.info-btn {
    background: #787880;
    background: linear-gradient(145deg, 
        #a8a8b0 0%,
        #909098 25%,
        #787880 50%,
        #606068 75%,
        #484850 100%);
}

/* Style de la modale */
.modal {
  display: none;
  position: fixed;
  z-index: 20000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.9);
  overflow: auto;
}

.modal-content {
  margin: auto;
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
}

#modalCaption {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
  text-align: center;
  color: #ccc;
  padding: 10px 0;
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
}

body.modal-open .close-popup-btn,
body.modal-open .nav-btn,
body.modal-open .page-navigator,
body.modal-open .scroll-top-btn {
  display: none !important;
}

/* ===== INDICATION SUPPLÉMENTAIRE DE SLIDES ===== */
.slide-indicators .indicator:not(.active) {
  animation: softPulse 2s infinite ease-in-out;
}

@keyframes softPulse {
  0% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); opacity: 0.6; }
}

.slide-indicators::after {
  content: "⇠ ⇢";
  font-size: 1.2rem;
  color: #9F9FA9;
  opacity: 0.3;
  margin-left: 15px;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.slide-indicators:hover::after {
  opacity: 0.7;
}

/* ✅ CORRIGÉ : Ajout de clamp() pour les titres dans les popups */
.header-text-overlay-category h2,
.header-text-overlay-category strong {
  color: #ffffff !important;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
  font-size: clamp(1.2rem, 2.5vw, 1.6rem); /* ✅ Police contrôlée */
}

.header-visual-category {
  background: linear-gradient(135deg, #9F9FA9 0%, #171717 100%) !important;
  padding-top: 8px !important; /* ✅ AUGMENTÉ de 6px à 8px */
  padding-bottom: 8px !important; /* ✅ AUGMENTÉ de 6px à 8px */
  min-height: unset !important;
  border: 2px groove black;
  border-radius: 10px;
}

.header-text-overlay-category h2 {
  margin: 0;
  line-height: 1.2;
}

.header-text-overlay-category p {
  margin: 0;
  line-height: 1.2;
  font-size: clamp(0.9rem, 2vw, 1.1rem); /* ✅ Police contrôlée */
}

.main-content {
  padding: 15px 15px 20px; /* ✅ AUGMENTÉ de 10px à 15px */
}

/* Styles spécifiques pour le carrousel A4 */
#carousel-a4 .compact-carousel {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

#carousel-a4 .slides-container {
  width: 100%;
  aspect-ratio: 1 / 1.414;
  background: #f0f0f0;
  border-radius: 12px;
  overflow: hidden;
}

#carousel-a4 .weapon-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #e0e0e0;
}

#carousel-a4 .choice-card:hover,
#carousel-a4 .choice-card:hover .weapon-image {
  transform: none !important;
  box-shadow: none !important;
  transition: none !important;
}

#carousel-a4 .nav-arrow {
  align-self: center;
}

#carousel-a4 .carousel-footer {
  margin-top: 15px;
}

#carousel-a4 .choice-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#carousel-a4 .card-visual {
  flex: 1 1 0;
}

#carousel-a4 .card-info {
  flex: 0 0 auto;
  padding: 4px 6px;
  line-height: 1.2;
  border-top: 3px solid #9F9FA9;
  background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
  text-align: center;
}

#carousel-a4 .card-info h4 {
  margin: 0;
  font-size: clamp(0.8rem, 1.8vw, 0.95rem); /* ✅ Police contrôlée */
}

.popup-flex-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 20px;
}

.popup-flex-box {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  border: 1px solid #e0e0e0;
  width: 100%;
  box-sizing: border-box;
}

.popup-flex-row {
  display: flex;
  gap: 18px;
  width: 100%;
}

.popup-flex-row .popup-flex-box {
  flex: 1;
  width: auto;
}

.popup-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.popup-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  border: 1px solid #ccc;
  background: white;
  display: block;
}

.popup-caption {
  font-style: italic;
  color: #555;
  font-size: clamp(0.85rem, 1.8vw, 0.95rem); /* ✅ Police contrôlée */
  text-align: center;
  margin: 8px 0 0;
}

.joule-calculator {
  background: #eef2f5;
  border-left: 5px solid #9F9FA9;
  font-family: 'Source Code Pro', monospace;
  font-size: clamp(0.9rem, 1.8vw, 1rem); /* ✅ Police contrôlée */
  line-height: 1.5;
  text-align: center;
}

.joule-calculator strong {
  color: #171717;
}

.close-popup-btn,
.scroll-top-btn,
.nav-btn {
  position: fixed !important;
  z-index: 10000 !important;
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #9F9FA9 0%, #171717 100%);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
  text-decoration: none;
  color: white;
  opacity: 0.7;
}

.close-popup-btn::before,
.scroll-top-btn::before,
.nav-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0.1) 50%, transparent 100%);
  border-radius: 8px 8px 0 0;
  pointer-events: none;
}

.close-popup-btn:hover,
.scroll-top-btn:hover,
.nav-btn:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, #AFAFB9 0%, #272727 100%);
  border-color: rgba(255,255,255,0.5);
}

.close-popup-btn:active,
.scroll-top-btn:active,
.nav-btn:active {
  transform: scale(0.95);
}

.close-icon,
.scroll-top-icon,
.nav-icon {
  color: white;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  position: relative;
  z-index: 2;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
  font-weight: bold;
}

.scroll-top-icon {
  font-size: 32px;
}

.nav-icon {
  font-size: 28px;
}

.close-popup-btn {
  top: 20px !important;
}

.next-nav-btn {
  top: 80px !important;
}

.scroll-top-btn {
  bottom: 20px !important;
  top: auto !important;
}

.back-nav-btn {
  top: 20px !important;
}

body {
  padding-top: 10px;
}

.back-button-container {
  display: none;
}

/* Navigateur de page fixe en bas */
.page-navigator {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  color: white;
  border-radius: 40px;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  gap: 25px;
  z-index: 10001;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  font-family: sans-serif;
}

.page-nav-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
  padding: 0;
  line-height: 1;
}

.page-nav-btn:hover:not(:disabled) {
  background-color: rgba(255, 255, 255, 0.2);
}

.page-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.page-indicator {
  font-size: 1.1rem;
  font-weight: 600;
  min-width: 70px;
  text-align: center;
  letter-spacing: 0.5px;
}

.compact-container {
  padding-top: 0 !important;
}

/* ===== MEDIA QUERIES RESPONSIVE - AJOUTS POUR REDMI 14 ===== */

/* ✅ NOUVEAU : Tablettes et grands mobiles (481px-768px) - REDMI 14 */
@media (max-width: 768px) and (min-width: 481px) {
    .main-content {
        padding: 12px 12px 18px; /* Padding ajusté */
    }
    
    .header-visual-category {
        padding-top: 10px !important;
        padding-bottom: 10px !important;
    }
    
    /* ✅ POLICES CONTRÔLÉES POUR GRANDS MOBILES */
    .header-text-overlay-category h2,
    .header-text-overlay-category strong {
        font-size: clamp(1.1rem, 2.2vw, 1.4rem);
    }
    
    .header-text-overlay-category p {
        font-size: clamp(0.85rem, 1.8vw, 1rem);
    }
    
    #carousel-a4 .card-info h4 {
        font-size: clamp(0.75rem, 1.6vw, 0.85rem);
    }
    
    .popup-caption {
        font-size: clamp(0.8rem, 1.6vw, 0.9rem);
    }
    
    .joule-calculator {
        font-size: clamp(0.85rem, 1.6vw, 0.95rem);
    }
}

/* Adaptation pour mobile standard */
@media (max-width: 768px) {
    #carousel-a4 .card-info {
        padding: 3px 4px;
    }
    
    #carousel-a4 .card-info h4 {
        font-size: clamp(0.7rem, 1.8vw, 0.8rem);
    }
    
    .main-content {
        padding: 10px 12px 16px;
    }
}

@media (max-width: 600px) {
    .popup-flex-row {
        flex-direction: column;
    }
    
    .close-popup-btn,
    .scroll-top-btn,
    .nav-btn {
        width: 40px;
        height: 40px;
    }
    
    .close-icon,
    .nav-icon {
        font-size: 24px;
    }
    
    .scroll-top-icon {
        font-size: 28px;
    }
    
    .next-nav-btn {
        top: 70px !important;
    }
    
    .page-navigator {
        padding: 5px 15px;
        gap: 15px;
        bottom: 15px;
    }
    
    .page-nav-btn {
        font-size: 24px;
        width: 36px;
        height: 36px;
    }
    
    .page-indicator {
        font-size: 1rem;
        min-width: 60px;
    }
}

@media (max-width: 480px) {
    #carousel-a4 .card-info h4 {
        font-size: clamp(0.65rem, 1.6vw, 0.7rem);
    }
    
    .main-content {
        padding: 8px 10px 14px;
    }
    
    .header-visual-category {
        padding-top: 8px !important;
        padding-bottom: 8px !important;
    }
    
    .header-text-overlay-category h2,
    .header-text-overlay-category strong {
        font-size: clamp(1rem, 2.5vw, 1.2rem);
    }
    
    .header-text-overlay-category p {
        font-size: clamp(0.8rem, 2vw, 0.9rem);
    }
}

@media (max-width: 320px) {
    .main-content {
        padding: 6px 8px 12px;
    }
    
    .header-visual-category {
        padding-top: 6px !important;
        padding-bottom: 6px !important;
    }
}
/* ===== STYLES POUR VIDÉOS YOUTUBE ===== */

/* Conteneur spécifique pour YouTube */
.youtube-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9; /* Format 16:9 obligatoire pour YouTube */
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

/* Iframe YouTube */
.youtube-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Overlay YouTube (pour bouton play personnalisé) */
.youtube-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 10;
}

.youtube-wrapper:hover .youtube-overlay {
  opacity: 1;
}

/* Bouton play YouTube (identique à vos vidéos) */
.youtube-play-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #9F9FA9 0%, #171717 100%);
  border: 3px solid rgba(255, 255, 255, 0.3);
  color: white;
  font-size: 2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  pointer-events: auto; /* Important pour que le bouton soit cliquable */
}

.youtube-play-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
  border-radius: 50% 50% 0 0;
}

.youtube-play-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7);
}

/* Version alternative sans overlay (si vous préférez) */
.youtube-wrapper.no-overlay .youtube-overlay {
  display: none;
}

/* ===== RESPONSIVE POUR YOUTUBE ===== */

/* Tablette */
@media (max-width: 768px) {
  .youtube-play-btn {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .youtube-play-btn {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }
}