/* -------------------------------------------------------------
 * HEXTON B2B Wholesale Hardware - Mobile-First Design System
 * Dark Navy (#0B0F19), Surface Slate (#111827), Brand Orange (#F5811F)
 * FINAL MOBILE POLISH: v3.0
 * ------------------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg-dark: #0B0F19;
  --bg-surface: #111827;
  --bg-surface-elevated: #1F2937;
  --border-color: #374151;
  --border-subtle: #1F2937;
  
  --brand-orange: #F5811F;
  --brand-orange-hover: #E06D0C;
  --brand-orange-glow: rgba(245, 129, 31, 0.3);
  
  --text-white: #FFFFFF;
  --text-main: #E2E8F0;
  --text-muted: #94A3B8;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-orange: 0 6px 20px rgba(245, 129, 31, 0.35);
  
  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-main);
  -webkit-tap-highlight-color: transparent;
  /* Prevent horizontal overflow on mobile */
  overflow-x: hidden;
}

body {
  line-height: 1.6;
  overflow-x: hidden;
  /* Reserve space for sticky mobile WhatsApp bar */
  padding-bottom: 70px;
}

@media (min-width: 992px) {
  body {
    padding-bottom: 0;
  }
}

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

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

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

/* ===========================
   TOP BAR
   =========================== */
.top-bar {
  background-color: #070A12;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 7px 12px;
  text-align: center;
  font-weight: 500;
  letter-spacing: 0.01em;
  /* Hide on tiny phones to save vertical space */
  display: block;
}

.top-bar strong {
  color: var(--text-white);
}

/* ===========================
   NAVBAR
   =========================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(11, 15, 25, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding: 10px 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 768px) {
  .container {
    padding: 0 24px;
  }
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.logo-wrapper {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-img {
  height: 30px;
  width: auto;
}

@media (min-width: 768px) {
  .logo-img {
    height: 36px;
  }
}

/* Desktop nav links — hidden on mobile */
.nav-links {
  display: none;
  gap: 20px;
  align-items: center;
  list-style: none;
}

@media (min-width: 992px) {
  .nav-links {
    display: flex;
  }
}

.nav-link {
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--text-white);
}

/* ===========================
   BUTTONS
   =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  min-height: 48px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.92rem;
  transition: all 0.2s ease;
  white-space: nowrap;
  touch-action: manipulation;
  /* Prevent text selection on tap */
  -webkit-user-select: none;
  user-select: none;
}

.btn-sm {
  padding: 10px 16px;
  font-size: 0.84rem;
  min-height: 44px;
}

.btn-primary {
  background-color: var(--brand-orange);
  color: var(--text-white);
  box-shadow: var(--shadow-orange);
}

.btn-primary:hover, .btn-primary:active {
  background-color: var(--brand-orange-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background-color: transparent;
  border: 1.5px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover, .btn-outline:active {
  border-color: var(--brand-orange);
  color: var(--brand-orange);
}

/* ===========================
   HERO SECTION
   =========================== */
.hero {
  padding: 32px 0 44px;
  background: radial-gradient(circle at 50% 0%, rgba(245, 129, 31, 0.09) 0%, rgba(11, 15, 25, 0) 65%);
}

@media (min-width: 768px) {
  .hero {
    padding: 55px 0 75px;
  }
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: center;
}

@media (min-width: 992px) {
  .hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 44px;
  }
}

.hero-tag {
  display: inline-block;
  color: var(--brand-orange);
  font-weight: 700;
  font-size: 0.78rem;
  margin-bottom: 10px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.hero-title {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
  color: var(--text-white);
}

@media (min-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 2.8rem;
  }
}

.hero-subtitle {
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 22px;
  line-height: 1.65;
}

@media (min-width: 768px) {
  .hero-subtitle {
    font-size: 1.06rem;
  }
}

/* Hero CTA group: stack on mobile, row on tablet+ */
.hero-cta-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 26px;
}

@media (min-width: 480px) {
  .hero-cta-group {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

/* Full-width hero CTAs on small mobile */
.hero-cta-group .btn {
  width: 100%;
}

@media (min-width: 480px) {
  .hero-cta-group .btn {
    width: auto;
  }
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
}

.stat-item h4 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-white);
}

.stat-item p {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.hero-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

@media (min-width: 768px) {
  .hero-card {
    padding: 26px;
  }
}

.hero-card-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-white);
  margin-bottom: 14px;
}

.hero-feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 20px;
}

.hero-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-main);
}

.check-icon {
  color: var(--brand-orange);
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ===========================
   TRUST STRIP
   =========================== */
.trust-strip {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 18px 0;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 768px) {
  .trust-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.trust-item h5 {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 2px;
}

.trust-item p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ===========================
   SECTIONS
   =========================== */
.section {
  padding: 44px 0;
}

@media (min-width: 768px) {
  .section {
    padding: 70px 0;
  }
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 28px;
}

.section-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-white);
  margin-bottom: 8px;
  line-height: 1.25;
}

@media (min-width: 768px) {
  .section-title {
    font-size: 2.1rem;
  }

  .title-single-line {
    white-space: nowrap;
    font-size: 1.85rem;
  }
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

/* ===========================
   CATEGORY & SUBCATEGORY TABS
   Mobile: Horizontally scrollable pills
   =========================== */
.category-tabs {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 4px;
  /* Prevent tab row from touching container edge on mobile */
  padding-left: 2px;
  padding-right: 2px;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  padding: 10px 18px;
  min-height: 44px;
  border-radius: 22px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.84rem;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.tab-btn:hover, .tab-btn.active {
  background-color: var(--brand-orange);
  color: var(--text-white);
  border-color: var(--brand-orange);
  box-shadow: 0 4px 14px rgba(245, 129, 31, 0.4);
}

.subcategory-tabs {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 6px;
  margin-bottom: 24px;
  background: rgba(17, 24, 39, 0.6);
  padding: 8px 10px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.subcategory-tabs::-webkit-scrollbar {
  display: none;
}

.subtab-btn {
  padding: 8px 14px;
  min-height: 40px;
  border-radius: 16px;
  background-color: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.subtab-btn:hover, .subtab-btn.active {
  background-color: rgba(245, 129, 31, 0.15);
  color: var(--brand-orange);
  border-color: var(--brand-orange);
}

/* ===========================
   PRODUCTS GRID
   Mobile: 2 cards per row (not 1)
   Tablet: 2 or 3
   Desktop: 3
   =========================== */
.products-grid {
  display: grid;
  /* 2 columns on mobile — users can see more products */
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 640px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }
}

@media (min-width: 900px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
  }
}

/* ===========================
   PRODUCT CARD
   =========================== */
.product-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
  border-color: rgba(245, 129, 31, 0.4);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

/* Product image — square on mobile for 2-col grid */
.product-img-wrapper {
  background-color: #FFFFFF;
  /* Aspect-ratio box so images look consistent */
  aspect-ratio: 1 / 1;
  width: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-subtle);
  cursor: zoom-in;
}

@media (min-width: 640px) {
  .product-img-wrapper {
    aspect-ratio: auto;
    height: 210px;
  }
}

@media (min-width: 992px) {
  .product-img-wrapper {
    height: 230px;
  }
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

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

.zoom-overlay-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(11, 15, 25, 0.75);
  color: #FFFFFF;
  font-size: 0.65rem;
  padding: 3px 7px;
  border-radius: 10px;
  font-weight: 600;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.product-content {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

@media (min-width: 640px) {
  .product-content {
    padding: 16px;
  }
}

.product-code {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--brand-orange);
}

.category-badge-pill {
  border: 1px solid rgba(245, 129, 31, 0.35);
  background: rgba(245, 129, 31, 0.1);
  color: var(--brand-orange);
  font-size: 0.62rem;
  border-radius: 10px;
  padding: 2px 7px;
  font-weight: 700;
  white-space: nowrap;
}

.product-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 3px;
  line-height: 1.3;
}

@media (min-width: 640px) {
  .product-title {
    font-size: 1rem;
  }
}

.product-material {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.finish-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-bottom: 10px;
}

.finish-tag {
  background-color: var(--bg-surface-elevated);
  color: var(--text-main);
  font-size: 0.64rem;
  padding: 2px 6px;
  border-radius: 4px;
}

.product-price-row {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 4px;
}

.price-range {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text-white);
}

@media (min-width: 640px) {
  .price-range {
    font-size: 1rem;
  }
}

.moq-badge {
  font-size: 0.62rem;
  color: var(--brand-orange);
  font-weight: 700;
  text-align: right;
  flex-shrink: 0;
}

/* WhatsApp button on product card — full width, big tap target */
.product-actions {
  display: flex;
  gap: 8px;
}

.product-actions .btn {
  width: 100%;
  font-size: 0.78rem;
  padding: 10px 10px;
  min-height: 42px;
}

@media (min-width: 640px) {
  .product-actions .btn {
    font-size: 0.84rem;
  }
}

/* ===========================
   MODAL — SPEC & LIGHTBOX
   =========================== */
.modal-hero-image-box {
  width: 100%;
  height: 200px;
  background-color: #FFFFFF;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 14px;
  cursor: zoom-in;
}

@media (min-width: 480px) {
  .modal-hero-image-box {
    height: 240px;
  }
}

.modal-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.zoom-badge-hint {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(11, 15, 25, 0.85);
  border: 1px solid var(--border-subtle);
  color: var(--text-white);
  font-size: 0.68rem;
  padding: 4px 10px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
  font-weight: 600;
}

.modal-spec-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 0.83rem;
}

.modal-spec-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

.modal-spec-table .spec-label {
  color: var(--text-muted);
  font-weight: 500;
  width: 40%;
}

.modal-spec-table .spec-value {
  color: var(--text-white);
  font-weight: 600;
}

/* Lightbox — full screen image on mobile */
#lightboxModal .modal-card {
  max-width: 96vw;
  width: auto;
  background-color: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lightbox-img-large {
  max-width: 96vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.95);
  background-color: #FFFFFF;
}

/* ===========================
   FAQ
   =========================== */
.faq-list {
  max-width: 750px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background-color: var(--bg-surface);
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.faq-item h4 {
  color: var(--text-white);
  font-size: 0.92rem;
  margin-bottom: 5px;
  font-weight: 700;
}

.faq-item p {
  color: var(--text-main);
  font-size: 0.84rem;
  line-height: 1.6;
}

/* ===========================
   MOBILE STICKY BOTTOM BAR
   =========================== */
.mobile-action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background-color: rgba(7, 10, 18, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(245, 129, 31, 0.3);
  padding: 10px 16px;
  /* Safe area for iOS home bar */
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}

@media (min-width: 992px) {
  .mobile-action-bar {
    display: none;
  }
}

/* ===========================
   MODAL OVERLAY BASE
   =========================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: flex-end; /* Slide up from bottom on mobile */
  justify-content: center;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  transition: all 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@media (min-width: 640px) {
  .modal-overlay {
    align-items: center;
    padding: 20px;
  }
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  /* Rounded top corners only on mobile for sheet look */
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  max-width: 100%;
  width: 100%;
  padding: 20px 16px;
  position: relative;
  max-height: 92vh;
  overflow-y: auto;
  /* Smooth slide-up animation on mobile */
  transform: translateY(30px);
  transition: transform 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  /* iOS momentum scrolling */
  -webkit-overflow-scrolling: touch;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

@media (min-width: 640px) {
  .modal-card {
    border-radius: var(--radius-md);
    max-width: 520px;
    padding: 26px;
    transform: translateY(0) scale(0.97);
  }
  .modal-overlay.active .modal-card {
    transform: translateY(0) scale(1);
  }
}

/* Modal drag handle indicator — mobile sheet UX */
.modal-card::before {
  content: '';
  display: block;
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  margin: 0 auto 16px;
}

@media (min-width: 640px) {
  .modal-card::before {
    display: none;
  }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 1.35rem;
  color: var(--text-muted);
  z-index: 5;
  background: rgba(31, 41, 55, 0.9);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Large tap target for mobile */
  min-width: 44px;
  min-height: 44px;
}

.modal-close:hover {
  color: var(--text-white);
  background: var(--brand-orange);
}

/* ===========================
   FORM ELEMENTS
   =========================== */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 5px;
}

.form-input, .form-select {
  width: 100%;
  padding: 11px 12px;
  min-height: 48px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  color: var(--text-white);
  font-family: inherit;
  font-size: 1rem; /* 16px minimum to prevent iOS auto-zoom */
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 3px rgba(245, 129, 31, 0.15);
}

/* ===========================
   FOOTER
   =========================== */
.footer {
  background-color: #070A12;
  border-top: 1px solid var(--border-subtle);
  padding: 36px 0 24px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
    gap: 30px;
    margin-bottom: 28px;
  }
}

.footer-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 10px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.footer-links a {
  color: var(--text-muted);
  transition: color 0.2s;
  font-size: 0.84rem;
  /* Minimum tap target height */
  display: inline-block;
  min-height: 32px;
  line-height: 32px;
}

.footer-links a:hover {
  color: var(--brand-orange);
}
