/* === TMAX MULTILINGUA V4 - BANDIERE REALI === */
.tmax-lang-btn{
  border:1px solid #303a45;
  background:rgba(7,16,20,.28);
  color:#fff;
  height:42px;
  padding:0 13px;
  border-radius:10px;
  font-weight:900;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:8px;
  box-shadow:0 8px 25px rgba(0,0,0,.12);
  backdrop-filter:blur(2px);
  -webkit-backdrop-filter:blur(2px);
  font-size:13px;
}

.tmax-lang-btn:hover{
  border-color:#e10600;
}

#tmaxLangFloating{
  position:fixed;
  top:8px;
  right:150px;
  z-index:99998;
}

.tmax-country-flag-css{
  width:30px;
  height:20px;
  border-radius:3px;
  display:inline-block;
  border:1px solid rgba(255,255,255,.45);
  box-shadow:0 2px 6px rgba(0,0,0,.35);
  flex:0 0 auto;
}

.tmax-country-flag-css.IT{
  background:linear-gradient(90deg,#009246 0 33.33%,#fff 33.33% 66.66%,#ce2b37 66.66% 100%);
}

.tmax-country-flag-css.FR{
  background:linear-gradient(90deg,#0055a4 0 33.33%,#fff 33.33% 66.66%,#ef4135 66.66% 100%);
}

.tmax-country-flag-css.DE{
  background:linear-gradient(180deg,#000 0 33.33%,#dd0000 33.33% 66.66%,#ffce00 66.66% 100%);
}

.tmax-country-flag-css.ES{
  background:linear-gradient(180deg,#aa151b 0 25%,#f1bf00 25% 75%,#aa151b 75% 100%);
}

.tmax-country-flag-css.GB{
  background:
    linear-gradient(33deg,transparent 43%,#fff 43% 48%,#c8102e 48% 52%,#fff 52% 57%,transparent 57%),
    linear-gradient(147deg,transparent 43%,#fff 43% 48%,#c8102e 48% 52%,#fff 52% 57%,transparent 57%),
    linear-gradient(90deg,transparent 42%,#fff 42% 58%,transparent 58%),
    linear-gradient(180deg,transparent 38%,#fff 38% 62%,transparent 62%),
    linear-gradient(90deg,transparent 46%,#c8102e 46% 54%,transparent 54%),
    linear-gradient(180deg,transparent 43%,#c8102e 43% 57%,transparent 57%),
    #012169;
}

.tmax-country-flag-css.US{
  background:
    linear-gradient(180deg,
      #b22234 0 7.69%,#fff 7.69% 15.38%,
      #b22234 15.38% 23.07%,#fff 23.07% 30.76%,
      #b22234 30.76% 38.45%,#fff 38.45% 46.14%,
      #b22234 46.14% 53.83%,#fff 53.83% 61.52%,
      #b22234 61.52% 69.21%,#fff 69.21% 76.9%,
      #b22234 76.9% 84.59%,#fff 84.59% 92.28%,
      #b22234 92.28% 100%);
  position:relative;
}

.tmax-country-flag-css.US:before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  width:45%;
  height:54%;
  background:#3c3b6e;
}

#tmaxLangOverlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.74);
  backdrop-filter:blur(6px);
  z-index:99999;
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
}

#tmaxLangOverlay.open{
  display:flex;
}

.tmax-lang-box{
  width:min(700px,94vw);
  background:#11161d;
  border:1px solid #303a45;
  border-radius:18px;
  color:#fff;
  overflow:hidden;
  box-shadow:0 24px 80px rgba(0,0,0,.55);
}

.tmax-lang-head{
  padding:22px 24px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  border-bottom:1px solid #29313b;
}

.tmax-lang-head h2{
  margin:0;
  font:800 28px Oswald,Arial,sans-serif;
  text-transform:uppercase;
}

.tmax-lang-close{
  width:40px;
  height:40px;
  border:0;
  border-radius:50%;
  background:#202832;
  color:#fff;
  font-size:20px;
  cursor:pointer;
}

.tmax-lang-body{
  padding:22px 24px 24px;
}

.tmax-lang-body p{
  color:#aeb9c7;
  margin:0 0 16px;
}

.tmax-country-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:12px;
}

.tmax-country-card{
  border:1px solid #303a45;
  background:#0b0f14;
  color:#fff;
  border-radius:13px;
  padding:14px;
  cursor:pointer;
  text-align:left;
  display:flex;
  gap:12px;
  align-items:center;
}

.tmax-country-card:hover,
.tmax-country-card.active{
  border-color:#e10600;
  background:#171f28;
}

.tmax-country-name{
  display:block;
  font-weight:900;
}

.tmax-country-meta{
  color:#8fa1b5;
  font-size:12px;
}

@media(max-width:900px){
  #tmaxLangFloating{
    top:auto;
    right:12px;
    bottom:12px;
  }

  .tmax-country-grid{
    grid-template-columns:1fr;
  }
}

/* === BANDIERA VICINO AL CARRELLO === */
#tmaxLangFloating{
  position:static!important;
  top:auto!important;
  right:auto!important;
  bottom:auto!important;
  margin-left:8px!important;
  height:42px!important;
  white-space:nowrap!important;
  flex:0 0 auto!important;
}

#tmaxLangFloating .tmax-country-flag-css{
  width:26px!important;
  height:18px!important;
}

@media(max-width:900px){
  #tmaxLangFloating{
    position:static!important;
    margin-left:6px!important;
  }
}

/* === FIX DEFINITIVO: LINGUA COMPATTA VICINO AL CARRELLO === */
.actions,
.shop-head-actions{
  display:flex!important;
  align-items:center!important;
  gap:9px!important;
  flex-wrap:nowrap!important;
}

.actions #tmaxLangFloating,
.shop-head-actions #tmaxLangFloating,
#tmaxLangFloating.tmax-lang-compact{
  position:static!important;
  top:auto!important;
  right:auto!important;
  bottom:auto!important;
  left:auto!important;
  transform:none!important;
  z-index:1!important;
  margin:0!important;
  width:auto!important;
  min-width:74px!important;
  height:42px!important;
  padding:0 10px!important;
  border-radius:9px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:6px!important;
  white-space:nowrap!important;
  flex:0 0 auto!important;
}

#tmaxLangFloating.tmax-lang-compact strong{
  display:none!important;
}

#tmaxLangFloating .tmax-lang-code{
  font-weight:900!important;
  font-size:12px!important;
  color:#fff!important;
}

#tmaxLangFloating .tmax-lang-arrow{
  font-size:11px!important;
  color:#b9c3cf!important;
  margin-left:-2px!important;
}

#tmaxLangFloating .tmax-country-flag-css{
  width:25px!important;
  height:17px!important;
}

body > #tmaxLangFloating.tmax-lang-compact{
  position:fixed!important;
  top:14px!important;
  right:14px!important;
}

@media(max-width:900px){
  .actions #tmaxLangFloating,
  .shop-head-actions #tmaxLangFloating,
  #tmaxLangFloating.tmax-lang-compact{
    position:static!important;
    min-width:62px!important;
    padding:0 8px!important;
  }
}
