/* ============================================================
   HIIT & RUN — WooCommerce shop styling
   Reuses the site's design tokens (:root vars in styles.css):
   dark background, yellow (#F5FF00) accent, Bebas Neue headings,
   square uppercase buttons — so Shop/Product pages match the homepage.
   Loaded only on WooCommerce pages (see functions.php).
   ============================================================ */

/* ---------- Page frame / spacing ---------- */
.woocommerce-shop,
.post-type-archive-product,
.tax-product_cat,
.single-product {
  background: var(--black);
  color: var(--white);
}

/* The shop renders inside the theme's .inner-page__content, which is capped at
   720px for text pages. Remove that cap on store pages so the product grid
   fills the full .container width (the .container already provides the gutter). */
.woocommerce-shop .inner-page__content,
.post-type-archive-product .inner-page__content,
.tax-product_cat .inner-page__content,
.single-product .inner-page__content {
  max-width: none;
}

.woocommerce-products-header {
  padding-top: clamp(90px, 12vh, 150px);
  padding-bottom: 8px;
  text-align: center;
}
.woocommerce-products-header__title,
.woocommerce-products-header .page-title {
  font-family: var(--head);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: clamp(48px, 6.5vw, 80px);
  line-height: 0.95;
  color: var(--white);
}
.term-description { color: var(--text-2); max-width: 620px; margin: 12px auto 0; }

/* ---------- Result count + ordering ---------- */
.woocommerce .woocommerce-result-count {
  color: var(--text-2);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.woocommerce .woocommerce-ordering select {
  background: var(--black-alt);
  color: var(--white);
  border: 1px solid var(--gray-line);
  border-radius: 0;
  padding: 10px 14px;
  font-family: var(--body);
  font-size: 13px;
}

/* ---------- Phase section headings (h2 between phases) ---------- */
.shop-phase-title {
  font-family: var(--head);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1;
  color: var(--white);
  margin: 60px 0 26px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-line);
  position: relative;
}
.shop-phase-title::after {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  width: 80px; height: 3px;
  background: var(--yellow);
}
.shop-phase-title:first-child { margin-top: 8px; }
.shop-phase:first-child .shop-phase-title { margin-top: 8px; }

/* Locked / closed phases read as visually disabled. */
.shop-phase--locked,
.shop-phase--closed { opacity: 0.55; }
.shop-phase--locked .shop-phase-title::after,
.shop-phase--closed .shop-phase-title::after { background: var(--text-2); }

/* Disabled state button (Sold Out / Not Available Yet) — greyed, not clickable. */
.woocommerce ul.products li.product .hitnrun-btn-disabled {
  background: var(--gray-line) !important;
  border-color: var(--gray-line) !important;
  color: var(--text-2) !important;
  cursor: not-allowed;
  pointer-events: none;
  transform: none !important;
}
/* each phase renders its own .woocommerce wrapper — tighten the gap to the h2 */
.shop-phase-title + .woocommerce { margin-top: 0; }
.shop-phase-title + .woocommerce ul.products { margin-top: 0; }

/* ---------- Product grid (mirrors homepage .cats / .cat cards) ---------- */
.woocommerce ul.products {
  display: grid;
  /* Always 4 across on desktop (drops to 2 / 1 only on small screens). */
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  margin: 40px auto 0;
  list-style: none;
}
.woocommerce ul.products::before,
.woocommerce ul.products::after { content: none; }

.woocommerce ul.products li.product {
  width: auto !important;
  margin: 0 !important;
  float: none !important;
  background: var(--black);
  border: 1px solid var(--gray-line);
  padding: 32px 28px 30px;
  min-height: 300px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: left;
  transition: border-color .35s var(--ease), transform .35s var(--ease);
}
.woocommerce ul.products li.product::after {
  content: "";
  position: absolute;
  left: 0; top: 0;
  height: 4px; width: 0;
  background: var(--yellow);
  transition: width .4s var(--ease);
}
.woocommerce ul.products li.product:hover {
  border-color: var(--yellow);
  transform: translateY(-6px);
}
.woocommerce ul.products li.product:hover::after { width: 100%; }

.woocommerce ul.products li.product a img {
  margin-bottom: 20px;
  border: 1px solid var(--gray-line-2);
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-family: var(--head);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 27px;
  line-height: 1.02;
  color: var(--yellow);
  padding: 0;
  margin: 0 0 10px;
  /* Wrap long words between words only — never clip mid-word. */
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}

.woocommerce ul.products li.product .price {
  color: var(--white);
  font-size: 14px;
  margin: 0 0 18px;
}
.woocommerce ul.products li.product .price .woocommerce-Price-amount {
  font-family: var(--head);
  font-size: 26px;
  color: var(--yellow);
  letter-spacing: 1px;
}
.woocommerce ul.products li.product .price del { color: var(--text-2); opacity: .6; }
.woocommerce ul.products li.product .price ins { text-decoration: none; }

/* Full-width CTA pinned to the bottom of the card — label never clips. */
.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product .added_to_cart {
  margin-top: auto;
  width: 100%;
}
/* Gap between "Add to cart" and the "View cart" link shown after adding. */
.woocommerce ul.products li.product .added_to_cart {
  margin-top: 12px;
}

/* ---------- Buttons (mirror homepage .btn) ---------- */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce .button,
.woocommerce a.added_to_cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 30px;
  font-family: var(--body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 0;
  border: 2px solid var(--yellow);
  background: var(--yellow) !important;
  color: #000 !important;
  transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease), transform .2s var(--ease);
  white-space: nowrap;
}
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover,
.woocommerce .button:hover,
.woocommerce a.added_to_cart:hover {
  background: var(--white) !important;
  border-color: var(--white);
  color: #000 !important;
  transform: translateY(-2px);
}
.woocommerce a.button.disabled,
.woocommerce button.button:disabled,
.woocommerce button.button.disabled {
  background: var(--gray-line) !important;
  border-color: var(--gray-line);
  color: var(--text-2) !important;
  transform: none;
  cursor: not-allowed;
  opacity: 1;
}

/* ---------- Sale + stock badges ---------- */
.woocommerce span.onsale {
  background: var(--yellow);
  color: #000;
  font-family: var(--body);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 0;
  min-height: 0;
  min-width: 0;
  padding: 6px 12px;
  line-height: 1;
}
.woocommerce .stock.out-of-stock { color: var(--text-2); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; font-size: 12px; }
.woocommerce .stock.in-stock { color: var(--yellow); }

/* ---------- Notices ---------- */
.woocommerce-info,
.woocommerce-message,
.woocommerce-error {
  background: var(--black-alt);
  color: var(--white);
  border-top: 3px solid var(--yellow);
  border-radius: 0;
  list-style: none;
}
.woocommerce-info::before,
.woocommerce-message::before,
.woocommerce-error::before { color: var(--yellow); }
.woocommerce-info a, .woocommerce-message a { color: var(--yellow); }

/* ---------- Single product ---------- */
.single-product div.product { padding-top: clamp(90px, 12vh, 150px); }
.single-product div.product .product_title {
  font-family: var(--head);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 0.95;
  color: var(--white);
}
.single-product div.product p.price,
.single-product div.product span.price {
  color: var(--yellow);
  font-family: var(--head);
  font-size: 34px;
  letter-spacing: 1px;
}
.single-product .woocommerce-tabs .tabs li a { color: var(--text-2); }
.single-product .woocommerce-tabs .tabs li.active a { color: var(--yellow); }
.single-product form.cart .quantity input.qty {
  background: var(--black-alt);
  color: var(--white);
  border: 1px solid var(--gray-line);
  border-radius: 0;
  padding: 12px;
}

/* ---------- Pagination ---------- */
.woocommerce nav.woocommerce-pagination ul { border: 0; margin-top: 40px; }
.woocommerce nav.woocommerce-pagination ul li { border: 0; }
.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
  color: var(--white);
  border: 1px solid var(--gray-line);
  background: var(--black-alt);
  padding: 10px 16px;
}
.woocommerce nav.woocommerce-pagination ul li span.current,
.woocommerce nav.woocommerce-pagination ul li a:hover {
  background: var(--yellow);
  color: #000;
  border-color: var(--yellow);
}

/* ---------- Cart & Checkout ---------- */
/* Full container width (lift the theme's 720px text-column cap). */
.woocommerce-cart .inner-page__content,
.woocommerce-checkout .inner-page__content {
  max-width: none;
  color: var(--white);
}

/* Remove product images (block cart + classic cart). */
.wc-block-cart-item__image,
.woocommerce-cart-form td.product-thumbnail,
.woocommerce-cart-form th.product-thumbnail {
  display: none !important;
}

/* Classic checkout / cart form fields on the dark background. */
.woocommerce-checkout label,
.woocommerce-cart .inner-page__content h1,
.woocommerce-cart .inner-page__content h2,
.woocommerce-cart .inner-page__content h3 {
  color: var(--white);
}
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce-checkout select,
.woocommerce .select2-selection {
  background: var(--black-alt);
  color: var(--white);
  border: 1px solid var(--gray-line);
  border-radius: 0;
  padding: 12px 14px;
}
.woocommerce .select2-selection__rendered { color: var(--white); line-height: 1.6; }

/* Every checkout field the same size: full width, stacked (overrides the
   half-width first/last pairs like First name / Last name). Needs the specific
   classes + !important to beat WooCommerce's own `.woocommerce form .form-row-first`. */
.woocommerce-checkout .form-row,
.woocommerce-checkout .form-row-first,
.woocommerce-checkout .form-row-last,
.woocommerce-checkout .form-row-thirds,
.woocommerce-checkout .form-row-two-thirds {
  width: 100% !important;
  float: none !important;
  clear: both !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0;
  padding-right: 0;
}
/* All controls full width + same height (covers date/email/tel/etc., not just
   .input-text, so the native date field matches the rest). Exclude tick boxes. */
.woocommerce-checkout .form-row input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
.woocommerce-checkout .form-row textarea,
.woocommerce-checkout .form-row select,
.woocommerce-checkout .form-row .select2-container {
  width: 100% !important;
  box-sizing: border-box;
}
/* Fixed height (not min-height) so text inputs and native selects match exactly. */
.woocommerce-checkout .form-row input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
.woocommerce-checkout .form-row select,
.woocommerce-checkout .form-row .select2-container .select2-selection--single {
  height: 48px !important;
  min-height: 48px;
  padding: 12px 14px;
  box-sizing: border-box;
  line-height: 1.4;
  vertical-align: middle;
}
/* select2 (country) internal alignment to the same 48px box. */
.woocommerce-checkout .form-row .select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 24px;
  padding: 0;
}
.woocommerce-checkout .form-row .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 46px;
}

/* Order review + cart totals tables. */
.woocommerce-checkout .shop_table,
.woocommerce-cart .cart_totals table,
.woocommerce table.shop_table {
  border: 1px solid var(--gray-line);
  border-radius: 0;
}
.woocommerce-checkout .shop_table th,
.woocommerce-checkout .shop_table td,
.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
  border-top: 1px solid var(--gray-line-2);
  color: var(--white);
}
.woocommerce-checkout #payment,
.woocommerce-cart .cart-collaterals .cart_totals {
  background: var(--black-alt);
  border: 1px solid var(--gray-line);
}

/* English checkout section headings. The client's Customizer CSS hides the real
   <h3> and overlays Serbian text via ::after (both languages); override the
   content for the English page only. Higher specificity + !important wins over
   the Customizer rule regardless of load order. */
html[lang^="en"] .woocommerce-checkout #customer_details .col-1 h3::after {
  content: "BILLING DETAILS" !important;
}
html[lang^="en"] .woocommerce-checkout #customer_details .col-2 h3::after {
  content: "ADDITIONAL INFORMATION" !important;
}

/* ---------- Responsive: 4 across on desktop, fewer only when too tight ---------- */
@media (max-width: 900px) {
  .woocommerce ul.products { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .woocommerce ul.products {
    grid-template-columns: 1fr;
    padding-left: 20px;
    padding-right: 20px;
  }
}
