/* ProCart BD v1.5.7 — final-check fixes (28 Nov 2026)
   1. WooCommerce placeholder IMAGES in dark mode: the live product page and
      cart use an actual <img> (woocommerce-placeholder.png, near-white), so
      the v1.5.6 container rules could not darken it. Invert just that image.
   2. Vendor hero illustration in dark mode: dim the artwork itself.
   3. Checkout modal: undo the v1.5.6 sticky summary/submit (it overlapped
      form fields); the modal scrolls and the totals sit at the end.
   4. Search-results eyebrow pill contrast in dark mode. */

/* 1. Placeholder images, dark mode only */
html[data-pc-theme="dark"] img[src*="woocommerce-placeholder"],
html[data-pc-theme="dark"] img[src*="placeholder.png"] {
  filter: invert(.9) hue-rotate(180deg) saturate(.35) brightness(.95) !important;
  background: #243044 !important;
}
html[data-pc-theme="dark"] .pc-skybuy-main-image-wrap,
html[data-pc-theme="dark"] .pc-skybuy-main-image,
html[data-pc-theme="dark"] .woocommerce-product-gallery__image {
  background: #243044 !important;
  border-color: #3b4963 !important;
}

/* 2. Vendor hero art, dark mode only */
html[data-pc-theme="dark"] .pc-shop-hero-art svg {
  filter: brightness(.82) saturate(.85) contrast(1.05);
  border-radius: 14px;
}

/* 3. Checkout / quick-order modal: no sticky overlap (both modes) */
.pc-modal .pc-order-summary,
.pc114-dialog .pc114-total,
.pc-modal .pc-modal-submit,
.pc114-dialog .pc114-submit {
  position: static !important;
}
.pc-modal,
.pc114-dialog {
  max-height: calc(100dvh - 32px) !important;
  overflow-y: auto !important;
  padding-bottom: 20px !important;
}

/* 4. Eyebrow pills in dark mode */
html[data-pc-theme="dark"] .pc-eyebrow {
  background: #263650 !important;
  color: #b5cbff !important;
}

/* v1.6.5 — tablet band: five flow steps and the shop hero get room to
   breathe between phone and desktop widths. */
@media (min-width:700px) and (max-width:1100px) {
  .pc-flow-steps { grid-template-columns: repeat(3, minmax(0,1fr)) !important; }
  body.pc-open-shop-page .pc-shop-hero { padding: 26px !important; gap: 22px !important; }
  body.pc-open-shop-page .pc-shop-hero-art { max-width: 320px; margin: 0 auto; }
}

/* v1.6.7 — the discount badge moves from the title row to the price:
   desktop keeps it inline after the price; on mobile it drops to its
   own line directly under the price. The title gets the full row. */
.pc-card .pc-card-price { display: flex !important; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.pc-card .pc-card-price .pc120-sale { margin: 0 !important; }
@media (max-width: 699px) {
  .pc-card .pc-card-price .pc120-sale { flex: 0 0 100%; width: fit-content; margin-top: 2px !important; }
}

/* v1.6.8 — force the price row horizontal on desktop (an older rule kept
   it column-stacked): del price, sale price and badge share one line. */
.pc-card .pc-card-price { flex-direction: row !important; }
.pc-card .pc-card-price del, .pc-card .pc-card-price strong { flex: 0 0 auto; }

/* v1.6.9 — desktop buy-row restructure: the price block gets its own
   full-width line (old price + sale price + badge side by side) and the
   action buttons move to the line below. Before, price and buttons
   shared one row, leaving the price too narrow to sit on one line. */
@media (min-width: 700px) {
  .pc-card .pc134-buy-row { display: flex !important; flex-wrap: wrap !important; row-gap: 8px; }
  .pc-card .pc-card-price { flex: 1 1 100% !important; }
  .pc-card .pc134-card-actions { flex: 1 1 100%; display: flex; justify-content: flex-start; gap: 8px; }
}

/* v1.7.0 — owner correction: the -30% badge STAYS up beside the title in
   every view (the v1.6.7-1.6.9 price-line moves are reverted). On mobile
   the price takes its own row, right-aligned; the badge does not move. */
.pc-card .pc-card-price { display: block !important; }
@media (min-width: 700px) {
  .pc-card .pc134-buy-row { flex-wrap: nowrap !important; }
  .pc-card .pc-card-price { flex: 0 1 auto !important; }
  .pc-card .pc134-card-actions { flex: 0 1 auto !important; justify-content: flex-end; }
}
@media (max-width: 699px) {
  .pc-card .pc134-buy-row { flex-wrap: wrap !important; }
  .pc-card .pc-card-price { flex: 1 1 100% !important; text-align: right !important; }
  .pc-card .pc-card-price del, .pc-card .pc-card-price strong { display: inline-block; }
}

/* v1.7.3 — Style A (owner-approved): the price takes one full-width line —
   old price + sale price on the left, the -30% badge at the FAR RIGHT of
   the same line; Order / Add to cart buttons side by side, equal width,
   on the line below. Applies to all view widths. */
.pc-card .pc134-buy-row { display: flex !important; flex-wrap: wrap !important; row-gap: 8px; }
.pc-card .pc-card-price { display: flex !important; align-items: center; gap: 8px; flex: 1 1 100% !important; text-align: left !important; }
.pc-card .pc-card-price .pc120-sale { margin-left: auto; }
.pc-card .pc134-card-actions { display: flex !important; flex-direction: row !important; flex: 1 1 100% !important; gap: 8px; }
.pc-card .pc134-card-actions .pc134-card-action { flex: 1 1 0; justify-content: center; text-align: center; }

/* v1.7.4 — the v1.6.7 block above sets margin:0 !important on the badge,
   which silently defeated the v1.7.3 auto margin. Same specificity,
   later in the file, with !important: the badge now truly goes right. */
.pc-card .pc-card-price .pc120-sale { margin-left: auto !important; }

/* v1.7.5 — product photos fill their frames (owner: no empty bands).
   PDP: the stage now hugs the photo's own ratio instead of forcing a
   square stage with contain-fit (which left dark bands above/below).
   Cards + homepage showcase: images cover the square frame edge-to-edge. */
.pc-pdp .pc-pdp-stage.has-real-image { aspect-ratio: auto !important; height: auto !important; padding: 0 !important; display: block !important; }
.pc-pdp .pc-pdp-main-image { width: 100% !important; height: auto !important; max-height: none !important; object-fit: initial !important; display: block; }
.pc-card .pc-card-media { padding: 0 !important; }
.pc-card .pc-card-media img { width: 100% !important; height: 100% !important; object-fit: cover !important; display: block; }
.pc-tv-media img { width: 100% !important; height: 100% !important; object-fit: cover !important; display: block; }

/* v1.7.6 — rating stars golden everywhere (owner request): filled stars
   bright gold, the empty track a soft gold instead of grey. */
.star-rating { color: #f5a623 !important; }
.star-rating span::before { color: #f5a623 !important; }
.star-rating::before { color: #eed9a0 !important; }
p.stars a, p.stars a::before { color: #f5a623 !important; }

/* v1.7.8 — mobile homepage: tighten the empty band below the category
   cards (owner: too much padding at the bottom on mobile). Desktop keeps
   its own spacing (min-width:821px rules elsewhere). */
@media (max-width: 820px) {
  .pc-home .pc-cat-section { margin-bottom: 8px !important; }
  .pc-home .pc141-category-list { padding-bottom: 2px !important; }
  body.procart-home .pc132-vendor-section { padding-top: 12px !important; padding-bottom: 18px !important; }
}

/* v1.7.9 — mobile + tablet pass (owner: fix mobile/tablet view on all pages,
   and the main product photo must always stay on the product page).
   1) Card action buttons get the readable desktop styling at EVERY width
      (before, phones only inherited bare link colours — the cart link was
      nearly invisible on dark cards). */
.pc-card .pc134-card-action { display: inline-flex !important; align-items: center; justify-content: center; gap: 4px; min-height: 34px; padding: 6px 8px; border: 1px solid #4770e3; border-radius: 8px; background: #245fe7; color: #fff !important; font-size: 12px; font-weight: 700; white-space: nowrap; text-decoration: none !important; }
.pc-card .pc134-card-cart { background: #eaf0ff; color: #2347ae !important; border-color: #c4d2fb; }
html[data-pc-theme="dark"] .pc-card .pc134-card-cart { background: #233352; color: #d8e6ff !important; border-color: #475e91; }
/* 2) Homepage phone cards: the Order button returns (the old v1.4.4 rule hid
      it under 700px; the owner's approved Style A card has both buttons),
      and card photos fill their frame (cover) instead of letterboxing. */
@media (max-width: 699px) {
  .pc-home .pc141-category-list .pc-card .pc134-card-order { display: inline-flex !important; }
  .pc-home .pc141-category-list .pc-card .pc-card-media img { object-fit: cover !important; }
}
/* 3) Product page: the main photo can never collapse or be hidden — the
      stage always reserves its frame while the photo loads. */
.pc-pdp .pc-pdp-stage.has-real-image { min-height: 260px; }
.pc-pdp .pc-pdp-main-image { display: block !important; visibility: visible !important; opacity: 1 !important; }
@media (max-width: 820px) {
  .pc-pdp .pc-pdp-stage.has-real-image { min-height: 240px; }
  /* 4) Homepage phone spacing, trimmed a little further (owner round 2). */
  .pc-home .pc-cat-section { margin-bottom: 6px !important; }
  .pc-home .pc141-category-list { padding-bottom: 0 !important; }
  body.procart-home .pc132-vendor-section { padding-top: 6px !important; }
}

/* v1.7.10 — shop page tidy-up (owner: "shop page fix koro").
   1) The old on-image blue order bar (v1.3.1 design) is retired everywhere:
      cards now carry proper Order + Cart buttons below the price, so the
      bar only duplicated them and covered the bottom of every photo.
   2) Shop/vendor header on phones: a tighter stack so the first product
      starts sooner. */
.pc-card .pc-card-order-img { display: none !important; }
@media (max-width: 820px) {
  body.woocommerce-shop .pc-catalog .pc-catalog-topbar .pc-back-btn-catalog { height: 44px !important; min-height: 44px !important; }
  body.woocommerce-shop .pc-catalog-title { font-size: 24px !important; line-height: 1.25 !important; }
  body.woocommerce-shop .pc-catalog-head { margin-bottom: 10px !important; gap: 10px !important; }
  body.woocommerce-shop .pc-catalog-count { margin-top: 4px !important; }
}

/* v1.7.11 — card buttons must never spill out of the card (owner screenshot:
   EN "Add to cart" on a half-width phone card overflowed the card edge).
   Let the buttons shrink below their label width and wrap the label, and
   run them slightly smaller on narrow phones. */
.pc-card .pc134-card-actions { min-width: 0 !important; }
.pc-card .pc134-card-actions .pc134-card-action { min-width: 0 !important; white-space: normal !important; line-height: 1.15 !important; }
.pc-card .pc134-card-actions .pc134-card-action span { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .pc-card .pc134-card-actions { gap: 6px !important; }
  .pc-card .pc134-card-actions .pc134-card-action { font-size: 11px !important; padding: 6px 4px !important; gap: 3px !important; }
}

/* v1.7.12 — gallery strip shows at most 4 thumbnails at a time, on phones
   and desktops alike (owner). The rest are reached with the arrow buttons
   under the strip (wired by the PDP script) or by swiping/scrolling. */
.pc-pdp-page .pc-pdp .pc-pdp-thumbnails { flex-wrap: nowrap !important; overflow-x: auto !important; overflow-y: hidden !important; padding: 4px 0 10px !important; }
.pc-pdp-page .pc-pdp .pc-pdp-thumbnails .pc-thumb-item { flex: 0 0 calc((100% - 24px) / 4) !important; width: calc((100% - 24px) / 4) !important; }

/* v1.7.14 — no arrows on the main photo (owner). The strip arrows sit ON
   the thumbnail strip itself (left/right edges) and appear only when the
   product has more than 4 photos; they scroll the strip. */
.pc-pdp .pc-pdp-stripwrap { position: relative; }
.pc-pdp .pc-strip-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 6; width: 32px; height: 32px; padding: 0; border-radius: 50%; border: 1px solid rgba(25, 36, 80, .14); background: rgba(255, 255, 255, .94); color: #192450; font-size: 19px; line-height: 1; display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 12px rgba(15, 23, 42, .20); }
.pc-pdp .pc-strip-arrow-prev { left: 4px; }
.pc-pdp .pc-strip-arrow-next { right: 4px; }
html[data-pc-theme="dark"] .pc-pdp .pc-strip-arrow { background: rgba(18, 24, 46, .92); color: #e6ecff; border-color: rgba(255, 255, 255, .28); }

/* v1.7.16 — desktop PDP balance (owner: empty space under the gallery).
   The summary column is taller than the gallery column, which left a void
   under the thumbnails. The gallery takes a wider share (a taller stage
   and larger thumbnails) and the summary runs slightly tighter, so the
   two columns end much closer together. */
@media (min-width: 901px) {
  .pc-pdp .pc-pdp-hero { grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr) !important; }
  .pc-pdp .pc-pdp-summary { gap: 10px !important; padding: 18px !important; }
}
