/**
 * EHUKA - Styles personnalisés pour header, search et carrousel
 */

/* ============================================================================
   1. HEADER MAIN - JAUNE EHUKA (remplace turquoise)
   ============================================================================ */
.ehuka-header-main.hidden-md-down {
  background: var(--ehuka-primary) !important;
  padding: 20px 0;
}

/* Header top - CACHÉ (pas utile) */
.ehuka-header-top.hidden-md-down {
  display: none !important;
}

/* ============================================================================
   2. SEARCH BAR - Style moderne avec loupe dedans
   ============================================================================ */

/* CACHER le wrapper externe qui contient le bouton */
.tvheader-top-search-wrapper {
  display: none !important;
  visibility: hidden !important;
  position: absolute !important;
  left: -9999px !important;
}

/* Container du widget de recherche - TAILLE RÉDUITE */
#search_widget,
.tvcmsheader-search,
.ehuka-search {
  position: relative !important;
  width: 100% !important;
  max-width: 450px !important;
}

/* Wrapper form pour permettre le ::before */
#search_widget form,
.tvcmsheader-search form {
  position: relative !important;
  display: block !important;
}

/* Loupe professionnelle avec SVG sur le FORM */
#search_widget form::before,
.tvcmsheader-search form::before {
  content: "" !important;
  position: absolute !important;
  left: 15px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 20px !important;
  height: 20px !important;
  pointer-events: none !important;
  z-index: 100 !important;
  display: block !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235D576B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cpath d='m21 21-4.35-4.35'%3E%3C/path%3E%3C/svg%3E") !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
}

/* Input de recherche - style moderne avec padding pour la loupe */
#search_widget input[type="text"],
.tvcmsheader-search input[type="text"],
.ui-autocomplete-input {
  width: 100% !important;
  padding: 12px 45px 12px 45px !important;
  border: 2px solid #e6ebe0 !important;
  border-radius: 50px !important;
  font-size: 14px !important;
  background: white !important;
  transition: all 0.3s ease !important;
  box-sizing: border-box !important;
}

#search_widget input[type="text"]:focus,
.tvcmsheader-search input[type="text"]:focus {
  outline: none !important;
  border-color: var(--ehuka-accent) !important;
  box-shadow: 0 0 0 4px rgba(112, 215, 116, 0.15) !important;
}

/* CACHER le bouton submit et toutes les icônes externes */
#search_widget button,
.tvcmsheader-search button,
#search_widget .search-btn,
.tvcmsheader-search .material-icons,
button[type="submit"] {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
}

/* ============================================================================
   3. CARROUSEL - Hauteur compacte sans padding
   ============================================================================ */

@media (min-width: 992px) {
  /* Container principal du carrousel */
  .tvcms-slider-offerbanner-wrapper.container-fluid,
  .tvcms-slider-offerbanner-wrapper {
    max-height: 400px !important;
    height: 400px !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Slider lui-même */
  .tvcms-slider-offerbanner-wrapper .carousel,
  .tvcms-slider-offerbanner-wrapper .carousel-inner,
  .tvcms-slider-offerbanner-wrapper .tvcmshomeslider {
    max-height: 400px !important;
    height: 400px !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Items individuels */
  .tvcms-slider-offerbanner-wrapper .carousel-item,
  .tvcms-slider-offerbanner-wrapper .slide {
    max-height: 400px !important;
    height: 400px !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Images - remplissent tout l'espace */
  .tvcms-slider-offerbanner-wrapper .carousel-item img,
  .tvcms-slider-offerbanner-wrapper img {
    max-height: 400px !important;
    height: 400px !important;
    width: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
  }
}

/* Tablette */
@media (min-width: 768px) and (max-width: 991px) {
  .tvcms-slider-offerbanner-wrapper,
  .tvcms-slider-offerbanner-wrapper .carousel,
  .tvcms-slider-offerbanner-wrapper .carousel-item {
    max-height: 300px !important;
    height: 300px !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .tvcms-slider-offerbanner-wrapper img {
    max-height: 300px !important;
    height: 300px !important;
    width: 100% !important;
    object-fit: cover !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
  }
}

/* Mobile */
@media (max-width: 767px) {
  .tvcms-slider-offerbanner-wrapper,
  .tvcms-slider-offerbanner-wrapper .carousel,
  .tvcms-slider-offerbanner-wrapper .carousel-item {
    padding: 0 !important;
    margin: 0 !important;
  }

  .tvcms-slider-offerbanner-wrapper img {
    max-height: 250px !important;
    height: 250px !important;
    width: 100% !important;
    object-fit: cover !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
  }
}

/* Section banner si elle existe */
#vapoteurheaderbanniere,
.tvcmshome-slider-container {
  max-height: 400px !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* ============================================================================
   4. SÉLECTEUR DE LANGUE CUSTOM - Avec drapeaux
   ============================================================================ */

/* CACHER complètement le widget Google par défaut */
#google_translate_element {
  display: none !important;
  visibility: hidden !important;
  position: absolute !important;
  left: -9999px !important;
}

/* CACHER COMPLÈTEMENT le bandeau/toolbar Google Translate */
.goog-te-banner-frame,
.goog-te-banner-frame.skiptranslate,
#goog-gt-tt,
.goog-te-balloon-frame,
div#goog-gt-,
.goog-te-banner-frame.skiptranslate,
#\\:1\\.container,
#\\:0\\.container,
.goog-te-banner {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
}

/* Éviter le décalage du body quand Google Translate s'active */
body {
  top: 0 !important;
  position: static !important;
}

body.translated-ltr,
body.translated-rtl {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Forcer pour tous les iframes Google */
iframe.goog-te-banner-frame,
iframe.skiptranslate {
  display: none !important;
  height: 0 !important;
  width: 0 !important;
}

/* Empêcher Google Translate de casser le layout */
html[style*="height"] {
  height: auto !important;
}

body[style*="position"] {
  position: static !important;
}

/* Forcer le container à rester en place */
.ehuka-header-main .container,
.ehuka-header-nav .container {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
}

/* Éviter que les éléments traduits cassent le layout */
font[style] {
  display: inline !important;
}

/* Sélecteur de langue : toujours visible et fonctionnel */
.ehuka-lang-selector {
  flex-shrink: 0 !important;
  min-width: auto !important;
}

.ehuka-lang-button {
  white-space: nowrap !important;
}

/* Notre sélecteur custom - Intégré dans .ehuka-actions */
.ehuka-lang-selector {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* S'assurer que .ehuka-actions est en flex */
.ehuka-actions {
  display: flex !important;
  align-items: center !important;
  gap: 15px !important;
}

/* Bouton avec drapeau actuel - Style cohérent avec les autres actions */
.ehuka-lang-button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: white;
  border: 2px solid #e6ebe0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 13px;
  font-weight: 600;
  color: #5d576b;
  white-space: nowrap;
  height: 38px; /* Aligné avec les autres boutons */
}

.ehuka-lang-button:hover {
  border-color: var(--ehuka-accent);
  background: rgba(112, 215, 116, 0.05);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(112, 215, 116, 0.15);
}

.ehuka-lang-flag {
  font-size: 20px;
  line-height: 1;
}

.ehuka-lang-code {
  text-transform: uppercase;
  font-weight: 600;
}

.ehuka-lang-arrow {
  font-size: 12px;
  transition: transform 0.3s ease;
}

.ehuka-lang-selector.open .ehuka-lang-arrow {
  transform: rotate(180deg);
}

/* Menu déroulant avec drapeaux */
.ehuka-lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: auto;
  background: white;
  border: 2px solid #e6ebe0;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9999 !important;
  max-height: 400px;
  overflow-y: auto;
}

/* Sélecteur de langue - z-index élevé */
.ehuka-lang-selector {
  position: relative;
  z-index: 9999 !important;
}

.ehuka-lang-selector.open .ehuka-lang-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Item de langue */
.ehuka-lang-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid #f5f5f5;
}

.ehuka-lang-item:last-child {
  border-bottom: none;
}

.ehuka-lang-item:hover {
  background: linear-gradient(90deg, #f4f1bb 0%, transparent 100%);
}

.ehuka-lang-item.active {
  background: var(--ehuka-accent);
  color: white;
}

.ehuka-lang-item-flag {
  font-size: 24px;
  line-height: 1;
}

.ehuka-lang-item-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

/* Scrollbar custom pour le dropdown */
.ehuka-lang-dropdown::-webkit-scrollbar {
  width: 6px;
}

.ehuka-lang-dropdown::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 3px;
}

.ehuka-lang-dropdown::-webkit-scrollbar-thumb {
  background: var(--ehuka-accent);
  border-radius: 3px;
}

.ehuka-lang-dropdown::-webkit-scrollbar-thumb:hover {
  background: var(--ehuka-hover);
}
