/* ==========================================================================
   STOREFRONT COMPONENT STYLES (FULL DEVICE RESPONSIVE) - AIBundleHub
   ========================================================================== */

/* 1. Header Navigation */
.header-nav {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(7, 9, 14, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.25rem;
  transition: var(--transition-normal);
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hamburger-btn {
  font-size: 1.3rem;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.hamburger-btn:hover {
  background: rgba(99, 102, 241, 0.18);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.3rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.logo-badge {
  font-size: 0.6rem;
  background: var(--gradient-ai);
  color: #fff;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-full);
  margin-left: 0.1rem;
}

/* Header Live Search */
.header-search-wrapper {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.header-search-input {
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.4rem;
  background: rgba(22, 30, 49, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-main);
  font-size: 0.88rem;
  transition: var(--transition-fast);
}

.header-search-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
  background: rgba(22, 30, 49, 0.95);
}

.search-icon-inside {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}

/* Header Actions */
.header-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.ai-services-header-btn {
  background: var(--gradient-ai);
  color: #ffffff;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.82rem;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.ai-services-header-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.55);
}

.cart-icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  font-size: 1.1rem;
  color: var(--text-main);
  flex-shrink: 0;
}

.cart-icon-btn:hover {
  background: rgba(99, 102, 241, 0.18);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.cart-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: var(--gradient-amber);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  width: 19px;
  height: 19px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-primary);
}

/* Mobile Sidebar Menu Drawer */
.mobile-sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(10px);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 290px;
  max-width: 85vw;
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  z-index: 1101;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.mobile-sidebar-backdrop.active .mobile-sidebar {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-menu-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sidebar-menu-item a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition-fast);
}

.sidebar-menu-item a:hover,
.sidebar-menu-item.active a {
  background: rgba(99, 102, 241, 0.15);
  color: #ffffff;
  border-left: 3px solid var(--accent-primary);
}

/* 2. Category Pill Bar */
.category-bar-section {
  background: rgba(15, 20, 32, 0.7);
  border-bottom: 1px solid var(--border-color);
  padding: 0.65rem 1rem;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}

.category-bar-section::-webkit-scrollbar {
  height: 3px;
}

.category-bar-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 1rem;
  background: rgba(22, 30, 49, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
  flex-shrink: 0;
  user-select: none;
}

.category-pill:hover,
.category-pill.active {
  background: var(--gradient-primary);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

/* 3. Hero Banner / Slider */
.hero-slider-section {
  max-width: 1280px;
  margin: 1.25rem auto;
  padding: 0 1.25rem;
}

.hero-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 320px;
  display: flex;
  align-items: center;
  padding: 2.5rem;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(7, 9, 14, 0.96) 0%, rgba(7, 9, 14, 0.75) 60%, rgba(7, 9, 14, 0.4) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 600px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-full);
  color: #a5b4fc;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  text-transform: uppercase;
}

.hero-title {
  font-size: 2.2rem;
  line-height: 1.18;
  margin-bottom: 0.8rem;
  font-weight: 800;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  line-height: 1.55;
}

/* 4. Section Headers */
.section-container {
  max-width: 1280px;
  margin: 2.5rem auto;
  padding: 0 1.25rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.section-title-group h2 {
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.2rem;
}

/* 5. Trending Grid & Product Cards */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.25rem;
}

.product-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition-normal);
}

.product-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md), var(--shadow-glow);
  transform: translateY(-3px);
}

.card-media {
  position: relative;
  width: 100%;
  padding-top: 60%;
  overflow: hidden;
  background: var(--bg-tertiary);
}

.card-media img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .card-media img {
  transform: scale(1.06);
}

.card-ribbon {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 2;
}

.quick-view-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: rgba(7, 9, 14, 0.75);
  backdrop-filter: blur(6px);
  color: #fff;
  opacity: 0.9;
  transition: var(--transition-fast);
  z-index: 2;
}

.quick-view-btn:hover {
  background: var(--accent-primary);
}

.card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-category-tag {
  font-size: 0.7rem;
  color: var(--accent-cyan);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-urgency-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--accent-amber);
  margin-bottom: 0.6rem;
  font-weight: 600;
}

.card-price-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.sale-price {
  font-size: 1.2rem;
  font-weight: 800;
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
}

.original-price {
  font-size: 0.8rem;
  color: var(--text-subtle);
  text-decoration: line-through;
}

.card-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.btn-card-buy {
  flex: 1;
  background: var(--gradient-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
}

.btn-card-cart {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  flex-shrink: 0;
}

/* 6. Filter Tabs Bar */
.filter-tabs-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(22, 30, 49, 0.5);
  padding: 0.3rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  overflow-x: auto;
}

.filter-tab {
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.filter-tab.active {
  background: var(--gradient-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* 7. Footer Section */
.footer-section {
  background: #040609;
  border-top: 1px solid var(--border-color);
  padding: 3rem 1.25rem 2rem 1.25rem;
  margin-top: 4rem;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 2rem;
}

/* ==========================================================================
   MOBILE & DEVICE SPECIFIC MEDIA QUERIES
   ========================================================================== */

@media (max-width: 768px) {
  .header-nav {
    padding: 0.6rem 0.9rem;
  }

  .header-search-wrapper {
    display: none; /* Mobile header hides search bar to preserve space; search is in drawer & footer */
  }

  .site-logo {
    font-size: 1.15rem;
  }

  .hero-card {
    padding: 1.5rem 1.25rem;
    min-height: 260px;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .hero-subtitle {
    font-size: 0.85rem;
    margin-bottom: 1.2rem;
  }

  .section-container {
    margin: 1.8rem auto;
    padding: 0 1rem;
  }

  .section-title-group h2 {
    font-size: 1.3rem;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .card-body {
    padding: 0.75rem;
  }

  .card-title {
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
  }

  .sale-price {
    font-size: 1.05rem;
  }

  .footer-container {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }

  .btn-card-buy {
    font-size: 0.75rem;
    padding: 0.45rem 0.4rem;
  }

  .footer-container {
    grid-template-columns: 1fr;
  }

  .ai-services-header-btn span {
    display: none; /* Hide text on tiny screens, show icon */
  }
}
