/* ===== HEADER (persistent on all pages as module) ===== */
.header {
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 10px 20px;
  background-color: #121212;
  border-bottom: 1px solid #414141;
  gap: 10px;
  flex-wrap: nowrap;
  overflow: visible;
  height: 60px;
  width: 100%;
  z-index: 1000;
}

/* Body padding for fixed header */
body {
  padding-top: 60px;
}

.products-loading-indicator {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  color: #818181;
}

.products-loading-indicator .spinner {
  margin: 0 15px 0 0;
}

.header-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  position: sticky;
  top: 0;
  padding: 10px 20px;
  gap: 10px;
  flex-wrap: nowrap;
  overflow: visible;
  min-height: 40px;
  flex: 0 1 auto; /* Don't grow, allow shrink */
}

/* Header Icon Buttons */
.header-icon-button {
  background-color: transparent;
  border: none;
  border-radius: 0;
  padding: 7px;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  position: relative;
  border-bottom: 2px solid transparent;
  /* Link styling overrides */
  text-decoration: none;
  color: inherit;
}

.header-left-buttons {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  flex: 1;
  justify-content: flex-start;
}

.header-back-button,
.header-faq-button {
  background-color: transparent;
  border: none;
  padding: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.header-back-button svg,
.header-faq-button svg {
  width: 20px;
  height: 20px;
  color: var(--icon-color);
  fill: var(--icon-color);
}

@media (hover: hover) {
  .header-back-button:hover,
  .header-faq-button:hover {
    opacity: 0.7;
  }
}

/* Desktop: hide back button, show FAQ button */
@media (min-width: 769px) {
  .header-back-button {
    display: none;
  }

  .header-faq-button {
    display: flex;
  }
}

.header-icon {
  height: 12px;
  width: 12px;
  flex-shrink: 0;
  color: var(--icon-color);
  fill: var(--icon-color);
  transform: scale(var(--icon-scale));
}

.button-text {
  font-size: 13px;
  color: #818181;
  white-space: nowrap;
  transition: color 0.2s;
}

.cart-count-bottom-nav {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 11px;
  font-weight: 600;
  color: #818181;
}

.cart-count-header,
.cart-count-header-mobile {
  position: absolute;
  top: 7px;
  right: -24px;
  font-size: 11px;
  font-weight: 500;
  color: #ffa500;
  background: #121212;
  border-radius: 20px;
  border: solid 1px #414141;
  padding: 1px 9px 2px 9px;
}

@media (max-width: 900px) {
  .button-text { display: none; }
}

/* Active page state */
.header-icon-button.active-page .header-icon,
.header-profile-button.active-page svg {
  color: #ff6b35 !important;
  fill: #ff6b35 !important;
}

.header-icon-button.active-page .button-text {
  color: #ff6b35 !important;
}

@media (hover: hover) {
  .header-icon-button:hover {
    background-color: transparent;
    border: none;
  }

  .header-icon-button .button-text {
    position: relative;
  }

  .header-icon-button .button-text::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: #818181;
    transition: all 0.3s ease;
    transform: translateX(-50%);
  }

  .header-icon-button.active-page .button-text::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: -moz-available;
    height: 2px;
    background-color: #ff6b35;
    transition: none;
    transform: none;
  }  

  .header-icon-button:hover .button-text::after {
    width: 100%;
  }

  .header-icon-button:hover .header-icon {
    color: #a3a3a3;
    fill: #a3a3a3;
  }

  .header-icon-button:hover .button-text {
    color: #a3a3a3;
  }
}

/* Header Logo */

.header-logo-wrapper {
  display: flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
}

.header-logo-button {
  background-color: transparent;
  border: none;
  border-radius: 0;
  padding: 7px;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  position: relative;
  border-bottom: 2px solid transparent;
  /* Link styling overrides */
  text-decoration: none;
  color: inherit;
}

.header-logo-wrapper a {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-logo-full {
  height: 30px;
  padding-top: 10px;
  display: block;
  padding-bottom: 5px;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 1;
}

.header-logo-full { display: block; }
.header-logo-short { display: none; }
.header-logo-mini { display: none; }

.header-logo-short { 
  display: none; 
  max-height: 20px; 
  cursor: pointer; 
  padding: 5px; 
}

@media (max-width: 500px) {
  .header-logo-full { display: none; }
  .header-logo-short { display: block; }
  .header-logo-mini { display: none; }
}

.header-logo-mini {
  display: none;
  max-height: 20px;
  cursor: pointer;
}

@media (max-width: 400px) {
  .header-logo-full { display: none; }
  .header-logo-short { display: none; }
  .header-logo-mini { display: block; }
}

@media (max-width: 100px) {
  .header-logo { display: none; }
}

@media (hover: hover) {
  .header-logo:hover {
    color: #666;
  }
}

.beta {
  font-size: 12px;
  font-weight: 600;
  background-color: #121212;
  color: #444;
  border: 1px solid #373737;
  border-radius: 40px;
  padding: 3px 7px 5px 7px;
  white-space: nowrap;
  flex-shrink: 0;
}

.beta-full, .beta-short, .beta-mini {
  user-select: none;
}

.beta-full { display: inline; }
.beta-short { display: none; }
.beta-mini { display: none; }

@media (max-width: 800px) {
  .beta-full { display: none; }
  .beta-short { display: inline; }
  .beta-mini { display: none; }
}

@media (max-width: 700px) {
  .beta-full { display: none; }
  .beta-short { display: none; }
  .beta-mini { display: inline; }
}

@media (max-width: 300px) {
  .beta { display: none; }
}

.favorites-icon.has-favorites {
  color: #e91e63;
  fill: #e91e63;
}

svg.favorites-icon.has-favorites {
  color: #e91e63;
}

svg.favorites-icon.has-favorites path {
  fill: #e91e63;
}

/* Profile Button */
.header-profile-button {
  background-color: transparent;
  border: none;
  padding: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
  flex-shrink: 0;
  transition: opacity 0.2s;
  position: relative;
  min-width: 34px; /* Ensure consistent minimum width */
  gap: 0; /* Remove any spacing between flex items */
  /* Link styling overrides */
  text-decoration: none;
  color: inherit;
}

/* Login text styling */
.profile-btn-login-text {
  font-size: 13px;
  color: #818181;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s;
}

@media (hover: hover) {
  .header-profile-button:hover {
    opacity: 0.7;
  }

  .header-profile-button:hover .profile-btn-login-text {
    color: #a3a3a3;
  }
}

.header-profile-button svg {
  width: 20px;
  height: 20px;
  color: var(--icon-color);
  fill: var(--icon-color);
}

.profile-btn-login-icon {
  width: 20px;
  height: 20px;
  color: var(--icon-color);
  fill: var(--icon-color);
}

/* Active orders indicator on profile button */
.profile-orders-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background-color: #ff4444;
  border-radius: 50%;
  border: 2px solid #121212;
  pointer-events: none;
}

