/* =========================================================
   SP — SINGLE PRODUCT PAGE
   Scope: body.single-product
   Design language: Matches Equipment grid + site tokens
   ========================================================= */

/* =========================================================
   S0) Design Tokens (page-scoped)
   ========================================================= */

body.single-product{
  --sp-text: #111111;
  --sp-muted: #6b7280;
  --sp-line: rgba(17,17,17,.10);
  --sp-line-strong: rgba(17,17,17,.16);
  --sp-tile-bg: #f3f4f6;
  --sp-radius: 12px;
  --sp-tile-radius: 10px;
  --sp-shadow-soft: 0 8px 18px rgba(0,0,0,.08);
  --sp-icon-bg: #111111;
  --sp-icon-fg: #ffffff;
  --sp-font: "SF Pro Display","SF Pro Text",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
}

/* =========================================================
   S0.5) Breadcrumb — Equipment / Category / Product
   ========================================================= */

body.single-product .woocommerce-breadcrumb{
  font-family: var(--sp-font) !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  color: var(--sp-muted) !important;
  margin-bottom: 12px !important;
}

body.single-product .woocommerce-breadcrumb a{
  color: var(--sp-muted) !important;
  text-decoration: none !important;
  transition: color .15s ease !important;
}

body.single-product .woocommerce-breadcrumb a:hover{
  color: var(--sp-text) !important;
}

/* Separator between breadcrumb items */
body.single-product .woocommerce-breadcrumb .breadcrumb-separator{
  margin: 0 6px !important;
  color: var(--sp-muted) !important;
  opacity: 0.6 !important;
}

/* =========================================================
   S0.8) Product layout — centred with equal side padding
   ========================================================= */

/* Convert float-based layout to flexbox for even spacing */
body.single-product div.product{
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 40px !important;
  max-width: 960px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 24px !important;
  padding-right: 24px !important;
}

/* Gallery column */
body.single-product div.product .woocommerce-product-gallery{
  float: none !important;
  max-width: 420px !important;
  width: 420px !important;
  flex: 0 1 420px !important;
}

body.single-product div.product .woocommerce-product-gallery img{
  width: 100% !important;
  height: auto !important;
}

/* Summary column — fill remaining space */
body.single-product div.product .summary.entry-summary{
  float: none !important;
  width: auto !important;
  flex: 1 1 300px !important;
  max-width: 440px !important;
}

/* Related products — full width but centred within the same max-width */
body.single-product div.product .related.products{
  flex: 0 0 100% !important;
  max-width: 100% !important;
}

/* =========================================================
   S1) HIDE: Category names (above title + in meta)
   ========================================================= */

/* Astra category line above product title */
body.single-product .single-product-category,
body.single-product .ast-single-product-category{
  display: none !important;
}

/* WooCommerce meta categories (inside .product_meta) */
body.single-product .product_meta .posted_in{
  display: none !important;
}

/* =========================================================
   S2) HIDE: Rental period section (Rentman date pickers)
   ========================================================= */

body.single-product .rental-period{
  display: none !important;
}

/* =========================================================
   S3) HIDE: SKU + Categories meta block + any divider
   ========================================================= */

body.single-product .product_meta{
  display: none !important;
  border-top: none !important;
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* =========================================================
   S4) "/day" after price
   ========================================================= */

body.single-product .summary .price{
  display: inline-flex !important;
  align-items: baseline !important;
  gap: 4px !important;
  flex-wrap: wrap !important;
}

body.single-product .summary .price::after{
  content: "/day";
  font-size: 14px !important;
  font-weight: 590 !important;
  color: var(--sp-muted) !important;
  font-family: var(--sp-font) !important;
  white-space: nowrap;
}

/* Prevent double "/day" on sale prices (del + ins) */
body.single-product .summary .price del::after,
body.single-product .summary .price ins::after{
  content: none !important;
}

/* =========================================================
   S5) Product summary typography
   ========================================================= */

/* Product title */
body.single-product .summary .product_title{
  font-family: var(--sp-font) !important;
  font-weight: 700 !important;
  color: var(--sp-text) !important;
}

/* =========================================================
   S6) "Quantity:" label + form layout
   ========================================================= */

/* Make the form a vertical stack */
body.single-product form.cart{
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 16px !important;
}

/* Quantity wrapper — column layout for label + input */
body.single-product form.cart .quantity{
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 6px !important;
}

/* "Quantity:" label via pseudo-element */
body.single-product form.cart .quantity::before{
  content: "Quantity:";
  display: block;
  font-family: var(--sp-font) !important;
  font-size: 14px !important;
  font-weight: 510 !important;
  color: var(--sp-text) !important;
  line-height: 1 !important;
}

/* Quantity input styling */
body.single-product form.cart .quantity input.qty{
  width: 70px !important;
  padding: 8px 10px !important;
  font-size: 14px !important;
  font-family: var(--sp-font) !important;
  border: 1px solid var(--sp-line) !important;
  border-radius: 8px !important;
  color: var(--sp-text) !important;
  text-align: center !important;
}

/* "Add to Quote" button — full-width black button on own row */
body.single-product form.cart .single_add_to_cart_button{
  width: 100% !important;
  max-width: 320px !important;
  text-align: center !important;
  background: var(--sp-icon-bg) !important;
  color: var(--sp-icon-fg) !important;
  border: 1px solid var(--sp-line) !important;
  border-radius: 10px !important;
  padding: 12px 16px !important;
  font-family: var(--sp-font) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: opacity .18s ease !important;
  line-height: 1.2 !important;
}

body.single-product form.cart .single_add_to_cart_button:hover{
  opacity: 0.92 !important;
}

/* Hide RFQ helper elements */
body.single-product form.cart .gpls_script,
body.single-product form.cart .rfqcart-link-single,
body.single-product form.cart .rfqcart-link{
  display: none !important;
}

/* =========================================================
   S7) RELATED PRODUCTS — Match Equipment Grid Cards
   ========================================================= */

/* --- Section spacing — push related products further from main content --- */
body.single-product section.related.products,
body.single-product .related.products{
  margin-top: 64px !important;
  padding-top: 0 !important;
}

/* --- Section heading --- */
body.single-product .related.products > h2{
  font-family: var(--sp-font) !important;
  font-size: 20px !important;
  font-weight: 590 !important;
  line-height: 1.15 !important;
  letter-spacing: -0.01em !important;
  color: var(--sp-text) !important;
  margin: 0 0 18px 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  text-align: center !important;
}

/* --- Grid layout — smaller cards, centred --- */
body.single-product .related.products ul.products{
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 180px)) !important;
  justify-content: center !important;
  gap: 16px !important;
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* --- Card container --- */
body.single-product .related.products ul.products li.product{
  background: #fff !important;
  border: 1px solid var(--sp-line) !important;
  border-radius: var(--sp-radius) !important;
  padding: 12px !important;
  box-shadow: none !important;
  width: 100% !important;
  margin: 0 !important;
  float: none !important;

  display: flex !important;
  flex-direction: column !important;

  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}

body.single-product .related.products ul.products li.product:hover{
  box-shadow: var(--sp-shadow-soft) !important;
  transform: translateY(-2px);
  border-color: var(--sp-line-strong) !important;
}

/* --- Product link wrapper --- */
body.single-product .related.products ul.products li.product a.woocommerce-LoopProduct-link{
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  text-decoration: none !important;
  color: var(--sp-text) !important;
}

/* --- Product image: 1:1 aspect --- */
body.single-product .related.products ul.products li.product img{
  width: 100% !important;
  aspect-ratio: 1 / 1 !important;
  height: auto !important;
  object-fit: cover !important;
  background: var(--sp-tile-bg) !important;
  border-radius: var(--sp-tile-radius) !important;
  padding: 0 !important;
  margin: 0 0 10px 0 !important;
  display: block !important;
}

/* --- Product title --- */
body.single-product .related.products ul.products li.product .woocommerce-loop-product__title{
  font-family: var(--sp-font) !important;
  font-weight: 800 !important;
  font-size: 13px !important;
  line-height: 1.25 !important;
  margin: 0 0 6px 0 !important;
  padding: 0 !important;
  text-decoration: none !important;
  color: var(--sp-text) !important;
  background: transparent !important;
  border: none !important;

  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  overflow: hidden !important;
  min-height: 32px !important;
}

/* --- Hide category text on related cards --- */
body.single-product .related.products ul.products li.product .ast-woo-product-category,
body.single-product .related.products ul.products li.product .ast-woo-shop-product-category,
body.single-product .related.products ul.products li.product .product-category,
body.single-product .related.products ul.products li.product .woocommerce-loop-product__category{
  display: none !important;
}

/* --- Price bar (built by JS) --- */
body.single-product .related.products .sp-pricebar{
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  margin-top: auto !important;
  padding-top: 8px !important;
  border-top: 1px solid rgba(0,0,0,.06) !important;
  min-height: 42px !important;
}

/* Price text */
body.single-product .related.products .sp-pricebar .price{
  display: flex !important;
  align-items: baseline !important;
  gap: 6px !important;
  white-space: nowrap !important;
  font-weight: 800 !important;
  color: var(--sp-text) !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Force price amounts visible (RFQ plugin hides with visibility: collapse) */
body.single-product .related.products .sp-pricebar .price .woocommerce-Price-amount,
body.single-product .related.products .sp-pricebar .price bdi{
  visibility: visible !important;
}

/* "/day" unit text (inserted by JS) */
body.single-product .related.products .sp-pricebar .sp-unit-day{
  font-weight: 700 !important;
  font-size: 12px !important;
  color: var(--sp-muted) !important;
  opacity: 1 !important;
}

/* Cart icon button */
body.single-product .related.products .sp-pricebar a.sp-icon-btn{
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  visibility: visible !important;       /* RFQ plugin hides buttons globally */
  opacity: 1 !important;
  position: relative !important;        /* Astra sets position: absolute */
  flex: 0 0 auto !important;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  border-radius: 999px !important;
  background: var(--sp-icon-bg) !important;
  border: 1px solid var(--sp-line) !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 0 !important;
  overflow: hidden !important;
  font-size: 0 !important;
  text-decoration: none !important;
  transition: filter .18s ease !important;
  /* Reset Astra overlay transforms */
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  transform: none !important;
}

body.single-product .related.products .sp-pricebar a.sp-icon-btn:hover{
  filter: brightness(.95) !important;
}

body.single-product .related.products .sp-pricebar a.sp-icon-btn .sp-cart-svg{
  width: 17px !important;
  height: 17px !important;
  fill: var(--sp-icon-fg) !important;
  display: block !important;
}

/* Screen-reader only text */
body.single-product .related.products .sp-sr-only{
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Hide "View cart" link after AJAX add */
body.single-product .related.products ul.products li.product a.added_to_cart{
  display: none !important;
}

/* Hide any stray prices/buttons NOT inside pricebar (after JS moves them) */
body.single-product .related.products ul.products li.product > .price:not(.sp-pricebar .price),
body.single-product .related.products ul.products li.product a.woocommerce-LoopProduct-link > .price{
  display: none !important;
}

/* No underline anywhere on related product links */
body.single-product .related.products ul.products li.product a,
body.single-product .related.products ul.products li.product a:visited,
body.single-product .related.products ul.products li.product a:hover{
  text-decoration: none !important;
}

/* =========================================================
   S8) Hide product tabs + upsells ("You may also like")
   ========================================================= */

body.single-product .woocommerce-tabs{
  display: none !important;
  flex: 0 0 100% !important;
}

body.single-product .up-sells,
body.single-product section.up-sells,
body.single-product .upsells{
  display: none !important;
}

/* =========================================================
   S9) Responsive
   ========================================================= */

@media (max-width: 1280px){
  body.single-product .related.products ul.products{
    grid-template-columns: repeat(3, minmax(0, 180px)) !important;
  }
}

@media (max-width: 980px){
  body.single-product .related.products ul.products{
    grid-template-columns: repeat(2, minmax(0, 180px)) !important;
  }
}

@media (max-width: 640px){
  body.single-product div.product{
    gap: 24px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  body.single-product div.product .woocommerce-product-gallery{
    width: 100% !important;
    flex: 1 1 100% !important;
    max-width: 100% !important;
  }

  body.single-product .related.products ul.products{
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
  }

  body.single-product form.cart .single_add_to_cart_button{
    max-width: 100% !important;
  }
}
