/* Store Navbar Styles - Separate from Platform Navbar */

/* Ensure Poppins is available on all store pages that load this stylesheet */
@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");

/* Apply Poppins as the base font for store pages */
body {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
}

.store-navbar {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.store-navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Store Brand */
.store-brand {
  display: flex;
  align-items: center;
  justify-content: center;
}

.store-brand .brand-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #1f2937;
  font-weight: 600;
  font-size: 1.25rem;
}

.store-logo {
  height: 40px;
  width: auto;
}

.store-name {
  color: #1f2937;
}

/* Store Center (menu + mobile trigger) */
.store-nav-center {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Store Hamburger (mobile only) */
.store-hamburger-menu {
  display: none;
  cursor: pointer;
  padding: 8px;
}

.store-hamburger-menu svg {
  width: 24px;
  height: 24px;
  color: #1f2937;
}

/* Store Menu */
.store-menu {
  display: flex;
  gap: 2rem;
}

.store-menu-item {
  color: #6b7280;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.store-menu-item:hover {
  color: #1f2937;
}

.store-menu-item.active {
  color: #667eea;
  font-weight: 600;
  position: relative;
}

.store-menu-item.active::after {
  content: "";
  position: absolute;
  bottom: -1.5rem;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 1px;
}

/* Store Actions */
.store-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Store Search */
.store-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.store-search-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #111827;
}

.store-search-form {
  display: flex;
  align-items: center;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  overflow: hidden;
  background: #ffffff;
}

.search-input {
  padding: 0 1rem;
  border: none;
  outline: none;
  width: 200px;
  height: 38px;
  flex: 1;
  box-sizing: border-box;
}

.search-input:focus {
  border: none;
  box-shadow: none;
}

.search-btn {
  padding: 0 0.75rem;
  background: #ffffff;
  color: #111827;
  border: none;
  border-left: 1px solid #e5e7eb;
  border-radius: 0;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
}

.search-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

/* Platform Cart */
.store-cart-item {
  margin-right: 1rem;
}

.store-cart-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #6b7280;
  padding: 0.5rem;
  border-radius: 0.375rem;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.store-cart-link:hover {
  background: #f3f4f6;
  color: #1f2937;
  border-color: #e5e7eb;
}

.store-cart-icon {
  position: relative;
  margin-right: 0.75rem;
}

.store-cart-icon-svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
}

.store-cart-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ef4444;
  color: white;
  border-radius: 50%;
  padding: 0.125rem 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  line-height: 1;
}

.store-cart-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.store-cart-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
}

.store-cart-total {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 600;
}

/* Store User Dropdown */
.store-user-dropdown {
  position: relative;
}

.store-user-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #1f2937;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  transition: background 0.2s;
  cursor: pointer;
}

.store-user-link:hover {
  background: #f3f4f6;
}

.store-user-icon {
  margin-right: 0.5rem;
  font-size: 1.125rem;
}

.store-user-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s;
  z-index: 1000;
  overflow: hidden;
}

.store-user-dropdown:hover .store-user-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.store-user-menu .store-menu-item {
  display: block;
  padding: 0.75rem 1rem;
  color: #374151;
  text-decoration: none;
  transition: background 0.2s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.store-user-menu .store-menu-item:hover {
  background: #f3f4f6;
  color: #1f2937;
}

.store-menu-divider {
  margin: 0.5rem 0;
  border: none;
  border-top: 1px solid #e5e7eb;
}

.store-logout-btn {
  color: #dc2626 !important;
}

.store-logout-btn:hover {
  background: #fef2f2 !important;
  color: #b91c1c !important;
}

/* Store Auth Buttons */
.store-auth-buttons {
  display: flex;
  gap: 0.5rem;
}

.store-btn {
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  text-decoration: none;
  font-weight: 400;
  font-size: 0.875rem;
  transition: all 0.2s;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.store-btn-primary {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

.store-btn-primary:hover {
  background: #2563eb;
  border-color: #2563eb;
}

.store-btn-secondary {
  background: white;
  color: #6b7280;
  border-color: #d1d5db;
}

.store-btn-secondary:hover {
  background: #f9fafb;
  color: #374151;
  border-color: #9ca3af;
}

/* Store Mobile Menu Overlay (same pattern as platform navbar) */
.mobile-menu {
  position: fixed;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100vh;
  background: #1f2937;
  z-index: 1000;
  transition: left 0.3s ease;
  padding-top: 80px;
}

.mobile-menu.active {
  left: 0;
}

.mobile-menu-header {
  display: flex;
  justify-content: flex-end;
  padding: 20px 20px 0 20px;
}

.mobile-menu-close {
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.mobile-menu-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.mobile-menu-close svg {
  width: 24px;
  height: 24px;
  color: white;
}

.mobile-menu-content {
  padding: 20px;
}

.mobile-menu-item {
  display: block;
  padding: 15px 0;
  color: white;
  text-decoration: none;
  font-size: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-menu-item:last-child {
  border-bottom: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .store-navbar .container {
    align-items: stretch;
    gap: 0.75rem;
  }

  .store-nav-center {
    width: 100%;
    display: flex;
    justify-content: space-between;
  }

  .store-hamburger-menu {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .store-menu {
    display: none;
  }

  .store-actions {
    display: flex;
    gap: 1rem;
    width: 100%;
  }

  .store-auth-buttons {
    gap: 0.4rem;
  }

  .store-btn {
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
  }
}

@media (max-width: 880px) {
  .store-menu {
    gap: 1rem;
  }

  .store-cart-item {
    margin-right: 0;
  }
}

/* Search toggle behavior: active on medium and below */
@media (max-width: 1095px) {
  .store-search {
    width: 100%;
    justify-content: flex-end;
    position: relative;
  }

  .store-search-toggle {
    display: inline-flex;
  }

  .store-search-form {
    display: none;
    flex: 1;
  }

  .store-search.is-open {
    position: fixed;
    top: 0;
    left: 0;
    right: auto;
    width: 100%;
    box-sizing: border-box;
    z-index: 2001;
    padding: 0.75rem 1rem;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }

  .store-search.is-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: -1;
  }

  .store-search.is-open .store-search-toggle {
    display: none;
  }

  .store-search.is-open .store-search-form {
    display: flex;
  }

  .search-input {
    width: 100%;
  }
}

/* Hide username label on very small widths, keep only icon */
@media (max-width: 550px) {
  .store-user-link {
    padding: 0.5rem;
  }

  .store-user-name {
    display: none;
  }

  .store-cart-link {
    padding: 0.5rem 0rem 0rem 0rem;
  }

  .store-cart-label {
    display: none;
  }

  .store-cart-total {
    display: none;
  }

  .store-logo {
    height: 35px !important;
    width: 35px !important;
  }
}

@media (max-width: 350px) {
  .store-navbar .container {
    gap: 0;
  }

  .store-actions {
    gap: 0;
  }
}
