:root {
  --black: #1a1a1a;
  --white: #fff;
  --red: #e53935;
  --gray: #f5f5f5;
  --border: #e0e0e0;
  --muted: #888;
}

#tm-common-header,
#tm-common-header * {
  box-sizing: border-box;
}

#tm-common-header .topbar {
  background: var(--black);
  color: #fff;
  text-align: center;
  padding: 8px 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  font-family: 'Montserrat', sans-serif;
}

#tm-common-header .topbar span {
  color: #ffd600;
  margin: 0 6px;
}

#tm-common-header header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#tm-common-header .header-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

#tm-common-header .site-logo-img {
  height: 32px;
  width: 188px;
  object-fit: contain;
}

#tm-common-header .header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

#tm-common-header .header-nav a {
  text-decoration: none;
  color: var(--black);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background .15s;
  white-space: nowrap;
  font-family: 'Montserrat', sans-serif;
}

#tm-common-header .header-nav a:hover {
  background: var(--gray);
}

#tm-common-header .nav-personalizat {
  background: var(--red) !important;
  color: #fff !important;
  border-radius: 8px !important;
  padding: 7px 14px !important;
  font-weight: 700 !important;
}

#tm-common-header .nav-personalizat:hover {
  background: #c62828 !important;
}

#tm-common-header .nav-dropdown {
  position: relative;
}

#tm-common-header .nav-dropdown > a {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-bottom: 8px !important;
  margin-bottom: -8px !important;
}

#tm-common-header .nav-dropdown > a::after {
  content: '▾';
  font-size: 10px;
  opacity: .6;
}

#tm-common-header .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 240px;
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 300;
  padding: 6px 0;
}

#tm-common-header .nav-dropdown:hover .dropdown-menu {
  display: block;
}

#tm-common-header .dropdown-menu a {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 10px 16px !important;
  border-radius: 0 !important;
  font-size: 13px !important;
  color: var(--black) !important;
  border-bottom: 1px solid #f5f5f5;
}

#tm-common-header .dropdown-menu a:last-child {
  border-bottom: none;
}

#tm-common-header .dropdown-menu a:hover {
  background: var(--gray) !important;
}

#tm-common-header .dd-icon {
  font-size: 16px;
}

#tm-common-header .header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#tm-common-header .btn-cart {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--black);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Montserrat', sans-serif;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
}

#tm-common-header .btn-cart:hover {
  background: #333;
}

#tm-common-header .cart-count {
  background: var(--red);
  color: #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

#tm-common-header .hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
}

#tm-common-header .hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--black);
  border-radius: 2px;
}

#tm-mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 10000;
  flex-direction: column;
  padding: 24px;
  overflow-y: auto;
}

#tm-mobile-menu.open {
  display: flex;
}

#tm-mobile-menu .mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

#tm-mobile-menu nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#tm-mobile-menu nav a {
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--black);
  text-decoration: none;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#tm-mobile-menu .mobile-section-label {
  font: 700 11px/1.3 'Montserrat', sans-serif;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 0 4px;
}

#tm-mobile-menu .mobile-menu-footer {
  margin-top: auto;
  padding-top: 24px;
  font: 13px/1.7 'Montserrat', sans-serif;
  color: var(--muted);
}

@media (max-width: 768px) {
  #tm-common-header header {
    padding: 0 16px;
  }

  #tm-common-header .header-nav {
    display: none;
  }

  #tm-common-header .hamburger {
    display: flex;
  }

  #tm-common-header .site-logo-img {
    height: 24px;
    width: 141px;
  }
}

/* Mobil: linkuri principale cu MAJUSCULE, subcategorii normale și indentate */
#tm-mobile-menu nav > a {
  text-transform: uppercase !important;
}
#tm-mobile-menu .mobile-dropdown-toggle {
  text-transform: uppercase !important;
}
#tm-mobile-menu .mobile-dropdown-content {
  padding-left: 18px !important;
}
#tm-mobile-menu .mobile-dropdown-content a,
#tm-mobile-menu .mobile-subcat {
  text-transform: none !important;
  padding-left: 0 !important;
}


/* FIX meniu mobil: subcategoriile fiecare pe rand, text normal, indentate */
#mobileMenu .mobile-dropdown-content,
#tm-mobile-menu .mobile-dropdown-content {
  padding-left: 18px !important;
  background: #fafafa !important;
}

#mobileMenu .mobile-dropdown-content a,
#tm-mobile-menu .mobile-dropdown-content a {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  box-sizing: border-box !important;
  color: #1a1a1a !important;
  text-decoration: none !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  padding: 11px 0 11px 8px !important;
  border-bottom: 1px solid #e8e8e8 !important;
  text-transform: none !important;
}

#mobileMenu .mobile-dropdown-content a:last-child,
#tm-mobile-menu .mobile-dropdown-content a:last-child {
  border-bottom: 0 !important;
}

#mobileMenu nav > a,
#mobileMenu .mobile-dropdown-toggle,
#tm-mobile-menu nav > a,
#tm-mobile-menu .mobile-dropdown-toggle {
  text-transform: uppercase !important;
}


/* ── SEARCH HEADER ── */
#tm-common-header .header-search {
  position: relative;
  width: 210px;
  flex: 0 0 210px;
}

#tm-common-header .header-search-box {
  height: 36px;
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

#tm-common-header .header-search-box:focus-within {
  border-color: #aaa;
  box-shadow: 0 0 0 2px rgba(0,0,0,.04);
}

#tm-common-header .header-search-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--black);
  cursor: pointer;
  padding: 0;
}

#tm-common-header .header-search-icon svg {
  width: 17px;
  height: 17px;
  display: block;
}

#tm-common-header .header-search-input {
  width: 100%;
  min-width: 0;
  height: 34px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--black);
  font: 600 12px/1 'Montserrat', sans-serif;
  padding: 0 10px 0 0;
}

#tm-common-header .header-search-input::placeholder {
  color: #999;
}

#tm-common-header .header-search-results {
  display: none;
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  width: 340px;
  max-height: 420px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.15);
  z-index: 500;
  padding: 6px;
}

#tm-common-header .header-search-results.open {
  display: block;
}

#tm-common-header .header-search-result {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 7px;
  border-radius: 7px;
  text-decoration: none;
  color: var(--black);
}

#tm-common-header .header-search-result:hover,
#tm-common-header .header-search-result.active {
  background: var(--gray);
}

#tm-common-header .header-search-result img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  background: #f3f3f3;
}

#tm-common-header .header-search-result-name {
  display: block;
  font: 700 12px/1.35 'Montserrat', sans-serif;
}

#tm-common-header .header-search-result-meta {
  display: block;
  margin-top: 3px;
  font: 500 10px/1.3 'Montserrat', sans-serif;
  color: var(--muted);
}

#tm-common-header .header-search-empty,
#tm-common-header .header-search-loading {
  padding: 12px;
  font: 600 11px/1.4 'Montserrat', sans-serif;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 768px) {
  #tm-common-header header {
    height: auto;
    min-height: 64px;
    flex-wrap: wrap;
    row-gap: 8px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  #tm-common-header .header-logo { order: 1; }
  #tm-common-header .header-actions { order: 2; margin-left: auto; }

  #tm-common-header .header-search {
    order: 3;
    width: 100%;
    flex: 0 0 100%;
  }

  #tm-common-header .header-search-results {
    left: 0;
    right: 0;
    width: 100%;
  }
}


#tm-common-header .header-search-special-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #fff4e8;
  font-size: 24px;
}

#tm-common-header .header-search-result-special {
  border-bottom: 1px solid #eeeeee;
  margin-bottom: 4px;
}
