/* SPACE CBD: polish 9 (polish 8 + calmer product page for first-time visitors). Load after spacecbd-fixes-2.css.
   One idea: the product photo is the hero of every card. Everything around it gets quieter.
   Live since 2026-11-04, linked in the Záhlaví after spacecbd-fixes-2.css. */

/* 1. Photo fills the card: square crop, no white bars, dark fill while loading */
.product .p .p-image {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #0a0d1a;
}
.product .p .p-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0a0d1a;
}
/* Old photos have white bars baked into the file; zoom crops them. New pack photos
   (file names contain "---", e.g. 45-3_blueberry-haze-cbd---cbd-kvety.jpg) are clean squares: no zoom.
   Remove this rule once every product uses a pack photo. */
.product .p .p-image img:not([src*="---"]) { transform: scale(1.12); }

/* 2. Labels: at most two, one row. Sale labels (Akce, Výprodej) always show and come first;
      Tip gives way first, then Novinka. */
.product .p .flags { flex-wrap: nowrap; gap: 4px; }
.product .p .flags .flag-action,
.product .p .flags .flag-custom1 { order: -1; }
.product .p .flags:has(.flag-action) .flag-tip,
.product .p .flags:has(.flag-custom1) .flag-tip { display: none !important; }
.product .p .flags:has(.flag-action):has(.flag-custom1) .flag-new { display: none !important; }

/* 3. Card text: name and price sit together, no empty gap */
.product .p .p-in {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 6px;
}
.product .p .p-in .p-name { min-height: 0; }
/* the star row renders empty (icon font has no glyph) and only adds a gap */
.product .p .p-in .stars-wrapper { display: none !important; }

/* 4. Hero button: steady, no pulsing */
.sc-hero .sc-btn-g { animation: none; }

/* 5. Trust bar: one line on desktop, swipeable on phones */
.trust-inner {
  flex-wrap: nowrap;
  justify-content: center;
  gap: 26px;
  overflow-x: auto;
  scrollbar-width: none;
}
.trust-inner::-webkit-scrollbar { display: none; }
.trust-inner .trust-item { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 900px) { .trust-inner { justify-content: flex-start; } }

/* 6. Product detail: photo on dark, not on a white box */
.p-detail .p-image-wrapper,
.p-detail .p-image,
.p-detail .p-thumbnails a { background: #0a0d1a; }

@media (prefers-reduced-motion: reduce) {
  .sc-hero *, .product * { animation: none !important; transition: none !important; }
}

/* 7. "Cena jen na e-shopu": every web price is lower than the store price (owner, 4. 11. 2026).
      Shown under the price on cards and on the product page; not on the photo, so labels stay at two. */
.product .p .prices::after,
.p-detail .p-final-price-wrapper::after {
  content: "Cena jen na e-shopu";
  display: block;
  width: max-content;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  color: #34d399;
  background: rgba(52, 211, 153, 0.12);
}

/* 8. Homepage banner (first block of the welcome text, Titulní strana) */
.sc2-eshop {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  margin: 0 0 24px;
  padding: 18px 22px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(52, 211, 153, 0.14), rgba(124, 107, 245, 0.12));
}
.sc2-eshop strong { display: block; font-size: 20px; line-height: 1.3; color: #fff; }
.sc2-eshop p { margin: 4px 0 0; font-size: 14px; color: rgba(255, 255, 255, 0.75); }
.sc2-eshop a {
  flex: 0 0 auto;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  color: #0f0b1f;
  background: #34d399;
}
.sc2-eshop a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* 9. Category grid: 3 wider columns instead of 4 narrow ones (the sidebar leaves ~640 px).
      The skin forces 4 columns with !important on "body .products-block", so this needs both. */
body .products.products-page.products-block {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)) !important;
  gap: 16px;
}
/* empty bottom area under price on cards without buttons */
.product .p .p-bottom.no-buttons:empty,
.product .p .p-bottom.no-buttons { min-height: 0; padding: 0; }
.product .p .p-in { padding-bottom: 14px; }

/* 10. Label under the price: never cut off */
.product .p .prices::after { max-width: 100%; white-space: normal; }

/* 11. New studio photos (white background, file names with "---"): zoom so the product
       fills the square instead of a wide white margin */
.product .p .p-image img[src*="---cbd-kvety"] { transform: scale(1.32); }
.product .p .p-image img[src*="---doplnky"] { transform: scale(1.12); }
.product .p .p-image { background: #fff; }
.product .p .p-image:has(img:not([src*="---"])) { background: #0a0d1a; }

/* 12. New products stand out: green outline and soft glow on cards with the "Novinka" label */
.product .p:has(.flags .flag-new) {
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.35), 0 10px 32px rgba(52, 211, 153, 0.14);
}

/* 13. Sidebar "TOP 10 produktů": Shoptet keeps hidden products (THC-X) in it, and the links
       lead nowhere. Hidden until the list refreshes. */
.sidebar .box-topProducts { display: none; }

/* 14. The top box of a category follows the category order (newest first since 4. 11. 2026),
       so the heading "Nejprodávanější" would be untrue. Show "Novinky" instead. */
#productsTopHeading { font-size: 0; }
#productsTopHeading::before { content: "Novinky"; font-size: 22px; }

@media (max-width: 767px) {
  body .products.products-page.products-block { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
}

/* 15. Cards lead to buying.
   a) The whole card opens the product (before: only the small photo and the name). The name link
      gets an invisible layer over the card; real buttons stay clickable above it. */
.product .p { position: relative; }
.product .p .p-name::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.product .p .btn,
.product .p button,
.product .p form,
.product .p .p-tools { position: relative; z-index: 2; }
.product .p .p-name:focus-visible { outline: 2px solid #34d399; outline-offset: 3px; }

/* b) The card's own bottom bar (availability + "Detail" / "Do košíku") was absolutely positioned and
      popped up over the product name on hover. Put it in normal flow, always visible, as a
      full-width button under the price. "Detail" (products with packs) reads "Vybrat balení". */
.product .p .p-bottom {
  position: static !important;
  inset: auto !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  flex-direction: column !important;
  align-items: stretch !important;
  margin-top: 10px;
  padding: 0;
  background: none !important;
}
.product .p,
.product .p .p-in { height: auto !important; }
.product .p .p-bottom .p-tools { display: flex !important; flex-direction: column; gap: 8px; width: 100%; }
.product .p .p-bottom .p-tools form { display: block; width: 100%; }
/* one-pack products: the card adds 1 piece straight to the cart; no quantity box, no second button */
.product .p .p-tools .quantity { display: none !important; }
.product .p .p-tools:has(form button) a.btn { display: none !important; }
/* button sits at the bottom of the card, cards in a row line up */
.product .p { display: flex; flex-direction: column; }
.product .p .p-in { flex: 1; display: flex; flex-direction: column; }
.product .p .p-in .p-bottom { margin-top: auto !important; padding-top: 10px; }
.product .p .p-bottom .btn {
  display: block;
  width: 100% !important;
  padding: 9px 12px;
  border: 0;
  border-radius: 999px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #0f0b1f !important;
  background: #34d399 !important;
  background-image: none !important;
}
.product .p .p-bottom a.btn { font-size: 0; }
.product .p .p-bottom a.btn::after { content: "Vybrat balení"; font-size: 13px; }
.product .p .p-bottom .show-tooltip { display: block; margin-bottom: 2px; font-size: 12px; text-transform: none; letter-spacing: 0; color: #34d399; }

/* c) Hover: the card lifts and the photo zooms a little more (pointer devices only) */
@media (hover: hover) {
  .product .p { transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease; }
  .product .p:hover {
    transform: translateY(-4px);
    border-color: rgba(52, 211, 153, 0.7);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(52, 211, 153, 0.35);
  }
  .product .p:hover .p-image img { transform: scale(1.06); }
  .product .p:hover .p-image img:not([src*="---"]) { transform: scale(1.18); }
  .product .p:hover .p-image img[src*="---cbd-kvety"] { transform: scale(1.38); }
  .product .p:hover .p-image img[src*="---doplnky"] { transform: scale(1.18); }
  .product .p:hover .p-bottom .btn { background: #5eead4 !important; }
}
@media (prefers-reduced-motion: reduce) {
  .product .p, .product .p:hover { transform: none; transition: none; }
}

/* 16. Trust bar: with longer texts the centred row overflowed to the left and cut the first item.
       "safe center" centres only when it fits, otherwise starts at the left edge (still swipeable). */
.trust-inner { justify-content: safe center !important; }

/* 17. Homepage: products with the "Novinka" label come first in the product grid.
       Visual order only; the Shoptet list ("Doporučujeme" + auto-fill from CBD Květy, newest) is unchanged. */
body.type-index .products .product:has(.flags .flag-new) { order: -1; }

/* 18. Product page for first-time visitors (most arrive straight from Google / Heureka / Zboží).
   One focus: photo + pack choice + button. Everything that doesn't help them buy gets quieter. */

/* a) No sidebar on the product page: the photo and buy box get the full width */
body.type-detail aside.sidebar { display: none !important; }
body.type-detail #content.narrow { width: 100% !important; max-width: none !important; }

/* b) Empty rating on products nobody has rated yet ("☆☆☆☆☆ Neohodnoceno") reads as a bad sign: hide it.
      Products with real ratings (at least one .star-on) keep it. */
body.type-detail .p-detail .stars-wrapper:not(:has(.star-on)) { display: none !important; }

/* c) Print and share buttons: no help for buying */
body.type-detail .p-info-wrapper .link-icon.print,
body.type-detail .p-detail .social-icons.share { display: none !important; }

/* d) Parameters: the category is already in the breadcrumb */
body.type-detail .detail-parameters tr:first-child:has(a[href*="cbd"]) { display: none; }
body.type-detail .detail-parameters th,
body.type-detail .detail-parameters td { padding: 4px 0; vertical-align: top; }
body.type-detail .detail-parameters th { width: 42%; padding-right: 12px; color: rgba(255, 255, 255, 0.65); font-weight: 500; }

/* e) Description tabs: the active tab was dark grey on dark blue */
body.type-detail .shp-tab-link { color: rgba(255, 255, 255, 0.6) !important; }
body.type-detail .shp-tab.active .shp-tab-link { color: #fff !important; }

/* f) Four packs as a 2 × 2 grid (was 3 + 1, which left the best-value 10 g pack alone on a row) */
body.type-detail .sc-pack__grid:has(> .sc-pack__opt:nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }

/* ===== §19 Site check 6. 11. 2026 (polish-10) ===== */
/* Hero title is now the homepage <h1> (cosmos_17): drop browser h1 defaults, keep the skin look */
h1.sc-hero-title { margin-top: 0; padding: 0; text-transform: none; }
/* Banner button in the "levněji na e-shopu" strip: dark text on the green pill (was ~1.1:1 contrast) */
.sc2-eshop a { color: #0f0b1f !important; text-decoration: none; }
/* Trust bar under the hero: wrap instead of cutting the last item off */
.trust-inner { flex-wrap: wrap !important; overflow-x: visible !important; justify-content: center !important; row-gap: 8px; }
/* Blog price table: cell spacing */
.news-item-detail table th, .news-item-detail table td,
.news-item table th, .news-item table td { padding: 4px 14px 4px 0; text-align: left; }
/* Product description panel: text no longer touches the panel edge */
body.type-detail .tab-pane { padding: 16px 20px; }
/* Links in category texts are visible as links */
.category__secondDescription a { color: #34d399; text-decoration: underline; }

/* ===== §20 Checkout: košík + doprava a platba (polish-11, 6. 11. 2026) =====
   A calm, readable checkout: one primary action (green = moves toward payment), the rest quiet.
   Every rule was tested on /kosik/ and /objednavka/krok-1/ before release. */

/* Step bar: Shoptet paints inactive step labels and circles white, with light text on top */
.cart-header .step strong { background: transparent !important; color: rgba(241, 238, 255, 0.5) !important; }
.cart-header .step.active strong, .cart-header .step.completed strong { color: #f1eeff !important; }
html body ol.cart-header li.step a, html body ol.cart-header li.step a:hover { background: transparent !important; color: #c5b7ff !important; box-shadow: none !important; }
html body ol.cart-header li.step a span { color: inherit !important; }
html body ol.cart-header li.step:not(.active):not(.completed) span::before { background: #0a0e1e !important; color: rgba(241, 238, 255, 0.8) !important; border-color: rgba(241, 238, 255, 0.45) !important; }

/* Cart row: product name and pack were near-black (#1f1f1f) on the dark row */
.cart-table .p-name a.main-link, .cart-table .p-name a.main-link span { color: #f1eeff !important; }
.cart-table .p-name .main-link-variant { color: rgba(241, 238, 255, 0.72) !important; font-weight: 500; }

/* One primary action on every step: green, dark text (white on green fails contrast), sentence case */
html body .next-step .btn.next-step-forward { background: linear-gradient(135deg, #059669, #22c55e) !important; border: 0 !important; }
html body .next-step .btn.next-step-forward, html body .next-step .btn.next-step-forward * { color: #04140b !important; text-transform: none !important; letter-spacing: 0 !important; font-weight: 800 !important; }
/* Back is a quiet outline, not a second purple pill */
html body .next-step .btn.next-step-back { background: transparent !important; background-image: none !important; box-shadow: none !important; border: 1px solid rgba(241, 238, 255, 0.28) !important; }
html body .next-step .btn.next-step-back, html body .next-step .btn.next-step-back * { color: rgba(241, 238, 255, 0.85) !important; text-transform: none !important; font-weight: 600 !important; }
html body .next-step .btn.next-step-back:hover { border-color: rgba(241, 238, 255, 0.6) !important; }
html body .next-step .btn:focus-visible { outline: 2px solid #fff !important; outline-offset: 3px; }

/* Help box: still there, no longer louder than the buy button */
html body .checkout-box .toggle-contacts { background: transparent !important; background-image: none !important; box-shadow: none !important; border: 1px solid rgba(197, 183, 255, 0.35) !important; color: #c5b7ff !important; }

/* Total to pay: the box was cut off at the bottom */
body.ordering-process .order-summary-item.price { height: auto !important; min-height: 56px; padding-top: 12px !important; padding-bottom: 12px !important; overflow: visible !important; }

/* Payment option not available with the chosen delivery: visibly unavailable */
body.ordering-process .radio-wrapper.inactive-child { opacity: 0.45; }

/* Quieter star background while paying */
body.ordering-process > canvas, body.in-kosik > canvas { opacity: 0.35 !important; }

/* The floating WhatsApp button covered "Pokračovat" and the totals up to tablet width; the phone help box stays */
@media (max-width: 1024px) {
  body.ordering-process .wa-btn, body.in-kosik .wa-btn { display: none !important; }
}

/* Pack ladder in the cart (spacecbd-cart-1.js) */
.sc-ladder { margin: 10px 0 2px; padding: 10px 12px; border-radius: 12px; background: rgba(52, 211, 153, 0.08); border: 1px solid rgba(52, 211, 153, 0.28); color: #f1eeff; font-size: 14px; line-height: 1.45; }
.sc-ladder__packs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; padding: 0; list-style: none; }
.sc-ladder__packs li { padding: 3px 9px; border-radius: 999px; background: rgba(241, 238, 255, 0.07); color: rgba(241, 238, 255, 0.75); font-size: 13px; font-variant-numeric: tabular-nums; }
.sc-ladder__packs li.is-current { background: rgba(241, 238, 255, 0.18); color: #fff; }
.sc-ladder__packs li.is-best { background: #34d399; color: #04140b; font-weight: 700; }
.sc-ladder__tip { margin: 0; }
.sc-ladder__tip a { color: #34d399; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.cart-table tr.sc-ladder-row td { padding-top: 0 !important; border-top: 0 !important; }

/* ===== §21 Mobile category + sidebar (polish-12, 7. 11. 2026) ===== */
/* Phone: the category intro box was 944 px tall, so the first product started ~1.5 screens down.
   Keep badge, title, lead and buttons; drop the fact list and the side panel (the same facts are in the
   category text below the products). Measured at 400 px: intro 944 → 402 px, first products 1212 → 670 px. */
@media (max-width: 768px) {
  .sc-category-seo-hero .sc-category-points,
  .sc-category-seo-hero .sc-category-side { display: none !important; }
  .sc-category-seo-hero .sc-category-seo-grid { gap: 12px !important; }
}
/* Instagram sidebar block: no account is connected, so it rendered as an empty box on every page */
.box-instagram { display: none !important; }
