/* ─── BuckHaul Store Theme ─── */
/* Matches landing page: dark theme, Space Grotesk, yellow accents */

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

:root {
  --yellow: #FFD23F;
  --yellow-light: #FFF3CC;
  --yellow-dim: rgba(255, 210, 63, 0.15);
  --dark: #1A1A2E;
  --darker: #0F0F1A;
  --darkest: #0a0a12;
  --green: #2ECC71;
  --green-dark: #1B8A4A;
  --coral: #FF6B6B;
  --white: #FFFFFF;
  --gray: #8892A0;
  --gray-light: #F5F6F8;
  --card-bg: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.2s ease;
}

body {
  font-family: 'DM Sans', sans-serif;
  color: var(--white);
  background: var(--darker);
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
}

a {
  color: var(--yellow);
  text-decoration: none;
  transition: opacity var(--transition);
}

a:hover { opacity: 0.85; }

/* ─── HEADER / NAV ─── */
.store-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 15, 26, 0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--card-border);
  padding: 0 24px;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo .buck {
  color: var(--yellow);
}

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

.nav-links a {
  color: var(--gray);
  font-size: 14px;
  font-weight: 500;
  transition: color var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--white);
}

.cart-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 8px 16px;
  border-radius: 100px;
  color: var(--white) !important;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.cart-link:hover {
  background: rgba(255, 255, 255, 0.08);
}

.cart-badge {
  background: var(--yellow);
  color: var(--dark);
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

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

/* ─── MAIN CONTAINER ─── */
.store-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* ─── PAGE HEADER ─── */
.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  margin-bottom: 8px;
}

.page-header .subtitle {
  color: var(--gray);
  font-size: 16px;
}

/* ─── CATEGORY FILTERS ─── */
.category-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

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

.filter-btn {
  flex-shrink: 0;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--gray);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 100px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.filter-btn:hover {
  border-color: rgba(255, 210, 63, 0.3);
  color: var(--white);
}

.filter-btn.active {
  background: var(--yellow-dim);
  border-color: var(--yellow);
  color: var(--yellow);
}

/* ─── PRODUCT GRID ─── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
}

.product-card:hover {
  border-color: rgba(255, 210, 63, 0.25);
  transform: translateY(-2px);
}

.product-image {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  position: relative;
}

.product-image .featured-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--yellow);
  color: var(--dark);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
}

.product-info {
  padding: 16px;
}

.product-category {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 6px;
}

.product-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 4px;
  color: var(--white);
  line-height: 1.3;
}

.product-desc {
  font-size: 13px;
  color: var(--gray);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-price {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--yellow);
}

.add-btn {
  background: var(--yellow);
  color: var(--dark);
  border: none;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.add-btn:hover {
  background: var(--yellow-light);
  transform: scale(1.02);
}

.add-btn.added {
  background: var(--green);
  color: var(--white);
}

/* ─── PRODUCT DETAIL ─── */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-top: 24px;
}

.detail-image {
  aspect-ratio: 1;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 120px;
}

.detail-info h1 {
  font-size: 32px;
  margin-bottom: 8px;
}

.detail-category {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 16px;
}

.detail-price {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 40px;
  color: var(--yellow);
  margin-bottom: 20px;
}

.detail-description {
  color: var(--gray);
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 32px;
}

.detail-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.qty-btn {
  background: none;
  border: none;
  color: var(--white);
  font-size: 18px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  transition: background var(--transition);
}

.qty-btn:hover { background: rgba(255,255,255,0.08); }

.qty-value {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 16px;
  min-width: 40px;
  text-align: center;
  color: var(--white);
}

.btn-primary {
  background: var(--yellow);
  color: var(--dark);
  border: none;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary:hover {
  background: var(--yellow-light);
  transform: scale(1.02);
}

.btn-secondary {
  background: var(--card-bg);
  color: var(--white);
  border: 1px solid var(--card-border);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  font-size: 15px;
  padding: 12px 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-secondary:hover {
  border-color: rgba(255,255,255,0.2);
}

/* ─── CART PAGE ─── */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 40px;
  margin-top: 24px;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cart-item {
  display: flex;
  gap: 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px;
  align-items: center;
}

.cart-item-image {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
}

.cart-item-price {
  color: var(--yellow);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 16px;
}

.cart-item-remove {
  background: none;
  border: none;
  color: var(--gray);
  cursor: pointer;
  padding: 8px;
  font-size: 18px;
  transition: color var(--transition);
}

.cart-item-remove:hover { color: var(--coral); }

.cart-empty {
  text-align: center;
  padding: 80px 24px;
}

.cart-empty h2 {
  font-size: 24px;
  margin-bottom: 12px;
}

.cart-empty p {
  color: var(--gray);
  margin-bottom: 24px;
}

/* ─── CART SUMMARY ─── */
.cart-summary {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px;
  position: sticky;
  top: 88px;
  height: fit-content;
}

.cart-summary h3 {
  font-size: 18px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--card-border);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 14px;
}

.summary-row .label { color: var(--gray); }
.summary-row .value { font-weight: 500; }

.summary-row.total {
  padding-top: 16px;
  border-top: 1px solid var(--card-border);
  margin-top: 16px;
  font-size: 18px;
}

.summary-row.total .value {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  color: var(--yellow);
}

.min-order-warning {
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.2);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--coral);
  text-align: center;
}

.free-shipping-note {
  background: rgba(46, 204, 113, 0.1);
  border: 1px solid rgba(46, 204, 113, 0.2);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--green);
  text-align: center;
}

.checkout-btn {
  width: 100%;
  margin-top: 20px;
  padding: 14px;
  font-size: 16px;
}

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

/* ─── CHECKOUT FORM ─── */
.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 40px;
  margin-top: 24px;
}

.form-section {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
}

.form-section h3 {
  font-size: 16px;
  margin-bottom: 20px;
}

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

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  transition: border-color var(--transition);
}

.form-group input:focus {
  outline: none;
  border-color: var(--yellow);
}

.form-group input::placeholder {
  color: rgba(255,255,255,0.25);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ─── SUCCESS PAGE ─── */
.success-page {
  text-align: center;
  padding: 80px 24px;
  max-width: 600px;
  margin: 0 auto;
}

.success-icon {
  font-size: 72px;
  margin-bottom: 24px;
}

.success-page h1 {
  font-size: 32px;
  margin-bottom: 12px;
}

.success-page p {
  color: var(--gray);
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 32px;
}

.order-number {
  display: inline-block;
  background: var(--yellow-dim);
  color: var(--yellow);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: 100px;
  margin-bottom: 32px;
}

/* ─── TOAST NOTIFICATION ─── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--green);
  color: var(--white);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 14px;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ─── LOADING ─── */
.loading-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.skeleton-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.skeleton-image {
  aspect-ratio: 1;
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-text {
  padding: 16px;
}

.skeleton-line {
  height: 14px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  margin-bottom: 8px;
}

.skeleton-line:last-child { width: 50%; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── STORE FOOTER ─── */
.store-footer {
  padding: 40px 24px;
  border-top: 1px solid var(--card-border);
  text-align: center;
  margin-top: 40px;
}

.store-footer .footer-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--white);
  margin-bottom: 8px;
}

.store-footer .footer-sub {
  color: var(--gray);
  font-size: 14px;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .product-detail {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .cart-layout,
  .checkout-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .cart-summary {
    position: static;
  }
}

@media (max-width: 600px) {
  .store-container {
    padding: 20px 16px 60px;
  }

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

  .product-image { font-size: 48px; }
  .product-info { padding: 12px; }
  .product-name { font-size: 14px; }
  .product-desc { display: none; }
  .product-price { font-size: 18px; }

  .add-btn {
    font-size: 12px;
    padding: 6px 12px;
  }

  .header-inner { padding: 0; }

  .nav-links {
    gap: 16px;
  }

  .nav-links a:not(.cart-link) {
    display: none;
  }

  .detail-image { font-size: 80px; }
  .detail-price { font-size: 32px; }

  .form-row {
    grid-template-columns: 1fr;
  }

  .page-header h1 { font-size: 24px; }
}
