/*
Theme Name: Airsoft Divi Child
Template: Divi
Version: 1.0.0
Author: William Dobson
Description: Child theme for Airsoft Replica Comparison site
*/

/* =========================================================
   Root variables
========================================================= */
:root {
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --surface-alt: #EEF2F7;

  --text-strong: #1F2937;
  --text-muted: #6B7280;

  --border: #D1D5DB;
  --border-soft: #E5E7EB;
  --border-subtle: #EEF2F7;

  --brand-dark: #334155;
  --accent: #C65D07;
  --accent-hover: #9A4605;

  --success: #166534;
  --warning: #B45309;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-soft: 0 4px 16px rgba(15, 23, 42, 0.06);
  --shadow-card: 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-card-hover: 0 18px 40px rgba(15, 23, 42, 0.12);
}

/* =========================================================
   Comparison page
========================================================= */
.comparison-table td.highlight {
  background-color: #fff3cd;
  font-weight: 600;
}

.comparison-cart-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: #1a1a2e;
  color: #fff;
}

.comparison-cart-bar.active {
  display: flex;
}

.compare-btn {
  background: #e84545;
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}

.add-to-compare-btn {
  background: #16213e;
  color: #fff;
  border: 2px solid #e84545;
  padding: 6px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.add-to-compare-btn:hover,
.add-to-compare-btn.selected {
  background: #e84545;
  border-color: #e84545;
}

/* =========================================================
   Review stars
========================================================= */
.half-star-rating {
  display: inline-flex;
  direction: ltr;
  font-size: 24px;
}

.half-star-rating .star {
  position: relative;
  color: #ddd;
  cursor: pointer;
}

.half-star-rating .star.filled,
.half-star-rating .star.half-filled {
  color: #f5a623;
}

/* =========================================================
   Global Divi buttons
========================================================= */
.et_pb_button.btn-primary {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #fff !important;
  transition: all 0.2s ease;
}

.et_pb_button.btn-primary:hover {
  background-color: var(--accent-hover) !important;
  border-color: var(--accent-hover) !important;
  color: #fff !important;
}

.et_pb_button.btn-secondary {
  background-color: var(--surface);
  border: 1px solid var(--border);
  color: var(--brand-dark) !important;
  transition: all 0.2s ease;
}

.et_pb_button.btn-secondary:hover {
  background-color: var(--bg) !important;
  border-color: var(--brand-dark) !important;
  color: var(--text-strong) !important;
}

/* =========================================================
   Airsoft gallery
========================================================= */
.airsoft-gallery {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.airsoft-gallery__main-wrap {
  width: 100%;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.airsoft-gallery__main-link {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.airsoft-gallery__main-image {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 380px;
  height: auto;
  object-fit: contain;
}

.airsoft-gallery__thumbs-wrap {
  width: 100%;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
}

.airsoft-gallery__thumbs-viewport {
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.airsoft-gallery__thumbs {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  box-sizing: border-box;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.airsoft-gallery__thumbs::-webkit-scrollbar {
  display: none;
}

.airsoft-gallery__thumb {
  flex: 0 0 78px;
  width: 78px;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.airsoft-gallery__thumb:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.airsoft-gallery__thumb.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(198, 93, 7, 0.12);
}

.airsoft-gallery__thumb-image {
  display: block;
  width: 100%;
  max-height: 60px;
  height: auto;
  object-fit: contain;
}

.airsoft-gallery__nav {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--brand-dark);
  border-radius: 999px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  transition: all 0.2s ease;
}

.airsoft-gallery__nav:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: #FFF7F1;
}

/* =========================================================
   Key specs
========================================================= */
.replica-spec-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.replica-price-block {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.replica-price-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.replica-price-value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--accent);
}

.replica-spec-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.replica-spec-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--surface-alt);
}

.replica-spec-row:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.replica-spec-label {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-muted);
}

.replica-spec-value {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-strong);
  text-align: right;
}

/* =========================================================
   Key specs CTA buttons
========================================================= */
.replica-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.replica-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.replica-btn-primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}

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

.replica-btn-secondary {
  background: var(--surface);
  color: var(--brand-dark);
  border: 1px solid var(--border);
}

.replica-btn-secondary:hover {
  background: var(--bg);
  border-color: var(--brand-dark);
  color: var(--text-strong);
}

/* =========================================================
   Full specs
========================================================= */
.replica-full-specs {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
}

.replica-full-specs__row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--surface-alt);
}

.replica-full-specs__row:first-child {
  padding-top: 0;
}

.replica-full-specs__row:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.replica-full-specs__label {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-muted);
}

.replica-full-specs__value {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-strong);
  text-align: right;
}

/* =========================================================
   Overview content
========================================================= */
.replica-overview-body {
  padding: 24px !important;
  box-sizing: border-box;
}

.replica-overview-content {
  display: block;
  width: 100%;
  margin: 0 !important;
  padding: 20px 28px 28px !important;
  box-sizing: border-box;
  background: var(--surface);
  border: 1px solid var(--border-soft) !important;
  border-radius: 10px !important;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-strong);
}

.replica-overview-content .et_pb_module_inner,
.replica-overview-content .entry-content,
.replica-overview-content .post-content,
.replica-overview-content .et-l--post-content {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-sizing: border-box;
}

.replica-overview-content p {
  margin: 0 0 18px !important;
}

.replica-overview-content p:last-child {
  margin-bottom: 0 !important;
}

.replica-overview-content h2,
.replica-overview-content h3,
.replica-overview-content h4 {
  margin: 24px 0 12px !important;
  line-height: 1.25;
  color: var(--text-strong);
}

.replica-overview-content ul,
.replica-overview-content ol {
  margin: 0 0 18px 20px !important;
  padding: 0 !important;
}

.replica-overview-content li {
  margin-bottom: 8px !important;
}

.replica-overview-content strong {
  color: var(--text-strong);
  font-weight: 600;
}

/* =========================================================
   Archive loop wrapper (no layout here now)
========================================================= */
.replica-archive-loop {
  /* no grid or flex here – Divi Loop/Grid handles layout
     on the parent .replica-archive-results container */
}

/* =========================================================
   Archive card
========================================================= */
.replica-archive-card {
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.replica-archive-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border);
}

.replica-archive-card .et_pb_module {
  margin-bottom: 0 !important;
}

/* =========================================================
   Archive card image
========================================================= */
.replica-archive-image {
  margin-bottom: 0 !important;
}

.replica-archive-image .et_pb_image_wrap {
  display: block;
  text-align: center;
  padding: 10px 10px 6px;
  background:
    radial-gradient(circle at top, rgba(200, 123, 42, 0.08), transparent 55%),
    linear-gradient(180deg, #FCFCFD 0%, #F8FAFC 100%);
  border-bottom: 1px solid #F1F5F9;
}

.replica-archive-image img {
  width: 100%;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  display: inline-block;
  transition: transform 0.25s ease;
}

.replica-archive-card:hover .replica-archive-image img {
  transform: scale(1.03);
}

/* =========================================================
   Archive card text
========================================================= */
.replica-archive-meta {
  margin-bottom: 2px !important;
}

.replica-archive-meta .et_pb_text_inner {
  padding: 0 16px;
  font-size: 10px;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.replica-archive-title {
  margin-bottom: 6px !important;
}

.replica-archive-title h1,
.replica-archive-title h2,
.replica-archive-title h3,
.replica-archive-title h4,
.replica-archive-title h5,
.replica-archive-title h6 {
  margin: 4px 0 0 !important;
  padding: 0 16px;
  font-size: 18px;
  line-height: 1.15;
  font-weight: 700;
  color: #111827;
}

.replica-archive-price {
  margin-bottom: 10px !important;
}

.replica-archive-price .et_pb_text_inner {
  padding: 0 16px;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--accent);
}

.replica-archive-spec {
  margin-bottom: 12px !important;
}

.replica-archive-spec .et_pb_text_inner {
  margin: 0 16px;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
  font-size: 12px;
  line-height: 1.4;
  color: #4B5563;
}

/* =========================================================
   Archive card buttons
========================================================= */
.replica-archive-buttons {
  padding: 4px 12px 18px;
}

.replica-archive-buttons .et_pb_row,
.replica-archive-buttons .et_pb_row_inner {
  display: flex;
  gap: 10px;
}

.replica-archive-buttons .et_pb_column {
  flex: 1 1 0;
  width: auto !important;
  margin-right: 0 !important;
  margin-bottom: 0 !important;
}

.replica-archive-buttons .et_pb_column .et_pb_module,
.replica-archive-buttons .et_pb_button_module_wrapper {
  width: 100%;
  margin-bottom: 0 !important;
}

.replica-archive-view,
.replica-archive-compare {
  margin-bottom: 0 !important;
}

.replica-archive-view .et_pb_button,
.replica-archive-compare .et_pb_button {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px !important;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-align: center;
  box-shadow: none;
  transition: all 0.2s ease;
}

.replica-archive-view .et_pb_button {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff !important;
}

.replica-archive-view .et_pb_button:hover {
  background: var(--accent-hover) !important;
  border-color: var(--accent-hover) !important;
}

.replica-archive-compare .et_pb_button {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-strong) !important;
}

.replica-archive-compare .et_pb_button:hover {
  background: #F9FAFB !important;
  border-color: #9CA3AF !important;
}

/* =========================================================
   Responsive tweaks (non-layout)
========================================================= */
@media (max-width: 1200px) {
  .airsoft-gallery {
    max-width: 100%;
  }
}

@media (max-width: 767px) {
  .airsoft-gallery {
    max-width: 100%;
  }

  .airsoft-gallery__main-wrap {
    min-height: 280px;
    padding: 16px;
  }

  .airsoft-gallery__main-image {
    max-height: 240px;
  }

  .airsoft-gallery__thumbs-wrap {
    grid-template-columns: 32px minmax(0, 1fr) 32px;
    gap: 8px;
  }

  .airsoft-gallery__thumb {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
  }

  .airsoft-gallery__thumb-image {
    max-height: 48px;
  }

  .airsoft-gallery__nav {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }

  .replica-price-value {
    font-size: 28px;
  }

  .replica-spec-row,
  .replica-full-specs__row {
    flex-direction: column;
    gap: 4px;
  }

  .replica-spec-value,
  .replica-full-specs__value {
    text-align: left;
  }
}

/* =========================================================
   Sidebar filter CSS
========================================================= */
.replica-filter-sidebar {
  background: linear-gradient(180deg, #FCFCFD 0%, #F8FAFC 100%);
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  padding: 20px 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.replica-filter-sidebar h2,
.replica-filter-sidebar h3,
.replica-filter-sidebar h4,
.replica-filter-sidebar .et_pb_module_header,
.replica-filter-sidebar legend {
  font-size: 14px;
  font-weight: 700;
  color: #1E293B;
  letter-spacing: 0.02em;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #E2E8F0;
}

.replica-filter-sidebar .sf-field-taxonomy-manufacturer,
.replica-filter-sidebar .sf-field-post-meta-price,
.replica-filter-sidebar .sf-field-post-meta-fps,
.replica-filter-sidebar .sf-field-taxonomy-power-source,
.replica-filter-sidebar .sf-field-taxonomy-exterior-material,
.replica-filter-sidebar fieldset {
  margin-bottom: 22px;
}

.replica-filter-sidebar label,
.replica-filter-sidebar li,
.replica-filter-sidebar .sf-label-checkbox {
  color: #475569;
  font-size: 13px;
  line-height: 1.5;
}

.replica-filter-sidebar input[type="checkbox"] {
  accent-color: #C77B2A;
}

.replica-filter-sidebar input[type="text"],
.replica-filter-sidebar input[type="number"],
.replica-filter-sidebar select {
  width: 100%;
  border: 1px solid #CBD5E1;
  border-radius: 10px;
  background: #FFFFFF;
  color: #1E293B;
  padding: 9px 10px;
  font-size: 13px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.replica-filter-sidebar input[type="text"]:focus,
.replica-filter-sidebar input[type="number"]:focus,
.replica-filter-sidebar select:focus {
  outline: none;
  border-color: #C77B2A;
  box-shadow: 0 0 0 3px rgba(199, 123, 42, 0.12);
}

.replica-filter-sidebar .ui-slider,
.replica-filter-sidebar input[type="range"] {
  margin-top: 10px;
}

.replica-filter-sidebar .ui-slider .ui-slider-range {
  background: #C77B2A;
}

.replica-filter-sidebar .ui-slider .ui-slider-handle {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid #C77B2A;
  box-shadow: 0 2px 6px rgba(199, 123, 42, 0.25);
}

.replica-filter-sidebar .count,
.replica-filter-sidebar .sf-count {
  color: #94A3B8;
  font-size: 12px;
}

.replica-filter-sidebar a {
  color: #C77B2A;
  text-decoration: none;
}

.replica-filter-sidebar a:hover {
  color: #A8641E;
  text-decoration: underline;
}