/* Navbar Styles */
:root {
  --primary-color: #6e000c;
  --primary-color-alpha: rgba(110, 0, 12, 0.7);
  --text-dark: #000000;
  --text-light: #ffffff;
  --text-gray: #59413f;
  --bg-light: #ffffff;
  --bg-gray: #ffffff;
  --border-color: rgba(110, 0, 12, 0.7);
  --btn-dark: #1a1c1c;
  --font-heading: 'Gotham', sans-serif;
}

/* Page Wrapper - Global max-width constraint */
.page-wrapper {
  max-width: 1536px;
  margin: 0 auto;
  width: 100%;
  background-color: var(--bg-light);
  overflow: hidden;
}

/* Global Resets */
a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* Site Header */
.site-header {
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
  position: relative;
  border-top: 7.5px solid var(--primary-color);
}

/* Header Top */
.header-top {
  padding: 15px 0;
  background-color: #ffffff;
  position: relative;
}

.header-top .container {
  padding: 0 40px;
  max-width: 100%;
}

/* Header Content - Flex container for logos, categories, cart */
.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

/* Logos */
.logos {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.logo-main {
  height: 70px;
  width: auto;
}

.logo-secondary {
  height: 58px;
  width: auto;
}

/* Category Navigation */
.category-nav {
  flex: 1;
  display: flex;
  align-items: center;
}

.category-nav ul {
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}

.category-nav a {
  font-size: 15px;
  color: var(--text-dark);
  font-weight: 500;
  padding: 8px 0;
  position: relative;
}

.category-nav a::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--primary-color);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.category-nav a:hover::after {
  opacity: 1;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

/* Search Form */
.search-form {
  display: flex;
  align-items: center;
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  padding: 6px 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  flex-direction: row-reverse;
}

.search-form:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(110, 0, 12, 0.1);
}

.search-input {
  border: none;
  background: transparent;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text-dark);
  outline: none;
  width: 180px;
  transition: width 0.2s ease;
}

/* Remove clear button (X) from search input */
.search-input::-webkit-search-cancel-button,
.search-input::-webkit-clear-button {
  display: none;
}

.search-input::-ms-clear {
  display: none;
}

.search-input::placeholder {
  color: var(--text-gray);
}

.search-input:focus {
  width: 220px;
}

.search-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.search-btn:hover {
  opacity: 0.7;
}

.search-btn:focus {
  outline: none;
  box-shadow: none;
}

.search-btn img {
  width: 18px;
  height: 18px;
}

/* Mobile Search Bar - small inline bar */
.mobile-search-bar {
  display: none;
  flex: 1;
  max-width: 200px;
  margin: 0 8px;
  align-items: center;
}

.mobile-search-bar.active {
  display: flex;
}

.mobile-search-wrapper {
  position: relative;
  width: 100%;
}

.mobile-search-form {
  display: flex;
  align-items: center;
  width: 100%;
}

.mobile-search-input {
  flex: 1;
  padding: 8px 35px 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  min-width: 0;
  width: 100%;
}

/* Hide browser's default clear button */
.mobile-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  display: none;
}

.mobile-search-input::-ms-clear {
  display: none;
}

.mobile-search-input:focus {
  outline: none;
  border-color: var(--primary-color, #6e000c);
}

/* Mobile search close button - positioned inside input field */
.mobile-search-close {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
  font-size: 16px;
  color: #999;
  font-weight: bold;
  z-index: 1;
}

.mobile-search-close:hover {
  opacity: 0.7;
  color: #666;
}

/* Bag Button */
.bag-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  padding: 4px 8px;
  transition: opacity 0.2s ease;
}

.bag-btn:hover {
  opacity: 0.8;
}

.bag-icon {
  width: 24px;
  height: 24px;
}

.cart-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: #6e000c;
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.cart-badge:empty {
  display: none;
}

.cart-badge.zero {
  display: none;
}

/* ============================================
   HAMBURGER MENU
   ============================================ */

/* Hamburger button (hidden on desktop) */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 28px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

.hamburger-btn span {
  width: 100%;
  height: 3px;
  background-color: var(--text-dark);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Hamburger animation when menu is open */
.hamburger-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 6px);
}

.hamburger-btn.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -6px);
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-menu.active {
  display: block;
  opacity: 1;
}

.mobile-menu-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 80%;
  max-width: 320px;
  height: 100%;
  background-color: var(--bg-light);
  padding: 50px 0 30px 50px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.mobile-menu.active .mobile-menu-content {
  transform: translateX(0);
}

.mobile-nav ul {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-right: 20px;
}

.mobile-nav li {
  border-bottom: 1px solid #eaeaea;
}

.mobile-nav a {
  display: block;
  padding: 18px 20px 18px 20px;
  font-size: 16px;
  color: var(--text-dark);
  font-weight: 600;
  transition: color 0.3s ease;
}

.mobile-nav a:hover {
  color: var(--primary-color);
}

/* Prevent body scroll when menu is open */
body.menu-open {
  overflow: hidden;
}

/* ============================================
   RESPONSIVE NAVBAR
   ============================================ */

/* Tablet (1024px and below) */
@media (max-width: 1024px) {
  .header-top {
    padding: 15px 0;
  }

  .header-top .container {
    padding: 0 30px;
  }

  .header-content {
    gap: 20px;
  }

  .logo-main,
  .logo-secondary {
    height: 60px;
  }

  .logos {
    gap: 15px;
  }

  .category-nav ul {
    gap: 16px;
  }

  .category-nav a {
    font-size: 13px;
  }

  .search-input {
    width: 140px;
  }

  .search-input:focus {
    width: 180px;
  }
}

/* Mobile (768px and below) */
@media (max-width: 768px) {
  .header-top {
    padding: 15px 0;
  }

  .header-top .container {
    padding: 0 20px;
  }

  .header-content {
    gap: 15px;
  }

  .logos {
    gap: 10px;
  }

  .logo-main,
  .logo-secondary {
    height: 45px;
  }

  /* Hide category nav and search on mobile */
  .category-nav {
    display: none;
  }

  /* On mobile, show only the search button, hide the input */
  .search-form {
    position: relative;
    border: none;
    background: transparent;
    padding: 0;
    box-shadow: none;
  }

  .search-input {
    display: none;
  }

  .search-btn {
    display: flex;
  }

  /* Hide entire search form when search bar is active */
  .search-bar-active .search-form {
    display: none;
  }

  /* Mobile search bar - inline with other icons */
  .mobile-search-bar {
    display: none;
  }

  .search-bar-active .mobile-search-bar {
    display: flex;
  }

  /* Show hamburger button */
  .hamburger-btn {
    display: flex;
  }

  .bag-icon {
    width: 20px;
    height: 20px;
  }

  .hamburger-btn {
    width: 24px;
    height: 20px;
  }

  .header-actions {
    gap: 8px;
  }

  .mobile-menu-content {
    padding: 70px 0 20px 40px;
    width: 85%;
  }

  .mobile-nav ul {
    padding-right: 15px;
  }

  .mobile-nav a {
    font-size: 15px;
    padding: 16px 15px 16px 15px;
    font-weight: 600;
  }
}

/* Small Mobile (480px and below) */
@media (max-width: 480px) {
  .header-top {
    padding: 10px 0;
  }

  .header-top .container {
    padding: 0 15px;
  }

  .logo-main,
  .logo-secondary {
    height: 35px;
  }

  .logos {
    gap: 8px;
  }

  .hamburger-btn {
    width: 24px;
    height: 20px;
  }

  .hamburger-btn span {
    height: 2px;
  }

  .mobile-menu-content {
    width: 100%;
    max-width: none;
    padding: 50px 0 30px 30px;
    gap: 20px;
  }

  .mobile-nav ul {
    padding-right: 15px;
  }

  .mobile-nav a {
    font-size: 13px;
    padding: 12px 15px 12px 15px;
    font-weight: 600;
  }
}
