/* ============================================================
   SHOUNTR MARKETPLACE — MAIN STYLESHEET
   Work Package: TEMP-010 (Final Production Mobile Optimization)
============================================================ */

:root {
  --primary: #6EC1E4;
  --primary-dark: #3AA9D6;
  --primary-light: #EBF7FC;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  --bg-body: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-alt: #F1F5F9;
  --bg-dark: #0F172A;
  --border: #E2E8F0;
  --border-dark: #CBD5E1;
  --radius-card: 12px;
  --radius-btn: 8px;
  --radius-modal: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 16px;
}

.main-content {
  flex: 1;
  padding: 24px 0 64px 0;
}

/* Header & Sticky Navigation */
.site-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo-img {
  height: 34px;
  width: auto;
  object-fit: contain;
}

.brand-wordmark {
  font-family: var(--font-family);
  font-weight: 800;
  font-size: 1.35rem;
  color: #0F172A;
  letter-spacing: -0.5px;
  text-transform: lowercase;
  line-height: 1;
}

.location-btn {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: var(--radius-btn);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-main);
  transition: all 0.2s ease;
  flex-shrink: 0;
  min-height: 38px;
}
.location-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.search-box {
  flex: 1;
  max-width: 360px;
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 12px;
  font-size: 0.875rem;
  color: var(--text-muted);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  font-size: 0.875rem;
  background: var(--bg-alt);
  outline: none;
  transition: all 0.2s ease;
  min-height: 38px;
}
.search-input:focus {
  background: var(--bg-surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(110, 193, 228, 0.2);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav-link {
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--text-muted);
  transition: color 0.2s ease, border-color 0.2s ease;
  padding: 4px 0;
}
.nav-link:hover {
  color: var(--primary-dark);
}
.nav-link.active {
  color: var(--primary-dark);
  font-weight: 700;
  border-bottom: 2px solid var(--primary-dark);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.35rem;
  cursor: pointer;
  color: var(--text-main);
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

/* Mobile Filter Strip (Horizontally Scrollable) */
.filter-strip {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.filter-strip::-webkit-scrollbar {
  display: none;
}
.filter-strip .btn {
  flex-shrink: 0;
}

/* Homepage Shimmer Hero */
.hero-dark-box {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
  color: #FFFFFF;
  border-radius: 20px;
  padding: 56px 32px;
  text-align: center;
  max-width: 960px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid #334155;
  position: relative;
  overflow: hidden;
}

.hero-dark-box::before {
  content: '';
  position: absolute;
  top: -60%;
  left: -60%;
  width: 220%;
  height: 220%;
  background: linear-gradient(
    45deg,
    transparent 0%,
    rgba(110, 193, 228, 0.02) 42%,
    rgba(110, 193, 228, 0.12) 50%,
    rgba(110, 193, 228, 0.02) 58%,
    transparent 100%
  );
  transform: rotate(25deg);
  animation: heroShimmer 9s infinite ease-in-out;
  pointer-events: none;
}

@keyframes heroShimmer {
  0% { transform: translate(-30%, -30%) rotate(25deg); }
  50% { transform: translate(30%, 30%) rotate(25deg); }
  100% { transform: translate(-30%, -30%) rotate(25deg); }
}

.hero-content-relative {
  position: relative;
  z-index: 2;
}

@media (prefers-reduced-motion: reduce) {
  .hero-dark-box::before {
    animation: none !important;
    display: none !important;
  }
}

/* Dark Shountr.com Footer Style */
.site-footer {
  background: var(--bg-dark);
  color: #F8FAFC;
  border-top: 1px solid #1E293B;
  padding: 48px 0 24px 0;
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 36px;
}
.footer-logo {
  height: 32px;
  margin-bottom: 12px;
}
.footer-title {
  font-weight: 700;
  font-size: 0.9375rem;
  margin-bottom: 16px;
  color: #FFFFFF;
  letter-spacing: 0.5px;
}
.footer-links {
  list-style: none;
}
.footer-links li {
  margin-bottom: 10px;
}
.footer-links a {
  color: #94A3B8;
  font-size: 0.875rem;
  transition: color 0.2s ease;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}
.footer-links a:hover {
  color: var(--primary);
}
.footer-bottom {
  border-top: 1px solid #1E293B;
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: #64748B;
  flex-wrap: wrap;
  gap: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  text-align: center;
  gap: 6px;
  min-height: 40px;
  touch-action: manipulation;
}
.btn-primary {
  background: var(--primary);
  color: #0F172A;
}
.btn-primary:hover {
  background: var(--primary-dark);
  color: #FFFFFF;
}
.btn-secondary {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: rgba(110, 193, 228, 0.4);
}
.btn-secondary:hover {
  background: var(--primary);
  color: #0F172A;
}
.btn-outline {
  background: transparent;
  border-color: var(--border-dark);
  color: var(--text-main);
}
.btn-outline:hover {
  background: var(--bg-alt);
}
.btn-sm {
  padding: 6px 12px;
  font-size: 0.8125rem;
  min-height: 36px;
}
.btn-block {
  width: 100%;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}
.badge-verified {
  background: #DCFCE7;
  color: #166534;
}
.badge-new {
  background: var(--primary-light);
  color: var(--primary-dark);
}
.badge-demo {
  background: #FEF3C7;
  color: #92400E;
}
.badge-delivery {
  background: #E0E7FF;
  color: #3730A3;
}
.badge-enquiry {
  background: #F3E8FF;
  color: #6B21A8;
}

/* Cards */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.card-img-box {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
}
.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-brand {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.card-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.price-box {
  margin-top: auto;
  margin-bottom: 12px;
}
.visible-price {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-main);
}
.hidden-price {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary-dark);
}

/* Grids */
.grid {
  display: grid;
  gap: 20px;
}
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.modal-content {
  background: var(--bg-surface);
  border-radius: var(--radius-modal);
  width: 100%;
  max-width: 500px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.35rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-body {
  padding: 20px;
}

/* Fulfillment Select Cards */
.fulfillment-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg-surface);
}
.fulfillment-card:hover, .fulfillment-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 14px;
}
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-main);
}
.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  font-size: 0.875rem;
  background: var(--bg-surface);
  outline: none;
  min-height: 42px;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(110, 193, 228, 0.2);
}

/* Sticky Bottom Purchase Bar for Mobile */
.mobile-sticky-purchase-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 12px 16px max(12px, env(safe-area-inset-bottom)) 16px;
  z-index: 99;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
}
.mobile-sticky-purchase-bar .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
============================================================ */

/* Tablet (768px – 1023px) */
@media (max-width: 1023px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .search-box { max-width: 260px; }
}

/* Mobile-Only Header Elements (Hidden on Desktop) */
.mobile-search-wrapper,
.mobile-seller-cta {
  display: none;
}

/* Mobile & Small Tablet (<=767px) */
@media (max-width: 767px) {
  .container { padding: 0 12px; }
  .main-content { padding: 16px 0 72px 0; }

  /* Header Recomposition */
  .menu-toggle { display: flex; }
  .header-actions { display: none; }
  .search-box { display: none; }
  
  .header-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    width: 100%;
    background: var(--bg-surface);
    flex-direction: column;
    padding: 20px 16px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    gap: 14px;
  }
  .header-nav.open { display: flex; }

  .header-nav .mobile-search-wrapper {
    display: block;
    width: 100%;
    margin-bottom: 8px;
  }
  .header-nav .mobile-seller-cta {
    display: block;
    width: 100%;
    margin-top: 8px;
  }

  /* Hero Section Mobile Recomposition */
  .hero-dark-box {
    padding: 36px 16px;
    border-radius: 16px;
  }
  .hero-dark-box h1 {
    font-size: 1.75rem !important;
    line-height: 1.3 !important;
    margin-bottom: 12px !important;
  }
  .hero-dark-box p {
    font-size: 0.9375rem !important;
    margin-bottom: 24px !important;
  }

  /* Grids Mobile Recomposition */
  .grid-cols-2 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .grid-cols-3 { grid-template-columns: repeat(2, 1fr); gap: 12px; }

  /* Product Card Mobile Tuning */
  .card-body { padding: 10px; }
  .card-title { font-size: 0.84375rem; margin-bottom: 4px; }
  .card-brand { font-size: 0.7rem; }
  .card-meta { font-size: 0.75rem; margin-bottom: 8px; }
  .visible-price { font-size: 0.9375rem; }
  .btn-sm { padding: 6px 8px; font-size: 0.75rem; min-height: 34px; }

  /* PDP Stacked Mobile Recomposition */
  #pdp-container .grid-cols-2 {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Store Cards Mobile */
  #stores-list-grid.grid-cols-2, #index-stores-grid.grid-cols-2 {
    grid-template-columns: 1fr;
  }

  /* Modal Dialog Mobile Optimization */
  .modal-content {
    max-width: calc(100vw - 24px);
    max-height: 85vh;
    border-radius: 16px;
  }
  .modal-body { padding: 16px; }
  .modal-body .grid-cols-2 { grid-template-columns: 1fr; gap: 0; }

  /* Mobile Sticky Purchase Bar */
  .mobile-sticky-purchase-bar { display: block; }

  /* Footer Mobile */
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; align-items: center; text-align: center; }
}

/* Small Mobile (<=480px) */
@media (max-width: 480px) {
  .brand-wordmark { font-size: 1.15rem; }
  .location-btn { padding: 4px 8px; font-size: 0.75rem; }
  .hero-dark-box h1 { font-size: 1.5rem !important; }
  
  /* 2-column Product Cards on Small Mobile */
  .grid-cols-3, #products-list-grid, #index-products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
}
