/* Modern Header Styles */
.site-header {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  position: relative;
  z-index: 1000;
}

/* 1. Top Announcement Bar */
.header-top-banner {
  background: linear-gradient(90deg, #0f172a 0%, #1e293b 100%);
  color: #cbd5e1;
  font-size: 0.8rem;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.banner-tagline {
  display: flex;
  align-items: center;
}

.badge-tag {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.banner-support-links a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.78rem;
  transition: color 0.2s;
}

.banner-support-links a:hover {
  color: #ffffff;
}

/* 2. Main Navigation Bar */
.header-main-wrapper {
  background-color: #1e3a8a;
  background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
  padding: 12px 0;
}

.header-main-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Brand Logo */
.brand-logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

#logo-img {
  height: 48px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  transition: transform 0.3s;
  border-radius: 50px;
}

.brand-logo-link:hover #logo-img {
  transform: scale(1.05);
}

.brand-name-group {
  display: flex;
  flex-direction: column;
}

.brand-name {
  color: #ffffff;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
  font-family: var(--font-sans);
}

.brand-slogan {
  color: #93c5fd;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Search Box */
.header-search-form {
  flex: 1;
  max-width: 600px;
  margin: 0 15px;
}

.search-input-group {
  display: flex;
  align-items: center;
  background-color: #ffffff;
  border-radius: 30px;
  padding: 3px 4px 3px 18px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  transition: box-shadow 0.2s;
}

.search-input-group:focus-within {
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.35);
}

#search-box {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 0.92rem;
  color: #1e293b;
  padding: 8px 0;
}

#search-box::placeholder {
  color: #94a3b8;
}

#search-btn {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #ffffff;
  border: none;
  border-radius: 25px;
  padding: 8px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

#search-btn:hover {
  background: linear-gradient(135deg, #ea580c, #c2410c);
  transform: scale(1.02);
}

/* Action Buttons Group */
.header-actions-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-action-btn, .header-cart-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 10px;
  transition: background-color 0.2s;
}

.header-action-btn:hover, .header-cart-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.action-icon-wrapper, .cart-icon-wrapper {
  position: relative;
  font-size: 1.45rem;
  line-height: 1;
  color: #f8fafc;
}

.action-label {
  font-size: 0.85rem;
  font-weight: 600;
}

.cart-badge-count {
  position: absolute;
  top: -6px;
  right: -8px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  border-radius: 50%;
  text-align: center;
  border: 2px solid #1e3a8a;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* User Account Trigger & Dropdown */
.header-user-dropdown {
  position: relative;
}

.user-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 10px;
  transition: background-color 0.2s;
}

.user-trigger:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.user-avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #60a5fa;
}

.user-avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.user-info-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-greeting {
  font-size: 0.7rem;
  color: #93c5fd;
}

.user-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #ffffff;
}

.user-dropdown-icon {
  font-size: 0.75rem;
  color: #93c5fd;
}

.user-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  width: 240px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 8px 0;
  display: none;
  z-index: 1050;
  animation: fadeInDown 0.18s ease-out;
}

/* Invisible Hover Bridge to ensure smooth mouse movement */
.user-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -14px;
  left: 0;
  right: 0;
  height: 14px;
  background: transparent;
}

.header-user-dropdown:hover .user-dropdown-menu,
.header-user-dropdown:focus-within .user-dropdown-menu,
.header-user-dropdown.show .user-dropdown-menu {
  display: block;
}

.dropdown-user-header {
  padding: 8px 16px;
}

.dropdown-item-link {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  font-size: 0.88rem;
  color: #334155;
  text-decoration: none;
  transition: all 0.15s;
}

.dropdown-item-link:hover {
  background-color: #f1f5f9;
  color: #0f172a;
  padding-left: 20px;
}

.auth-buttons-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-auth-signin {
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  text-decoration: none;
  transition: all 0.2s;
}

.btn-auth-signin:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.btn-auth-signup {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-auth-signup:hover {
  background: linear-gradient(135deg, #ea580c, #c2410c);
  color: #ffffff;
  transform: translateY(-1px);
}

/* 3. Category Mega Navigation Bar */
.header-category-navbar {
  background-color: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

.category-nav-content {
  display: flex;
  align-items: center;
}

.category-main-title {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #ffffff;
  padding: 12px 20px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
}

.category-nav-items {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 12px;
}

.category-dropdown-item {
  position: relative;
}

.cat-link {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: color 0.2s;
}

.cat-arrow {
  font-size: 0.7rem;
  margin-left: 4px;
  transition: transform 0.2s;
}

.category-dropdown-item:hover .cat-link {
  color: #2563eb;
}

.category-dropdown-item:hover .cat-arrow {
  transform: rotate(180deg);
}

.cat-link-direct {
  padding: 12px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
  transition: color 0.2s;
}

.cat-link-direct:hover {
  color: #ea580c;
}

/* Mega Menu Dropdowns */
.category-mega-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
  border: 1px solid #e2e8f0;
  padding: 20px;
  display: none;
  z-index: 1040;
  animation: fadeInDown 0.18s ease-out;
}

.category-mega-dropdown::before {
  content: '';
  position: absolute;
  top: -14px;
  left: 0;
  right: 0;
  height: 14px;
  background: transparent;
}

.book-category {
  width: 680px;
  display: none;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
}

.stationery-category {
  width: 480px;
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.gift-category {
  width: 260px;
  display: none;
}

.category-dropdown-item:hover .category-mega-dropdown {
  display: grid;
}

.mega-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mega-col-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 4px;
  padding-bottom: 4px;
  border-bottom: 2px solid #e2e8f0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mega-column a {
  font-size: 0.88rem;
  color: #475569;
  text-decoration: none;
  transition: all 0.2s;
  padding: 3px 0;
}

.mega-column a:hover {
  color: #2563eb;
  padding-left: 6px;
}

/* Responsive */
@media (max-width: 991px) {
  .header-main-content {
    flex-wrap: wrap;
  }
  .header-search-form {
    order: 3;
    max-width: 100%;
    margin: 8px 0 0 0;
    width: 100%;
  }
  .category-nav-content {
    overflow-x: auto;
    white-space: nowrap;
  }
  .category-mega-dropdown {
    position: fixed;
    top: auto;
    left: 10px;
    right: 10px;
    width: calc(100vw - 20px) !important;
  }
}