/* ============================================
   Joong Warehouse — Wholesale Platform Styles
   Brand: Joong Warehouse
   Colors: Navy #002048 | Red #CC0000 | Green #00882B | Yellow #FFD700
   Tagline: Wholesale Hardware Solutions
   ============================================ */

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #002048;
  --primary-dark: #001530;
  --primary-light: #003070;
  --secondary: #CC0000;
  --accent: #FFD700;
  --cta: #00882B;
  --cta-dark: #006B22;
  --bg: #fafafa;
  --card-bg: #fff;
  --card-shadow: 0 2px 8px rgba(46, 8, 84, 0.08);
  --card-shadow-hover: 0 4px 16px rgba(46, 8, 84, 0.14);
  --text: #333;
  --text-light: #666;
  --text-muted: #999;
  --border: #e0e0e0;
  --success: #00882B;
  --error: #CC0000;
  --info: #002048;
  --warning: #FFD700;
  --radius: 8px;
  --radius-sm: 4px;
  --radius-lg: 12px;
  --max-width: 1280px;
  --nav-height: 64px;
  --font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
}

body {
  font-family: var(--font-family);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

/* --- Skip Nav (Accessibility) --- */
.skip-nav {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--primary);
  color: #fff;
  padding: 8px 16px;
  z-index: 10000;
  font-weight: 600;
  border-radius: 0 0 var(--radius-sm) 0;
}

.skip-nav:focus {
  top: 0;
  text-decoration: none;
}

/* --- Navigation --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid var(--border);
  height: var(--nav-height);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  height: 100%;
  gap: 20px;
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo:hover {
  text-decoration: none;
}

.nav-logo svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.nav-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.nav-search input {
  width: 100%;
  padding: 8px 40px 8px 16px;
  border: 2px solid var(--border);
  border-radius: 24px;
  font-size: 0.9rem;
  font-family: var(--font-family);
  transition: border-color 0.2s;
}

.nav-search input:focus {
  outline: none;
  border-color: var(--primary);
}

.nav-search button {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  color: var(--text-light);
}

.nav-search button:hover {
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
  list-style: none;
}

.nav-links a {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  text-decoration: none;
}

.nav-cart {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
}

.cart-badge {
  position: absolute;
  top: -8px;
  right: -10px;
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.cart-badge:empty,
.cart-badge[data-count="0"] {
  display: none;
}

.nav-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text);
}

/* --- Container --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

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

/* --- Hero Section --- */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 60px 20px;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.hero p {
  font-size: 1.15rem;
  opacity: 0.9;
  margin-bottom: 32px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-search {
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}

.hero-search input {
  width: 100%;
  padding: 14px 56px 14px 20px;
  border: none;
  border-radius: 32px;
  font-size: 1.05rem;
  font-family: var(--font-family);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.hero-search input:focus {
  outline: none;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.hero-search button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.hero-search button:hover {
  background: var(--primary-dark);
}

/* --- Section Headings --- */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--secondary);
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-light);
  margin-bottom: 24px;
}

/* --- Category Grid --- */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin: 32px 0;
}

.category-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  border: 2px solid transparent;
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--primary);
  text-decoration: none;
}

.category-card .cat-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.category-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--secondary);
}

.category-card p {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 4px;
}

/* --- Category Pills / Filters --- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  align-items: center;
}

.filter-bar label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-light);
  margin-right: 4px;
}

.pill {
  display: inline-block;
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
  font-family: var(--font-family);
  color: var(--text);
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
}

.pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* --- Product Grid --- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
}

.product-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: #f0f0f0;
}

.product-card-img-placeholder {
  width: 100%;
  height: 200px;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 2.5rem;
}

/* Card overlay — used for Out of Stock + Coming Soon states on product cards. */
.product-card-img-wrap {
  position: relative;
  display: block;
}
.card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #fff;
  pointer-events: none;
}
.card-overlay-oos {
  background: rgba(33, 33, 33, 0.62);
}
.card-overlay-soon {
  background: rgba(2, 64, 124, 0.55); /* navy tint */
}
.product-card.out-of-stock .product-card-img,
.product-card.out-of-stock .product-card-img-placeholder {
  filter: grayscale(0.85);
}
.product-card.coming-soon .product-card-img,
.product-card.coming-soon .product-card-img-placeholder {
  filter: brightness(0.92);
}
.product-card-price-oos {
  color: #c62828;
  font-weight: 600;
}
.product-card-price-tbd {
  color: #1976d2;
  font-style: italic;
  font-weight: 500;
}

/* Homepage strip-item variants */
.strip-item {
  position: relative;
}
.strip-item-oos img,
.strip-item-soon img {
  filter: grayscale(0.75) brightness(0.94);
}
.strip-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(33, 33, 33, 0.82);
  color: #fff;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  border-radius: 4px;
  pointer-events: none;
}
.strip-badge-soon {
  background: rgba(2, 64, 124, 0.85);
}

.product-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-card-category {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.product-card-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 8px;
  line-height: 1.3;
}

.product-card-name a {
  color: inherit;
}

.product-card-name a:hover {
  color: var(--primary);
  text-decoration: none;
}

.product-card-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.product-card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-moq {
  background: #fff3e0;
  color: #002048;
}

.badge-case {
  background: #e3f2fd;
  color: #1565c0;
}

.badge-in-stock {
  background: #e8f5e9;
  color: #2e7d32;
}

.badge-low-stock {
  background: #fff8e1;
  color: #f57f17;
}

.badge-out-of-stock {
  background: #fce4ec;
  color: #c62828;
}

.product-card-actions {
  margin-top: auto;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  text-align: center;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: #fff;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-secondary:hover {
  background: var(--primary);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* --- How It Works --- */
.how-it-works {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  margin: 48px 0;
  text-align: center;
}

.how-step {
  padding: 20px;
}

.how-step-number {
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 auto 16px;
}

.how-step h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.how-step p {
  font-size: 0.9rem;
  color: var(--text-light);
}

/* --- CTA Banner --- */
.cta-banner {
  background: #fff3e0;
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  margin: 40px 0;
}

.cta-banner h2 {
  font-size: 1.35rem;
  margin-bottom: 8px;
  color: var(--secondary);
}

.cta-banner p {
  color: var(--text-light);
  margin-bottom: 16px;
}

/* --- Forms --- */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--secondary);
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: var(--font-family);
  transition: border-color 0.2s;
  background: #fff;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(230, 81, 0, 0.1);
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-error {
  font-size: 0.8rem;
  color: var(--error);
  margin-top: 4px;
}

/* --- Auth Card (Login/Register) --- */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-height) - 80px);
  padding: 40px 20px;
}

.auth-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  padding: 40px;
  width: 100%;
  max-width: 440px;
}

.auth-card h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
  text-align: center;
}

.auth-card .auth-subtitle {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 24px;
  font-size: 0.95rem;
}

.auth-card .auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--text-light);
}

.auth-success {
  text-align: center;
  padding: 24px 0;
}

.auth-success .check-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

/* --- Tables --- */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: #f5f5f5;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
  padding: 12px 16px;
  text-align: left;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: #fafafa;
}

/* --- Status Badges --- */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-pending {
  background: #fff3e0;
  color: #002048;
}

.status-confirmed {
  background: #e3f2fd;
  color: #1565c0;
}

.status-processing {
  background: #f3e5f5;
  color: #7b1fa2;
}

.status-shipped {
  background: #e0f2f1;
  color: #00695c;
}

.status-delivered {
  background: #e8f5e9;
  color: #2e7d32;
}

.status-cancelled {
  background: #fce4ec;
  color: #c62828;
}

/* --- Cart --- */
/* Roomy rows + large product photos so quantities and images read clearly
   (Matthew 2026-05-30). All .cart-table-scoped — only cart.html's items
   table is affected. */
.cart-table td,
.cart-table th {
  padding: 18px 16px;
  vertical-align: middle;
}

.cart-table td {
  font-size: 1.05rem;
}

.cart-table .cart-product {
  display: flex;
  align-items: center;
  gap: 18px;
}

.cart-table .cart-product-img {
  width: 120px;
  height: 120px;
  border-radius: var(--radius);
  object-fit: cover;
  background: #f0f0f0;
  flex-shrink: 0;
}

.cart-table .cart-product-name {
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.35;
}

.cart-quantity-input {
  width: 104px;
  padding: 12px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1.2rem;
  font-weight: 700;
  font-family: var(--font-family);
  text-align: center;
}

.cart-quantity-input:focus {
  outline: none;
  border-color: var(--primary);
}

.cart-remove-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
  transition: color 0.2s;
}

.cart-remove-btn:hover {
  color: var(--error);
}

.cart-summary {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 24px;
  margin-top: 24px;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.95rem;
}

.cart-summary-row.total {
  font-size: 1.15rem;
  font-weight: 700;
  border-top: 2px solid var(--border);
  padding-top: 12px;
  margin-top: 8px;
}

.cart-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

/* --- Product Detail --- */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin: 24px 0;
}

.product-detail-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #f0f0f0;
}

.product-detail-image img {
  width: 100%;
  height: auto;
  min-height: 300px;
  object-fit: cover;
}

.product-detail-image .placeholder {
  width: 100%;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 4rem;
}

.product-detail-info h1 {
  font-size: 1.75rem;
  margin-bottom: 8px;
}

.product-detail-price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin: 16px 0;
}

.product-detail-description {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 20px;
}

.product-detail-specs {
  margin-bottom: 24px;
}

.product-detail-specs .spec-row {
  display: flex;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
}

.product-detail-specs .spec-label {
  width: 140px;
  font-weight: 600;
  color: var(--text-light);
  flex-shrink: 0;
}

.quantity-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.quantity-selector label {
  font-weight: 600;
  font-size: 0.9rem;
}

.quantity-selector input {
  width: 100px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font-family);
  text-align: center;
}

.quantity-selector input:focus {
  outline: none;
  border-color: var(--primary);
}

/* --- Dashboard --- */
.dashboard-header {
  margin-bottom: 32px;
}

.dashboard-header h1 {
  font-size: 1.75rem;
  margin-bottom: 4px;
}

.dashboard-header p {
  color: var(--text-light);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 20px;
}

.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-card .stat-label {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 4px;
}

.dashboard-section {
  margin-bottom: 32px;
}

.dashboard-section h2 {
  font-size: 1.15rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* --- Checkout --- */
.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  margin: 24px 0;
}

.checkout-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 24px;
  margin-bottom: 20px;
}

.checkout-section h2 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}

.order-summary-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.9rem;
  border-bottom: 1px solid #f5f5f5;
}

.order-summary-item:last-child {
  border-bottom: none;
}

.order-confirmation {
  text-align: center;
  padding: 60px 20px;
}

.order-confirmation .success-icon {
  font-size: 4rem;
  color: var(--success);
  margin-bottom: 16px;
}

.order-confirmation h1 {
  margin-bottom: 8px;
}

.order-confirmation .order-number {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 24px;
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.2s;
}

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

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 1.15rem;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--text-muted);
  padding: 4px;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 32px 0;
}

.pagination button {
  padding: 8px 14px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: var(--font-family);
  cursor: pointer;
  color: var(--text);
  transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.pagination button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* --- Toast Notifications --- */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  padding: 12px 20px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 280px;
  max-width: 400px;
  animation: toast-in 0.3s ease;
  border-left: 4px solid var(--border);
}

.toast.toast-success {
  border-left-color: var(--success);
}

.toast.toast-error {
  border-left-color: var(--error);
}

.toast.toast-info {
  border-left-color: var(--info);
}

.toast.toast-out {
  animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(40px);
  }
}

/* --- Empty States --- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state .empty-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state h2 {
  font-size: 1.25rem;
  margin-bottom: 8px;
  color: var(--text);
}

.empty-state p {
  color: var(--text-light);
  margin-bottom: 20px;
}

/* --- Loading --- */
.loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid #f0f0f0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --- Footer --- */
.footer {
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 32px 20px 20px;
  color: var(--text-light);
  font-size: 0.9rem;
  margin-top: auto;
}

.footer a {
  color: var(--text-light);
  text-decoration: none;
}

.footer a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* 5-col footer grid (Joong) */
.footer-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 28px;
  max-width: 1320px;
  margin: 0 auto;
}

.footer-col h3 {
  font-family: var(--font-heading, inherit);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text, #1a1a1a);
  margin: 0 0 12px;
  letter-spacing: 0.02em;
}

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

.footer-col li {
  margin-bottom: 8px;
  line-height: 1.45;
}

.footer-col p {
  margin: 0 0 8px;
  line-height: 1.5;
}

.footer-map {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  text-decoration: none;
}

.footer-map iframe {
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
  display: block;
}

.footer-map .footer-map-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(46, 8, 84, 0.85);
  color: #fff;
  font-size: 0.78rem;
  padding: 6px 8px;
  text-align: center;
  font-weight: 600;
}

.footer-bottom {
  max-width: 1320px;
  margin: 24px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8rem;
}

@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-col--map { grid-column: 1 / -1; }
  .footer-map { aspect-ratio: 16 / 9; }
}

@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
  .footer-col--map { grid-column: 1 / -1; }
}

/* === AI-Ready content sections (shared across pages) === */
.ai-section {
  background: #fff; border-radius: 4px; padding: 24px; margin-bottom: 20px;
}
.ai-section h2 {
  font-family: var(--font-heading); font-size: 1.3rem; font-weight: 700;
  color: var(--text); margin: 0 0 12px;
}
.ai-section p { color: var(--text); line-height: 1.6; margin: 0 0 12px; font-size: 0.95rem; }
.ai-section .ai-intro-lead { font-size: 1.05rem; }

.ai-specs-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 0.92rem; }
.ai-specs-table caption {
  caption-side: top; text-align: left; padding: 0 0 8px; font-weight: 600;
  color: var(--text); font-size: 0.95rem;
}
.ai-specs-table th, .ai-specs-table td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid #eee; vertical-align: top;
}
.ai-specs-table th {
  width: 35%; font-weight: 600; color: var(--text); background: #f7f7f7;
}

.ai-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 12px; }
@media (max-width: 700px) { .ai-grid-2 { grid-template-columns: 1fr; } }
.ai-card {
  border: 1px solid #e5e5e5; border-radius: 4px; padding: 14px 16px; background: #fafafa;
}
.ai-card h3 {
  font-family: var(--font-heading); font-size: 1rem; font-weight: 700;
  color: var(--primary-dark, #002048); margin: 0 0 6px;
}
.ai-card p { font-size: 0.88rem; margin: 0; color: var(--text-light, #555); line-height: 1.5; }

.ai-why-list { margin: 12px 0 0; }
.ai-why-list dt {
  font-weight: 700; color: var(--primary-dark, #002048); margin: 12px 0 4px; font-size: 0.95rem;
}
.ai-why-list dt:first-child { margin-top: 0; }
.ai-why-list dd {
  margin: 0; color: var(--text-light, #555); font-size: 0.9rem; line-height: 1.5;
}

.ai-faq details {
  border: 1px solid #e5e5e5; border-radius: 4px; padding: 12px 16px; margin-bottom: 8px;
  background: #fafafa;
}
.ai-faq summary {
  font-weight: 600; cursor: pointer; color: var(--text); font-size: 0.95rem;
  list-style: none; padding-right: 24px; position: relative;
}
.ai-faq summary::-webkit-details-marker { display: none; }
.ai-faq summary::after {
  content: '+'; position: absolute; right: 0; top: 0; font-size: 1.2rem; font-weight: 700;
  color: var(--primary, #002048);
}
.ai-faq details[open] summary::after { content: '−'; }
.ai-faq details p { margin: 10px 0 0; font-size: 0.9rem; color: var(--text-light, #555); line-height: 1.55; }

.ai-reviews-cta {
  text-align: center; padding: 16px 12px; background: #fafafa;
  border: 1px dashed #ccc; border-radius: 4px; margin-top: 12px;
  color: var(--text-light, #555); font-size: 0.9rem;
}

/* --- Utility --- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }

/* --- Responsive --- */
@media (max-width: 768px) {
  :root {
    --nav-height: 56px;
  }

  .nav-inner {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 16px;
    height: auto;
    min-height: var(--nav-height);
  }

  .nav-search {
    order: 3;
    max-width: 100%;
    flex-basis: 100%;
  }

  .nav-links {
    display: none;
  }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    order: 4;
    flex-basis: 100%;
    gap: 8px;
    padding: 8px 0;
  }

  .nav-menu-toggle {
    display: block;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .hero {
    padding: 40px 16px;
  }

  .product-detail {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .checkout-layout {
    grid-template-columns: 1fr;
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
  }

  .cart-actions {
    flex-direction: column;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Mobile font-size + touch-target fixes */
  .strip-item .strip-label {
    font-size: 0.8125rem;
  }

  .card-box-item span {
    font-size: 0.8125rem;
  }

  .cat-strip-link {
    font-size: 0.875rem;
  }

  .nav-menu-toggle {
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
  }
}

@media (max-width: 480px) {
  .categories-grid {
    grid-template-columns: 1fr;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .auth-card {
    padding: 24px;
  }

  .hero-search input {
    padding: 12px 48px 12px 16px;
  }

  .how-it-works {
    gap: 20px;
  }

  .cart-table .cart-product {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .cart-table .cart-product-img {
    width: 96px;
    height: 96px;
  }

  .cart-table td,
  .cart-table th {
    padding: 14px 10px;
  }
}

/* --- Print --- */
@media print {
  .nav,
  .footer,
  .toast-container,
  .skip-nav {
    display: none;
  }

  body {
    background: #fff;
  }

  .main-content {
    padding: 0;
  }
}

/* ============================================
   Cinematic Modules — Scroll-Triggered Animations
   ============================================ */

/* --- Cinematic: Reveal Text --- */
.cin-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.cin-reveal--visible {
  opacity: 1;
  transform: translateY(0);
}
.cin-reveal[data-delay="1"] { transition-delay: 0.15s; }
.cin-reveal[data-delay="2"] { transition-delay: 0.3s; }
.cin-reveal[data-delay="3"] { transition-delay: 0.45s; }
.cin-reveal[data-delay="4"] { transition-delay: 0.6s; }

@media (prefers-reduced-motion: reduce) {
  .cin-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* --- Cinematic: Accordion Slider --- */
.cin-accordion {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.cin-accordion .cin-accordion__panel {
  transition: flex 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s ease;
  overflow: hidden;
  position: relative;
}

@media (min-width: 1025px) {
  .cin-accordion {
    grid-template-columns: none;
    display: flex;
  }
  .cin-accordion .cin-accordion__panel {
    flex: 1 1 0%;
    min-width: 0;
  }
  .cin-accordion .cin-accordion__panel:hover {
    flex: 1.35 1 0%;
    box-shadow: var(--card-shadow-hover);
    z-index: 2;
  }
  .cin-accordion .cin-accordion__panel:hover .card-box-grid {
    gap: 12px;
  }
  .cin-accordion .cin-accordion__panel .card-box-link {
    transition: opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s;
  }
  .cin-accordion .cin-accordion__panel:hover .card-box-link {
    color: var(--secondary);
  }
}

@media (max-width: 1024px) {
  .cin-accordion {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .cin-accordion {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cin-accordion .cin-accordion__panel {
    transition: none;
  }
}

/* --- Cinematic: Card Flip --- */
.cin-card-flip {
  perspective: 800px;
}
.cin-card-flip__inner {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  transition: transform 0.6s ease;
  transform-style: preserve-3d;
}
.cin-card-flip:hover .cin-card-flip__inner,
.cin-card-flip:focus-within .cin-card-flip__inner {
  transform: rotateY(180deg);
}
.cin-card-flip__front,
.cin-card-flip__back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.cin-card-flip__front img,
.cin-card-flip__front .ph {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cin-card-flip__back {
  transform: rotateY(180deg);
  background: var(--primary-dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  text-align: center;
  gap: 8px;
}
.cin-card-flip__back span {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}
.cin-card-flip__cta {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
@media (prefers-reduced-motion: reduce) {
  .cin-card-flip__inner {
    transition: none;
  }
  .cin-card-flip:hover .cin-card-flip__inner,
  .cin-card-flip:focus-within .cin-card-flip__inner {
    transform: none;
  }
  .cin-card-flip__back {
    transform: none;
    display: none;
  }
}
