/* ===== HEADER ACTIONS GROUP ===== */
.header-actions {
  display: flex; align-items: center; height: var(--header-height);
}
.header-actions .lang-selector,
.header-actions .store-btn {
  border-right: 1px solid rgba(150,150,150,1);
}
.header-actions .store-btn:last-child {
  border-right: none;
}
.header-actions .login-btn {
  padding: 0 16px;
}
/* ===== LOGIN DROPDOWN ===== */
.login-selector { position: relative; }
.login-selector::after {
  content: ''; position: absolute; top: 100%; left: 0; right: 0;
  height: 8px; /* bridge the gap */
}
.login-dropdown {
  display: none; position: absolute; top: 100%; right: 0;
  margin-top: 4px;
  background: var(--color-white); border-radius: var(--radius);
  box-shadow: var(--shadow-md); overflow: hidden;
  min-width: 160px; z-index: 1001;
}
.login-selector:hover .login-dropdown,
.login-selector:focus-within .login-dropdown,
.login-dropdown.open { display: block; }
.login-dropdown a {
  display: block; padding: 10px 16px; color: var(--color-dark);
  font-size: 0.85rem; white-space: nowrap;
  border-bottom: 1px solid rgba(0,0,0,.06);
  transition: background 0.15s;
}
.login-dropdown a:last-child { border-bottom: none; }
.login-dropdown a:hover {
  background: var(--color-primary); color: var(--color-white);
}
/* ===== HEADER ===== */
:root { --header-height: 45px; }

.site-header {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
  background: rgba(164,164,164,1);
  box-shadow: var(--shadow-md);
}
.header-inner {
  max-width: var(--max-width); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-height); padding: 0 20px;
}
.store-btn {
  color: var(--color-white); font-weight: 700; font-size: 0.9rem;
  padding: 0 16px; border: none; height: var(--header-height);
  display: flex; align-items: center;
  background: rgba(185,185,185,1);
  border-radius: 0; transition: all 0.2s; white-space: nowrap;
}
.store-btn:hover { background: var(--color-primary); color: var(--color-white); }
.store-btn:hover svg { stroke: var(--color-white); }
.login-btn:hover { color: #ffffff; }
.login-btn:hover svg { stroke: #ffffff; }
.login-btn.logged-in { background: var(--color-primary); color: var(--color-white); }
.login-btn.logged-in svg { stroke: var(--color-white); }
.login-btn.logged-in:hover { background: var(--color-primary); color: var(--color-white); }
.login-btn.logged-in:hover svg { stroke: var(--color-white); }
.store-btn.active { background: var(--color-primary); color: var(--color-white); }
.store-btn.active svg { stroke: var(--color-white); }
.store-btn.active .cart-badge { color: var(--color-white); }
.cart-icon { padding: 8px 12px; font-size: 0.85rem; }
.cart-icon-img {
  display: inline-block;
  width: 42px; height: 21px;
  background: url('/img/cart-container.png') center/contain no-repeat;
  vertical-align: middle;
}
.store-btn:hover .cart-icon-img,
.store-btn.active .cart-icon-img {
  background-image: url('/img/cart-container-hover.png');
}
.cart-badge {
  display: none; background: transparent; color: var(--color-white);
  font-size: 0.7rem; font-weight: 800; min-width: 18px; height: 18px;
  border-radius: 9px; text-align: center; line-height: 18px;
  margin-left: 4px; padding: 0 4px; vertical-align: middle;
}

/* ===== LANGUAGE / LOCALE SELECTOR (3-ROW) ===== */
.lang-selector { position: relative; }
.lang-selector::after {
  content: ''; position: absolute; top: 100%; left: 0; right: 0;
  min-width: 260px;
  height: 8px; /* bridge the gap */
}
.lang-current {
  background: rgba(185,185,185,1); border: none;
  color: var(--color-white);
  padding: 0 9px; height: var(--header-height);
  display: flex; align-items: center;
  border-radius: 0;
  cursor: pointer; transition: all 0.2s; line-height: 1;
}
.lang-current:hover { background: var(--color-primary); }
.lang-current .lang-globe { width: 18px; height: 18px; display: block; }
.lang-dropdown {
  display: none; position: absolute; top: 100%; left: 0;
  margin-top: 4px;
  background: var(--color-white); border-radius: var(--radius);
  box-shadow: var(--shadow-md); overflow: hidden;
  min-width: 240px; z-index: 1001; padding: 6px 0;
}
.lang-selector:hover .lang-dropdown,
.lang-selector:focus-within .lang-dropdown,
.lang-selector.active .lang-dropdown { display: block; }

.lang-section {
  padding: 0;
}
.lang-section + .lang-section {
  border-top: 1px solid rgba(0,0,0,.08);
}
.lang-section-label {
  font-size: 0.68rem; font-weight: 800; text-transform: uppercase;
  color: #959595; padding: 6px 14px 3px; letter-spacing: 0.5px;
}
.lang-options {
  display: flex; flex-wrap: wrap; padding: 0 8px 4px;
}
.lang-option {
  display: inline-block; padding: 4px 10px; margin: 2px;
  color: var(--color-dark); font-size: 0.78rem;
  white-space: nowrap; border-radius: 4px;
  border: 1px solid transparent; background: none;
  cursor: pointer; transition: all 0.15s;
  font-family: inherit;
}
.lang-option:hover {
  background: rgba(0,32,96,.08); color: var(--color-primary);
}
.lang-option.active {
  background: var(--color-primary); color: var(--color-white);
  border-color: var(--color-primary);
}

.main-nav { display: flex; gap: 4px; }
.main-nav a {
  color: var(--color-white); font-size: 0.8rem; font-weight: 600;
  padding: 0 10px; border-radius: 0; height: var(--header-height);
  display: flex; align-items: center;
  letter-spacing: 0.5px; white-space: nowrap; transition: all 0.2s;
}
.main-nav a:hover, .main-nav a.active {
  background: var(--color-primary); color: var(--color-white);
}

.hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.hamburger span {
  display: block; width: 24px; height: 2px; background: var(--color-white);
  border-radius: 1px; transition: all 0.3s;
}
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* ===== MOBILE NAV OVERLAY ===== */
.mobile-nav-overlay {
  display: none; position: fixed; top: var(--header-height);
  left: 0; right: 0; bottom: 0;
  background: rgba(164,164,164,0.97); z-index: 999;
  flex-direction: column; padding: 30px;
}
.mobile-nav-overlay.open { display: flex; }
.mobile-nav-overlay a {
  display: block; color: var(--color-white); font-size: 1.1rem;
  padding: 14px 0; text-align: center;
  border-bottom: 1px solid rgba(255,255,255,.1);
  transition: all 0.2s; border-radius: 0;
}
.mobile-nav-overlay a:hover,
.mobile-nav-overlay a.active {
  background: var(--color-primary); color: var(--color-white);
}

@media (max-width: 1024px) {
  .main-nav { display: none; }
  .hamburger { display: flex; flex-shrink: 0; }

  /* Collapse store buttons to icon-only so hamburger fits */
  .header-inner { padding: 0 10px; }
  .store-btn { padding: 0 10px; font-size: 0; }
  .store-btn svg { width: 18px; height: 18px; }
  .cart-badge { font-size: 0.65rem; }
  .cart-icon { padding: 0 10px; }
  .login-btn { padding: 0 10px; }
  .lang-current { padding: 0 7px; }
  .lang-current .lang-globe { width: 16px; height: 16px; }
}

/* ===== LOGIN MODAL ===== */
.login-overlay {
  display: none; position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.5); justify-content: center; align-items: center;
}
.login-overlay.open { display: flex; }
.login-modal {
  background: var(--color-white); border-radius: 0;
  width: 380px; max-width: 90vw; padding: 32px 28px 24px;
  position: relative; box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}
.login-close {
  position: absolute; top: 8px; right: 12px;
  background: none; border: none; font-size: 1.5rem;
  color: var(--color-dark); cursor: pointer; line-height: 1;
  padding: 4px 8px; border-radius: 0;
}
.login-close:hover { color: var(--color-primary); }
.login-tabs {
  display: flex; gap: 0; margin-bottom: 24px;
  border-bottom: 2px solid rgba(164,164,164,0.3);
}
.login-tab {
  flex: 1; background: none; border: none; padding: 10px 0;
  font-size: 0.9rem; font-weight: 700; color: #999;
  cursor: pointer; border-radius: 0; transition: all 0.2s;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.login-tab.active {
  color: var(--color-primary); border-bottom-color: var(--color-primary);
}
.login-tab:hover { color: var(--color-dark); }
.login-form {
  display: none; flex-direction: column; gap: 12px;
}
.login-form.active { display: flex; }
.login-form label {
  font-size: 0.8rem; font-weight: 700; color: var(--color-dark);
  margin-bottom: -8px;
}
.login-form input {
  padding: 10px 12px; border: 1px solid rgba(164,164,164,0.5);
  border-radius: 0; font-size: 0.9rem; outline: none;
  transition: border-color 0.2s;
}
.login-form input:focus { border-color: var(--color-primary); }
.login-submit {
  margin-top: 4px; padding: 11px 0; border: none; border-radius: 0;
  background: var(--color-primary); color: var(--color-white);
  font-size: 0.9rem; font-weight: 700; cursor: pointer;
  transition: all 0.2s;
}
.login-submit:hover { background: #e09a1a; }
