/* ============================================================
   CAPS SHOP / WOOCOMMERCE STYLES
   Archive, filters, single product, AJAX states
   ============================================================ */

/* ----- Active filters bar ----- */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  min-height: 36px;
}

.active-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(0, 102, 255, 0.12);
  border: 1px solid rgba(0, 102, 255, 0.3);
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #3385FF;
  cursor: pointer;
  transition: background 0.2s ease;
}

.active-filter-tag:hover { background: rgba(204, 0, 34, 0.12); border-color: rgba(204, 0, 34, 0.3); color: #FF0033; }

.active-filter-tag svg { width: 10px; height: 10px; }

/* ----- Grid loading state ----- */
.shop-grid-wrap {
  position: relative;
  min-height: 400px;
}

.shop-grid-wrap.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(8,8,8,0.5);
  backdrop-filter: blur(4px);
  border-radius: 12px;
  z-index: 10;
}

.shop-grid-loader {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 11;
  display: none;
}

.shop-grid-wrap.is-loading .shop-grid-loader { display: block; }

.loader-spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(255,255,255,0.08);
  border-top-color: #0066FF;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ----- Pagination ----- */
.caps-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 48px;
}

.page-numbers {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: rgba(245,245,240,0.6);
  border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.2s ease;
  text-decoration: none;
}

.page-numbers:hover { background: rgba(0,102,255,0.12); border-color: rgba(0,102,255,0.3); color: #3385FF; }
.page-numbers.current { background: #0066FF; border-color: #0066FF; color: #fff; }
.page-numbers.prev, .page-numbers.next { border-radius: 9999px; width: auto; padding: 0 16px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }

/* ----- Single Product Page ----- */
.single-product-wrap {
  padding-top: calc(var(--nav-height, 80px) + 40px);
  padding-bottom: 96px;
}

.product-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

/* Product gallery */
.product-gallery__main {
  aspect-ratio: 4/5;
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  background: #1a1a1a;
}

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

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

.product-gallery__thumbs {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.gallery-thumb {
  width: 72px; height: 72px;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s ease;
  flex-shrink: 0;
}

.gallery-thumb.active { border-color: #0066FF; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Product info */
.product-info { position: sticky; top: calc(var(--nav-height, 80px) + 24px); }

.product-breadcrumb {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(245,245,240,0.4);
  margin-bottom: 16px;
}

.product-breadcrumb a { color: #0066FF; transition: color 0.2s; }
.product-breadcrumb a:hover { color: #fff; }

.product-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 0.9;
  margin-bottom: 20px;
}

.product-price-wrap {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 24px;
}

.product-price { font-size: 1.75rem; font-weight: 700; }
.product-price-orig { font-size: 1rem; color: rgba(245,245,240,0.4); text-decoration: line-through; }
.product-price-save {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  background: rgba(204,0,34,0.15); border: 1px solid rgba(204,0,34,0.3);
  color: #FF0033; padding: 3px 10px; border-radius: 9999px;
}

.product-short-desc { color: rgba(245,245,240,0.65); line-height: 1.75; margin-bottom: 28px; }

/* Color swatches */
.product-variations { margin-bottom: 24px; }
.variation-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase;
  color: rgba(245,245,240,0.5); margin-bottom: 12px;
}

.swatches { display: flex; gap: 8px; flex-wrap: wrap; }

.swatch {
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  border: 3px solid transparent; transition: border-color 0.2s, transform 0.2s;
  position: relative;
}
.swatch.active, .swatch:hover { border-color: #fff; transform: scale(1.15); }
.swatch::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid transparent;
  transition: border-color 0.2s;
}
.swatch.active::after { border-color: rgba(255,255,255,0.3); }

/* Size buttons */
.size-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.size-btn {
  padding: 8px 16px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(245,245,240,0.6);
  transition: all 0.2s ease; cursor: pointer; background: transparent;
}
.size-btn:hover, .size-btn.active { background: #0066FF; border-color: #0066FF; color: #fff; }
.size-btn.out-of-stock { opacity: 0.3; cursor: not-allowed; text-decoration: line-through; }

/* Product CTA row */
.product-cta {
  display: flex; gap: 12px;
  margin-top: 32px; padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* Product meta */
.product-meta {
  margin-top: 24px; padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.05);
  font-size: 12px; color: rgba(245,245,240,0.4);
  display: flex; flex-direction: column; gap: 6px;
}
.product-meta span { color: rgba(245,245,240,0.7); }

/* ----- Filter sidebar mobile toggle ----- */
.filter-toggle-btn {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(245,245,240,0.7);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}
.filter-toggle-btn:hover { background: rgba(0,102,255,0.1); border-color: rgba(0,102,255,0.3); color: #3385FF; }

@media (max-width: 1024px) {
  .filter-toggle-btn { display: inline-flex; }

  .shop-sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 300px; height: 100%;
    z-index: 800;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    border-radius: 0;
    border-left: none;
    border-right: 1px solid rgba(255,255,255,0.08);
  }

  .shop-sidebar.open { transform: translateX(0); }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 799;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
  }
  .sidebar-overlay.active { opacity: 1; pointer-events: all; }

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

  .product-layout { grid-template-columns: 1fr; gap: 40px; }
  .product-info { position: static; }
}

/* ============================================================
   VARIATION SWATCHES — hide native <select>, show custom boxes
   ============================================================ */

/* Hide the native WooCommerce dropdown */
.variations select,
.variations .value > select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  padding: 0 !important;
  margin: -1px !important;
}

/* Also hide the default WC <label> inside .variations — we render our own */
.variations .label {
  display: none;
}

/* Wrapper for each attribute's swatches */
.caps-swatch-wrap {
  margin-bottom: 20px;
}

.caps-swatch-label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(245, 245, 240, 0.5);
  margin-bottom: 10px;
}

.caps-swatch-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Individual swatch button */
.caps-swatch-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(245, 245, 240, 0.65);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease,
    transform 0.2s ease,
    box-shadow 0.25s ease;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}

/* Hover state */
.caps-swatch-option:hover:not(.disabled):not(.selected) {
  background: rgba(0, 102, 255, 0.08);
  border-color: rgba(0, 102, 255, 0.35);
  color: #3385FF;
  transform: translateY(-1px);
}

/* Active / Selected state */
.caps-swatch-option.selected {
  background: #0066FF;
  border-color: #0066FF;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 102, 255, 0.35), 0 0 0 3px rgba(0, 102, 255, 0.12);
  transform: translateY(-1px);
}

/* Disabled / Out-of-stock */
.caps-swatch-option.disabled {
  opacity: 0.25;
  cursor: not-allowed;
  text-decoration: line-through;
  pointer-events: none;
}

/* Focus-visible for keyboard accessibility */
.caps-swatch-option:focus-visible {
  outline: 2px solid #3385FF;
  outline-offset: 2px;
}

/* Reset link alignment */
.variations .reset_variations {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245, 245, 240, 0.4);
  transition: color 0.2s ease;
}
.variations .reset_variations:hover {
  color: #FF0033;
}

/* ============================================================
   INLINE PRODUCT DESCRIPTION (moved from tabs to summary)
   ============================================================ */

.caps-product-description {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(245, 245, 240, 0.6);
  font-size: 14px;
  line-height: 1.8;
}

.caps-product-description p {
  margin-bottom: 12px;
}

.caps-product-description p:last-child {
  margin-bottom: 0;
}

.caps-product-description ul,
.caps-product-description ol {
  margin: 12px 0;
  padding-left: 20px;
}

.caps-product-description li {
  margin-bottom: 6px;
  list-style: disc;
}

.caps-product-description ol li {
  list-style: decimal;
}

.caps-product-description h2,
.caps-product-description h3,
.caps-product-description h4 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  color: rgba(245, 245, 240, 0.85);
  margin: 16px 0 8px;
  line-height: 1.2;
}

.caps-product-description h2 { font-size: 1.25rem; }
.caps-product-description h3 { font-size: 1.1rem; }
.caps-product-description h4 { font-size: 1rem; }

.caps-product-description strong {
  color: rgba(245, 245, 240, 0.8);
  font-weight: 600;
}

.caps-product-description a {
  color: #3385FF;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.caps-product-description a:hover {
  color: #fff;
}

/* Hide WooCommerce default product tabs (description removed, no tabs needed) */
.woocommerce-tabs,
.wc-tabs-wrapper {
  display: none !important;
}
