/* ================================================================
   TopBeauty Theme – Header Widget v2
   Basato sul prototipo HTML ufficiale
================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&family=Jost:wght@200;300;400;600&display=swap');

/* ════════════════════════════════════
   BREAKOUT + RESET
════════════════════════════════════ */
.elementor-widget-tbt_header,
.elementor-widget-tbt_header > .elementor-widget-container {
  padding: 0 !important;
  margin: 0 !important;
  font-size: 0 !important;
  line-height: 0 !important;
}

.tbt-header-wrap {
  font-size: initial !important;
  line-height: normal !important;
  width: 100vw !important;
  max-width: 100vw !important;
  margin-left: calc(-50vw + 50%) !important;
  position: relative !important;
  display: block;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;

  --tbt-h-black:  #111111;
  --tbt-h-white:  #ffffff;
  --tbt-h-muted:  #666666;
  --tbt-h-line:   #e8e8e8;
  --tbt-h-navbar: #111111;
  --tbt-h-hover:  #2a2a2a;
  --tbt-h-mega:   #ffffff;
  --tbt-h-tr:     0.2s cubic-bezier(.4,0,.2,1);
  font-family: 'Jost', sans-serif;
}

/* Azzera sezione/container padre */
.elementor:has(.elementor-widget-tbt_header) .e-con:has(.elementor-widget-tbt_header),
.elementor:has(.elementor-widget-tbt_header) .elementor-section:has(.elementor-widget-tbt_header) {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.tbt-header-wrap *,
.tbt-header-wrap *::before,
.tbt-header-wrap *::after { box-sizing: border-box; }

.tbt-header-wrap a { text-decoration: none; color: inherit; }
.tbt-header-wrap button { cursor: pointer; background: none; border: none; padding: 0; }

/* Sticky */
.tbt-header-wrap.tbt-sticky {
  position: sticky !important;
  top: 0 !important;
  z-index: 999 !important;
  box-shadow: 0 2px 12px rgba(0,0,0,.10);
}
.tbt-header-wrap.tbt-sticky.tbt-scrolled .tbt-topbar {
  max-height: 0;
  overflow: hidden;
  padding-top: 0;
  padding-bottom: 0;
  border-bottom: none;
}

/* ════════════════════════════════════
   TOP BAR
════════════════════════════════════ */
.tbt-topbar {
  background: #fff;
  border-bottom: 1px solid var(--tbt-h-line);
  padding: 8px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #222;
  max-height: 60px;
  transition: max-height var(--tbt-h-tr), padding var(--tbt-h-tr);
}
.tbt-topbar-left,
.tbt-topbar-right { display: flex; align-items: center; gap: 20px; }
.tbt-topbar-center { display: flex; align-items: center; gap: 8px; }

.tbt-topbar a {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: #222; transition: opacity var(--tbt-h-tr);
}
.tbt-topbar a:hover { opacity: .6; }

.tbt-topbar-cta {
  border-bottom: 1px solid #222;
  padding-bottom: 1px;
}

/* ════════════════════════════════════
   MAIN HEADER
════════════════════════════════════ */
.tbt-main-header {
  background: #fff;
  padding: 18px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--tbt-h-line);
}

/* Hamburger (solo mobile) */
.tbt-hamburger {
  display: none;
  background: none; border: none;
  cursor: pointer; color: var(--tbt-h-black); padding: 4px;
}

/* Logo */
.tbt-logo {
  display: flex; flex-direction: column;
  align-items: flex-start; line-height: 1;
  text-decoration: none;
}
.tbt-logo-wordmark {
  font-family: 'Jost', sans-serif;
  font-weight: 200;
  font-size: 28px;
  letter-spacing: 10px;
  color: #111;
  text-transform: uppercase;
}
.tbt-logo-sub {
  font-family: 'Jost', sans-serif;
  font-weight: 300; font-size: 8px;
  letter-spacing: 4px; color: #666;
  text-transform: uppercase; margin-top: 3px; padding-left: 2px;
}
.tbt-logo-img { height: auto; display: block; }

/* Icone header */
.tbt-header-icons { display: flex; align-items: center; gap: 22px; }
.tbt-header-icons a,
.tbt-header-icons button {
  position: relative; color: #111;
  background: none; border: none; padding: 0; cursor: pointer;
  transition: opacity var(--tbt-h-tr); display: flex; align-items: center;
  text-decoration: none;
}
.tbt-header-icons a:hover,
.tbt-header-icons button:hover { opacity: .5; }

/* Badge icone */
.tbt-badge {
  position: absolute !important;
  top: -7px !important; right: -8px !important;
  width: 18px !important; height: 18px !important;
  min-width: unset !important; min-height: unset !important;
  max-width: 18px !important; max-height: 18px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 9px !important; font-weight: 700 !important;
  font-family: 'Poppins', sans-serif !important;
  line-height: 18px !important;
  text-align: center !important;
  color: #111 !important;
  padding: 0 !important; margin: 0 !important;
  box-sizing: border-box !important;
  letter-spacing: 0 !important;
  border: none !important; box-shadow: none !important;
}
.tbt-badge--wish { background: transparent !important; }
.tbt-badge--cart { background: transparent !important; }

/* Override anche per selettori Elementor salvati nel DB */
[class*="elementor-element"] .tbt-wb--wish { background: transparent !important; color: #111 !important; }
[class*="elementor-element"] .tbt-wb--cart { background: transparent !important; color: #111 !important; }

/* Search bar */
.tbt-search-bar {
  background: #fff;
  border-bottom: 1px solid var(--tbt-h-line);
  max-height: 0; overflow: hidden; padding: 0;
  transition: max-height 0.3s ease, padding 0.3s ease;
}
.tbt-search-bar.open { max-height: 80px; padding: 14px 40px; }
.tbt-search-form {
  display: flex; align-items: center; gap: 12px;
  max-width: 680px; margin: 0 auto; width: 100%;
}
.tbt-search-input {
  flex: 1; border: none; border-bottom: 1px solid #ddd; outline: none;
  font-family: 'Jost', sans-serif; font-size: 15px; font-weight: 300;
  letter-spacing: 0.04em; padding: 6px 0; background: transparent;
  transition: border-color var(--tbt-h-tr);
}
.tbt-search-input:focus { border-bottom-color: #111; }
.tbt-search-submit,
.tbt-search-close {
  background: none; border: none; cursor: pointer; color: #555;
  display: flex; padding: 0; transition: color var(--tbt-h-tr);
}
.tbt-search-submit:hover, .tbt-search-close:hover { color: #111; }

/* ════════════════════════════════════
   NAVBAR DESKTOP
════════════════════════════════════ */
.tbt-navbar {
  background: var(--tbt-h-navbar);
  position: relative; z-index: 100;
  margin-bottom: 0 !important;
  border-bottom: none !important;
  padding-bottom: 0 !important;
}
.tbt-navbar-inner {
  display: flex; align-items: center; justify-content: center;
  padding: 0 40px;
}

/* Nav items */
.tbt-nav-item { position: static; }

.tbt-nav-link {
  display: flex; align-items: center; gap: 4px;
  padding: 16px 24px;
  font-family: 'Jost', sans-serif;
  font-size: 13px; font-weight: 400;
  letter-spacing: 0.08em; color: #fff;
  cursor: pointer; transition: background var(--tbt-h-tr);
  white-space: nowrap; user-select: none; text-decoration: none;
}
.tbt-nav-link a { color: inherit; text-decoration: none; font: inherit; letter-spacing: inherit; }
.tbt-nav-link--plain { display: flex; }
.tbt-nav-link--plain:hover { background: var(--tbt-h-hover); }
.tbt-nav-item:hover > .tbt-nav-link,
.tbt-nav-item.open  > .tbt-nav-link { background: var(--tbt-h-hover); }

.tbt-chevron {
  width: 10px; height: 10px; flex-shrink: 0;
  transition: transform .25s; stroke: currentColor;
}
.tbt-nav-item.open .tbt-chevron { transform: rotate(180deg); }

/* ════════════════════════════════════
   MEGA MENU
════════════════════════════════════ */
.tbt-mega-menu {
  display: none;
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--tbt-h-mega);
  border-top: 2px solid var(--tbt-h-navbar);
  box-shadow: 0 8px 30px rgba(0,0,0,.12);
  z-index: 200;
}
.tbt-nav-item.open > .tbt-mega-menu { display: block; }

.tbt-mega-inner {
  display: flex;
  padding: 40px 60px 48px;
  gap: 0;
}
.tbt-mega-cols {
  display: flex;
  flex: 1;
  gap: 0;
  min-width: 0;
}
.tbt-mega-col {
  flex: 1;
  padding-right: 40px;
  min-width: 200px;
}
.tbt-mega-col:last-child { padding-right: 0; }

.tbt-mega-col-title {
  font-family: 'Jost', sans-serif !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  color: #111 !important;
  border-bottom: 2px solid #111 !important;
  padding-bottom: 10px !important;
  margin-bottom: 18px !important;
  display: block !important;
}
.tbt-mega-col ul { list-style: none !important; padding: 0 !important; margin: 0 !important; }
.tbt-mega-col ul li { margin-bottom: 10px !important; }
.tbt-mega-col ul li a {
  font-family: 'Jost', sans-serif !important;
  font-size: 14px !important;
  font-weight: 300 !important;
  color: #333 !important;
  letter-spacing: 0.02em !important;
  text-decoration: none !important;
  display: block !important;
  transition: color 0.15s, font-weight 0.15s;
}
.tbt-mega-col ul li a:hover { color: #111 !important; font-weight: 400 !important; }
.tbt-mega-col ul li a.tbt-sub-item { padding-left: 14px !important; color: #666 !important; font-size: 13px !important; }

/* Colonna footer link "Tutti i prodotti" */
.tbt-mega-col-footer {
  margin-top: 20px !important;
  padding-top: 14px !important;
  border-top: 1px solid #eee !important;
}
.tbt-mega-col-footer a {
  font-family: 'Jost', sans-serif !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  color: #111 !important;
  border-bottom: 1px solid #111 !important;
  padding-bottom: 1px !important;
  text-decoration: none !important;
}

/* Immagini mega */
.tbt-mega-images {
  display: flex; gap: 12px; flex-shrink: 0; width: 360px;
}
.tbt-mega-img-block {
  flex: 1; position: relative; overflow: hidden;
  border-radius: 2px; min-height: 300px;
}
.tbt-mega-img-block img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .4s;
}
.tbt-mega-img-block:hover img { transform: scale(1.04); }
.tbt-mega-img-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.52));
  padding: 18px 16px 20px; color: #fff;
}
.tbt-mega-img-overlay h3 {
  font-family: 'Jost', sans-serif !important;
  font-size: 20px !important;
  font-weight: 400 !important;
  margin-bottom: 8px !important;
  line-height: 1.25 !important;
}
.tbt-mega-img-overlay a {
  font-size: 10px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: #fff;
  border-bottom: 1px solid #fff; padding-bottom: 2px; text-decoration: none;
}

/* Template-based mega menu */
.tbt-mega-template {
  width: 100%;
  padding: 40px 60px 48px;
}
.tbt-mega-template > .elementor,
.tbt-mega-template > .elementor-element,
.tbt-mega-template > .e-con {
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}
/* Reset Elementor section/container padding inside mega menu */
.tbt-mega-template .elementor-section,
.tbt-mega-template .e-con {
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
/* Reset top-level container inside template */
.tbt-mega-template > .elementor > .elementor-section,
.tbt-mega-template > .elementor > .e-con,
.tbt-mega-template > .e-con {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
/* Ensure inner columns don't have extra gap */
.tbt-mega-template .elementor-section .elementor-container {
  max-width: 100% !important;
}
.tbt-mega-template--empty {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
}
/* Tablet */
@media (max-width: 1024px) and (min-width: 768px) {
  .tbt-mega-template {
    padding: 28px 40px 34px;
  }
}

/* Brand grid */
.tbt-mega-brands-grid {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 20px 30px; align-items: center; width: 100%;
}
.tbt-brand-item {
  display: flex; align-items: center; justify-content: center;
  padding: 12px 16px; border: 1px solid #e8e8e8; border-radius: 2px;
  text-decoration: none; height: 60px;
  transition: border-color var(--tbt-h-tr), box-shadow var(--tbt-h-tr);
}
.tbt-brand-item:hover { border-color: #111; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.tbt-brand-name {
  font-family: 'Butler', 'Georgia', serif;
  font-size: 18px; font-weight: 500; color: #111; letter-spacing: .05em;
}

/* Backdrop */
.tbt-menu-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.28); z-index: -1;
}
.tbt-navbar.has-open .tbt-menu-backdrop { display: block; }

/* ════════════════════════════════════
   MOBILE DRAWER
════════════════════════════════════ */
.tbt-hdr-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.4); z-index: 9800;
  opacity: 0; transition: opacity 0.3s ease;
}
.tbt-hdr-overlay.open { display: block; opacity: 1; }

.tbt-mobile-drawer {
  position: fixed; top: 0; left: 0;
  width: 82vw; max-width: 340px; height: 100%;
  background: #fff; z-index: 9900;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform .32s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
}
.tbt-mobile-drawer.open { transform: translateX(0); }

.tbt-hdrawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid #eee; flex-shrink: 0;
}
.tbt-hdrawer-logo { text-decoration: none; color: #111; }
.tbt-hdrawer-close {
  background: #f3f3f3; border: none;
  width: 34px; height: 34px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #333;
}

.tbt-hdrawer-nav { flex: 1; padding: 8px 0; }

/* Drawer items */
.tbt-hdm-item { border-bottom: 1px solid #f0f0f0; }
.tbt-hdm-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
  font-family: 'Jost', sans-serif; font-size: 16px; font-weight: 400;
  color: #111; cursor: pointer; user-select: none;
  transition: color var(--tbt-h-tr); text-decoration: none;
}
.tbt-hdm-head--link { display: block; }
.tbt-hdm-item.open > .tbt-hdm-head { color: #bbb; }
.tbt-hdm-chevron  { width: 16px; height: 16px; flex-shrink: 0; transition: transform .22s; }
.tbt-sub-chevron  { width: 14px; height: 14px; flex-shrink: 0; transition: transform .22s; }
.tbt-hdm-item.open > .tbt-hdm-head .tbt-hdm-chevron { transform: rotate(180deg); }

.tbt-hdm-sub { display: none; flex-direction: column; background: #fff; }
.tbt-hdm-item.open > .tbt-hdm-sub { display: flex; }

.tbt-hdm-sub2-wrap.open > .tbt-hdm-sub-item .tbt-sub-chevron { transform: rotate(180deg); }

.tbt-hdm-sub-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 24px 13px 32px;
  font-family: 'Jost', sans-serif; font-size: 14px; font-weight: 300;
  color: #333; border-bottom: 1px solid #f5f5f5;
  cursor: pointer; user-select: none;
}
.tbt-hdm-sub2-wrap.open > .tbt-hdm-sub-item { color: #bbb; }

.tbt-hdm-deep { display: none; flex-direction: column; background: #fafafa; }
.tbt-hdm-sub2-wrap.open > .tbt-hdm-deep { display: flex; }

.tbt-hdm-plain {
  display: block; padding: 13px 24px 13px 32px;
  font-family: 'Jost', sans-serif; font-size: 14px; font-weight: 300;
  color: #333; border-bottom: 1px solid #f5f5f5; text-decoration: none;
  transition: color var(--tbt-h-tr);
}
.tbt-hdm-plain:hover { color: #111; }

/* Drawer footer */
.tbt-hdrawer-footer { padding: 24px 24px 32px; border-top: 1px solid #eee; flex-shrink: 0; }
.tbt-hdrawer-account {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Jost', sans-serif; font-size: 15px; font-weight: 400;
  color: #111; margin-bottom: 16px;
}
.tbt-hdrawer-btn {
  display: block; width: 100%; padding: 14px;
  font-family: 'Poppins', sans-serif; font-size: 14px; font-weight: 600;
  letter-spacing: .06em; text-align: center; border-radius: 30px;
  text-decoration: none; cursor: pointer; margin-bottom: 10px;
  transition: background var(--tbt-h-tr), border-color var(--tbt-h-tr);
}
.tbt-hdrawer-btn--primary { background: #111; color: #fff; border: none; }
.tbt-hdrawer-btn--primary:hover { background: #333; }
.tbt-hdrawer-btn--secondary { background: #fff; color: #111; border: 1.5px solid #ddd; }
.tbt-hdrawer-btn--secondary:hover { border-color: #111; }
.tbt-hdrawer-social { display: flex; gap: 18px; margin-top: 20px; }
.tbt-hdrawer-social a { color: #111; text-decoration: none; transition: opacity var(--tbt-h-tr); }
.tbt-hdrawer-social a:hover { opacity: .5; }

/* ════════════════════════════════════
   BOTTOM TAB BAR
════════════════════════════════════ */
.tbt-bottom-tabbar {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; border-top: 1px solid #e8e8e8;
  z-index: 500; padding: 10px 0 14px;
}
.tbt-bottom-tabbar-inner {
  display: flex; align-items: center; justify-content: space-around;
}
.tbt-tab-btn {
  position: relative; display: flex; align-items: center;
  color: #333; background: none; border: none; cursor: pointer; padding: 0 8px;
  text-decoration: none;
}
.tbt-tab-btn svg { width: 24px; height: 24px; }
.tbt-tab-badge {
  position: absolute; top: -4px; right: 0;
  background: transparent; color: #111;
  font-size: 9px; font-weight: 700;
  width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.tbt-tab-badge--red { background: transparent; color: #111; }

/* ════════════════════════════════════
   RESPONSIVE
════════════════════════════════════ */
@media (max-width: 1024px) and (min-width: 768px) {
  .tbt-topbar { padding: 8px 24px; }
  .tbt-topbar-center { display: none; }
  .tbt-main-header { padding: 14px 24px; }
  .tbt-navbar-inner { padding: 0 12px; }
  .tbt-nav-link { padding: 14px 12px; font-size: 12px; letter-spacing: .04em; }
  .tbt-mega-inner { padding: 28px 40px 34px; }
  .tbt-mega-images { width: 300px; }
}

@media (max-width: 767px) {
  .tbt-topbar  { display: none; }
  .tbt-navbar  { display: none; }
  .tbt-hamburger { display: flex; }
  .tbt-main-header {
    padding: 14px 20px;
    position: sticky; top: 0; z-index: 400;
    box-shadow: 0 1px 6px rgba(0,0,0,.07);
  }
  .tbt-logo-wordmark { font-size: 20px; letter-spacing: 7px; }
  .tbt-logo-sub      { font-size: 7px; letter-spacing: 3px; }
  .tbt-icon-account, .tbt-icon-wishlist, .tbt-icon-search { display: none !important; }
  .tbt-header-icons { gap: 14px; }
  .tbt-bottom-tabbar { display: block; }
  .tbt-search-bar.open { padding: 12px 20px; }
  body { padding-bottom: 70px; }
}

/* ── Mega immagini: variante singola ── */
.tbt-mega-images--single {
  width: 300px;
}
.tbt-mega-images--single .tbt-mega-img-block {
  min-height: 280px;
}

.tbt-hdm-sub-col-title {
  padding: 10px 24px 6px 32px;
  font-family: 'Jost', sans-serif;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: #111; border-top: 1px solid #f0f0f0; margin-top: 4px;
}
.tbt-hdm-sub-col-title:first-child { border-top: none; margin-top: 0; }
