/* ==========================================================================
   overrides.css — CONSOLIDATED
   - Keep header tablet layout (logo center + cart right)
   - Restore legacy AC filter dropdown styling (blue pill, dark panel, red highlight)
   - Restore checkout Select2 styling to match other fields
   ========================================================================== */

:root {
  --ac-blue: #2283aa;
  --ac-blue-dark: #1F7FA6;
  --panel-blue: #2A4E5D;
  /* dark brown/gray panel */
  --hover-red: #DC3545;
  /* red hover row */
  --amber-selected: #F59E0B;
  /* selected row gold */
  --text-light: #FFFFFF;
  --text-dark: #1F2937;

  --field-h: 46px;
  --field-bg: #ffffff;
  --field-b: #c9c9c9;
  --field-text: #222222;
}

/* ============================================================
   PRODUCT ARCHIVE + SEARCH – ORDERBY (SORT DROPDOWN)
   Closed: AC-blue pill button
   Open: dark panel with red highlight & gold selected row
   ============================================================ */

/* Container/button (closed state) */
.post-type-archive-product .woocommerce-ordering .select2-container--default,
body.search .woocommerce-ordering .select2-container--default {
  width: 320px !important;
  max-width: 100% !important;
}

/* Selection (closed) */
.post-type-archive-product .woocommerce-ordering .select2-container--default .select2-selection--single,
body.search .woocommerce-ordering .select2-container--default .select2-selection--single {
  background-color: var(--ac-blue) !important;
  border-radius: 999px !important;
  border: none !important;
  padding: 0 40px 0 16px !important;
  min-height: 44px !important;
  display: flex !important;
  align-items: center !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18) !important;
}

/* Selected text (closed) */
.post-type-archive-product .woocommerce-ordering .select2-container--default .select2-selection--single .select2-selection__rendered,
body.search .woocommerce-ordering .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--text-light) !important;
  font-weight: 700 !important;
  letter-spacing: .2px !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  line-height: 1.35 !important;
}

/* Arrow alignment */
.post-type-archive-product .woocommerce-ordering .select2-container--default .select2-selection--single .select2-selection__arrow,
body.search .woocommerce-ordering .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 100% !important;
  top: 0 !important;
  right: 16px !important;
  display: flex !important;
  align-items: center !important;
}

/* Arrow icon */
.post-type-archive-product .woocommerce-ordering .select2-container--default .select2-selection--single .select2-selection__arrow b,
body.search .woocommerce-ordering .select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: #ffffff transparent transparent transparent !important;
}

/* === OPEN DROPDOWN PANEL (ARCHIVE + SEARCH) === */

.post-type-archive-product .woocommerce-ordering .select2-dropdown,
body.search .woocommerce-ordering .select2-dropdown {
  margin-top: 8px !important;
  background: var(--panel-blue) !important;
  border: 1px solid rgba(0, 0, 0, .25) !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  z-index: 9999 !important;
  padding: 8px 0 !important;
}

/* Results wrapper */
.post-type-archive-product .woocommerce-ordering .select2-results,
body.search .woocommerce-ordering .select2-results {
  border: 0 !important;
  box-shadow: none !important;
  background-image: none !important;
}

/* Individual options */
.post-type-archive-product .woocommerce-ordering .select2-results__option,
body.search .woocommerce-ordering .select2-results__option {
  padding: 12px 14px !important;
  color: #F5F5F5 !important;
  line-height: 1.35 !important;
  border: 0 !important;
  box-shadow: none !important;
  background-image: none !important;
  border-radius: 8px !important;
}

/* Selected option row */
.post-type-archive-product .woocommerce-ordering .select2-results__option[aria-selected="true"],
body.search .woocommerce-ordering .select2-results__option[aria-selected="true"] {
  background: var(--amber-selected) !important;
  color: var(--text-dark) !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
}

/* Hovered (not selected) option row */
.post-type-archive-product .woocommerce-ordering .select2-results__option--highlighted[aria-selected="false"],
body.search .woocommerce-ordering .select2-results__option--highlighted[aria-selected="false"] {
  background: var(--hover-red) !important;
  color: var(--text-light) !important;
}

/* Hovered when already selected */
.post-type-archive-product .woocommerce-ordering .select2-results__option--highlighted[aria-selected="true"],
body.search .woocommerce-ordering .select2-results__option--highlighted[aria-selected="true"] {
  background: #D97706 !important;
  color: var(--text-light) !important;
}

/* Mobile width of the button */
@media (max-width:767px) {

  .post-type-archive-product .woocommerce-ordering .select2-container--default,
  body.search .woocommerce-ordering .select2-container--default {
    width: 100% !important;
  }
}

/* Hide scrollbar in panel (archive only) */
body.post-type-archive-product .select2-dropdown .select2-results>.select2-results__options {
  max-height: none !important;
  overflow-y: hidden !important;
  scrollbar-width: none !important;
}

body.post-type-archive-product .select2-dropdown .select2-results>.select2-results__options::-webkit-scrollbar {
  display: none !important;
}

/* ============================================================
   CHECKOUT – SELECT2 FIELDS (STATE, HOW DID YOU HEAR ABOUT US)
   Match the other white fields
   ============================================================ */

/* Make Select2 containers full width in checkout */
.woocommerce-checkout .select2-container {
  width: 100% !important;
}

/* Closed select box */
.woocommerce-checkout .select2-container--default .select2-selection--single {
  background: var(--field-bg) !important;
  border: 1px solid var(--field-b) !important;
  border-radius: 2px !important;
  /* small radius like other fields */
  min-height: var(--field-h) !important;
  height: var(--field-h) !important;
  box-shadow: none !important;
  color: var(--field-text) !important;
  position: relative !important;
  padding-right: 36px !important;
}

/* Rendered text */
.woocommerce-checkout .select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: calc(var(--field-h) - 2px) !important;
  color: var(--field-text) !important;
  opacity: 1 !important;
  padding: 0 4px 0 12px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Arrow positioning */
.woocommerce-checkout .select2-container--default .select2-selection--single .select2-selection__arrow {
  position: absolute !important;
  top: 0 !important;
  right: 8px !important;
  height: 100% !important;
  width: 24px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transform: none !important;
}

/* Arrow icon color */
.woocommerce-checkout .select2-container--default .select2-selection--single .select2-selection__arrow b {
  margin: 0 !important;
  border-color: #666 transparent transparent transparent !important;
}

/* Options inside checkout dropdown */
.woocommerce-checkout .select2-results__option {
  color: #222 !important;
  padding: 10px 12px !important;
}

/* Selected option row */
.woocommerce-checkout .select2-results__option[aria-selected="true"] {
  background: #e5f2f7 !important;
  color: #111 !important;
  font-weight: 600 !important;
}

/* Hovered (not selected) row */
.woocommerce-checkout .select2-results__option--highlighted[aria-selected="false"] {
  background: #f3f4f6 !important;
  color: #111 !important;
}

/* Native selects (fallback + “How did you hear…” if not Select2) */
.woocommerce-checkout select {
  background: var(--field-bg) !important;
  border: 1px solid var(--field-b) !important;
  border-radius: 2px !important;
  height: var(--field-h) !important;
  line-height: var(--field-h) !important;
  color: var(--field-text) !important;
  padding: 0 36px 0 12px !important;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%23666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center !important;
  background-size: 10px 6px;
}

/* Use slightly darker border to match theme inputs */
.woocommerce-checkout .select2-container--default .select2-selection--single,
.woocommerce-checkout .select2-container .select2-dropdown,
.woocommerce-checkout select {
  border-color: #666 !important;
}

/* Focus state: keep border consistent (no blue glow) */
.woocommerce-checkout .select2-container--default.select2-container--focus .select2-selection--single,
.woocommerce-checkout .select2-container--default .select2-selection--single:focus,
.woocommerce-checkout select:focus {
  border-color: #666 !important;
  outline: none !important;
  box-shadow: none !important;
}

/* ============================================================
   TABLET HEADER – match mobile layout (logo center + cart right)
   ============================================================ */

@media (min-width: 641px) and (max-width: 1024px) {

  /* Make the navbar the positioning context on tablet */
  .hsnav .navbar {
    position: relative !important;
    height: 60px !important;
  }

  /* Don’t let nav wrappers become positioning contexts */
  .navmenu {
    position: static !important;
  }

  .navmenu .menu {
    position: static !important;
  }

  /* CART on the right */
  .navmenu .menu>li.cart {
    position: absolute !important;
    top: 50% !important;
    right: 12px !important;
    left: auto !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
    width: 36px !important;
    height: 36px !important;
    list-style: none !important;
    z-index: 20 !important;
  }

  .navmenu .menu>li.cart>a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    color: #000 !important;
  }

  .navmenu .menu>li.cart>a svg {
    width: 24px !important;
    height: 24px !important;
    display: block !important;
  }

  .navmenu .menu>li.cart>a svg * {
    fill: currentColor !important;
    stroke: currentColor !important;
  }

  .navmenu .menu>li.cart>a img {
    width: 24px !important;
    height: auto !important;
    display: block !important;
  }

  .navmenu .menu>li.cart>a i {
    font-size: 24px !important;
    line-height: 1 !important;
    color: #000 !important;
  }

  .navmenu .menu>li.cart .count,
  .navmenu .menu>li.cart .badge,
  .navmenu .menu>li.cart [class*="count"] {
    position: absolute !important;
    top: -6px !important;
    right: -6px !important;
    left: auto !important;
    transform: none !important;
    min-width: 16px;
    min-height: 16px;
    line-height: 16px;
    padding: 0 4px;
    border-radius: 10px;
    background: #fff;
    color: #000000;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    z-index: 21 !important;
  }

  /* LOGO centered on tablet */
  .hsnav .navbar .navlogo,
  .hsnav .navbar .navlogo a {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    text-align: center !important;
    width: auto !important;
    z-index: 3 !important;
  }

  .hsnav .navbar .navlogo img {
    max-height: 80px !important;
    width: auto !important;
    height: auto !important;
    display: block !important;
  }
}

/* === SEARCH & ARCHIVE SORT BUTTON: remove square background bar === */

/* Clear any background/border on the wrapper */
.post-type-archive-product .woocommerce-ordering,
body.search .woocommerce-ordering {
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* Make the Select2 container itself pill-shaped and transparent */
.post-type-archive-product .woocommerce-ordering .select2-container--default,
body.search .woocommerce-ordering .select2-container--default {
  background: transparent !important;
  border-radius: 999px !important;
  overflow: visible !important;
}

/* ==== WooCommerce "Sale!" badge – square in top-left ==== */
.woocommerce ul.products li.product .onsale,
.woocommerce span.onsale {
  position: absolute;
  top: 12px;
  left: 12px;

  /* box shape */
  padding: 6px 10px;
  width: auto !important;
  height: auto !important;
  line-height: 1.2;
  border-radius: 4px;
  /* <-- square/rounded-rect instead of circle */

  /* new green color */
  background: #2e8b57;
  /* nicer green */
  color: #ffffff;

  /* text styling */
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  text-align: center;

  /* small shadow so it stands out */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* ==== WooCommerce "Sale!" badge – bigger, italic, centered ==== */
.woocommerce ul.products li.product .onsale,
.woocommerce span.onsale {
  /* size & layout */
  padding: 10px 16px;
  min-width: 80px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;

  /* text styling – 2–3x larger, italic, centered */
  font-size: 22px;
  /* increase if you want even bigger */
  font-weight: 700;
  font-style: italic;
  text-align: center;
  text-transform: uppercase;

  /* box look */
  position: absolute;
  top: 12px;
  left: 12px;
  border-radius: 4px;
  background: #2e8b57;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}