/*!
 * Valgusallikad theme — 13-card-and-popup-fix.css
 *
 * Hotfixes for v2.0.8 / v2.0.9:
 *
 * 1) Product cards on the home "Värskelt poodi jõudnud..." and
 *    "Populaarsed tooted" sections — unify the orange "Lisa korvi"
 *    button visually with the white card (no visible gap, no
 *    overhang past the rounded corners).
 *
 * 2) Defensive: hide the popup CTA button if its href is "#" or
 *    empty, even if the rendered HTML was cached before v2.0.7's
 *    footer.php fix took effect on a particular install.
 *
 * 3) Plugin v1.1.6/7 — dropdown filtering kept failing due to a
 *    same-specificity rule from 07-design-v18 that kept hidden items
 *    visible. The plugin now also writes inline `display:none`, but
 *    we add a belt-and-braces CSS rule here too.
 *
 * 4) v2.0.9 — global horizontal overflow guard. Some 3rd-party
 *    plugin (cookie banner, multilingual switcher, popup, etc.) was
 *    introducing off-canvas elements that pushed the body wider than
 *    the viewport, making the entire home page (including the
 *    "Värskelt poodi jõudnud" section) appear cut off on the right.
 */

/* ===== 4. GLOBAL HORIZONTAL OVERFLOW GUARD (v2.0.9) ===== */
html, body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
}

/* Container should never exceed the viewport, regardless of the
 * --vlg-container CSS variable. (Earlier hotfix only enforced this
 * under 980px; on a 1280px screen with --vlg-container:1320px the
 * container did overflow by ~40px.) */
.vlg-container,
body.woocommerce .woocommerce,
body.woocommerce-page .woocommerce,
.vlg-main-header-inner,
.vlg-topbar-inner,
.vlg-nav-inner,
.vlg-footer-inner,
.vlg-footer-bottom {
  width: min(100% - 24px, var(--vlg-container, 1320px)) !important;
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

/* Latest showcase wrapper: keep it inside the page bounds. */
.vlg-latest-showcase,
.vlg-home-product-section,
.vlg-section {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* ===== 1. Unified product card on home ===== */

.vlg-latest-showcase .vlg-product-card,
.vlg-home-product-section .vlg-product-card {
  /* Defensive: keep the orange button strictly inside the rounded card. */
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  background: #fff !important;
}

.vlg-latest-showcase .vlg-product-card .vlg-product-link,
.vlg-home-product-section .vlg-product-card .vlg-product-link {
  /* Image+title+price area should fill until the action bar. */
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
}

.vlg-latest-showcase .vlg-product-card .vlg-card-content,
.vlg-home-product-section .vlg-product-card .vlg-card-content {
  /* Push the price down so the actions sit flush. */
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  padding-bottom: 12px !important;
}

.vlg-latest-showcase .vlg-product-card .vlg-card-actions,
.vlg-home-product-section .vlg-product-card .vlg-card-actions {
  /* Visually attach the actions to the card with a soft top border. */
  margin-top: 0 !important;
  padding: 12px 14px 14px !important;
  background: #fff !important;
  border-top: 1px solid rgba(17, 32, 55, .06) !important;
  position: relative !important;
  z-index: 1 !important;
}

.vlg-latest-showcase .vlg-product-card .vlg-card-actions .button,
.vlg-latest-showcase .vlg-product-card .vlg-card-actions .vlg-card-cart,
.vlg-home-product-section .vlg-product-card .vlg-card-actions .button,
.vlg-home-product-section .vlg-product-card .vlg-card-actions .vlg-card-cart {
  /* Slightly tighter button so it doesn't visually dominate the card. */
  min-height: 40px !important;
  padding: 10px 14px !important;
  font-size: 0.9rem !important;
  border-radius: 10px !important;
  /* Lift the button shadow off slightly so it looks "in" the card. */
  box-shadow: 0 2px 6px rgba(242, 138, 0, .14) !important;
}

/* Tighten the price row so the gap above the action bar is small. */
.vlg-latest-showcase .vlg-product-card .vlg-card-price,
.vlg-home-product-section .vlg-product-card .vlg-card-price {
  margin-top: auto !important;
  padding-top: 6px !important;
}

/* ===== 2. Defensive popup CTA hide for stale-cached pages ===== */

/* Hide popup primary CTA when href is empty, "#", or just whitespace.
 * footer.php was fixed in v2.0.7 to not render this button at all when
 * the URL is empty, but if WP page cache still serves a pre-fix HTML,
 * this CSS makes the dead button disappear anyway. */
.vlg-popup-cta[href="#"],
.vlg-popup-cta[href=""],
.vlg-popup-cta:not([href]) {
  display: none !important;
}

/* ===== 3. Plugin shipping selector — defensive hide ===== */

/* The plugin now also sets inline display:none, but if some cache or
 * lightweight subtheme strips inline styles, this CSS still wins. */
body.fs-checkout-designer-active ul#shipping_method li.fs-hidden-by-provider,
body.fs-checkout-designer-active .fs-shipping-methods-wrap ul#shipping_method li.fs-hidden-by-provider,
body.fs-checkout-designer-active .fs-shipping-column ul#shipping_method li.fs-hidden-by-provider {
  display: none !important;
}

/* The new "Kõik tarneviisid" option label needs no special styling —
 * it inherits the dropdown style. But pad the dropdown a touch more so
 * the longer label doesn't crowd the chevron. */
body.fs-checkout-designer-active .fs-shipping-provider-select {
  padding-right: 36px !important;
}


/* ============================================================
 * v2.1.1 — home latest-product button containment
 * Fixes the orange "Lisa korvi" button visually hanging outside the
 * Värskelt poodi jõudnud… card/section on wide desktop layouts.
 * ============================================================ */
.vlg-latest-showcase {
  overflow: hidden !important;
  padding-bottom: 34px !important;
}

.vlg-latest-showcase__grid,
.vlg-latest-showcase .vlg-products-grid {
  align-items: stretch !important;
  padding-bottom: 0 !important;
  overflow: visible !important;
}

.vlg-latest-showcase .vlg-product-card,
.vlg-latest-showcase ul.products li.product.vlg-product-card {
  height: 100% !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  padding-bottom: 0 !important;
}

.vlg-latest-showcase .vlg-product-card .vlg-product-link {
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

.vlg-latest-showcase .vlg-product-card .vlg-card-content {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  padding-bottom: 10px !important;
}

.vlg-latest-showcase .vlg-product-card .vlg-card-actions,
.vlg-latest-showcase ul.products li.product.vlg-product-card .vlg-card-actions {
  position: static !important;
  inset: auto !important;
  z-index: 2 !important;
  width: 100% !important;
  min-height: auto !important;
  margin: 0 !important;
  transform: none !important;
  padding: 12px 14px 16px !important;
  background: #fff !important;
  border-top: 1px solid rgba(17, 32, 55, .07) !important;
  box-shadow: none !important;
}

.vlg-latest-showcase .vlg-product-card .vlg-card-actions .button,
.vlg-latest-showcase .vlg-product-card .vlg-card-actions .vlg-card-cart {
  position: static !important;
  width: 100% !important;
  min-height: 42px !important;
  margin: 0 !important;
  transform: none !important;
  border-radius: 12px !important;
  box-shadow: 0 6px 14px rgba(242, 138, 0, .16) !important;
}

.vlg-latest-showcase .vlg-product-card .vlg-card-actions .button:hover,
.vlg-latest-showcase .vlg-product-card .vlg-card-actions .vlg-card-cart:hover {
  transform: translateY(-1px) !important;
}

@media (max-width: 620px) {
  .vlg-latest-showcase {
    padding-bottom: 22px !important;
  }

  .vlg-latest-showcase .vlg-product-card .vlg-card-actions,
  .vlg-latest-showcase ul.products li.product.vlg-product-card .vlg-card-actions {
    padding: 10px 12px 14px !important;
  }
}

/* ============================================================
 * v2.1.2 — cart notice, SEO/EU helper UI and hero preset admin
 * ============================================================ */
.woocommerce-cart .woocommerce-notices-wrapper,
.woocommerce-page .woocommerce-notices-wrapper {
  position: relative !important;
  z-index: 2 !important;
}

.woocommerce-cart .woocommerce-notices-wrapper::before,
.woocommerce-cart .woocommerce-notices-wrapper::after,
.woocommerce-cart .woocommerce-message::after,
.woocommerce-cart .woocommerce-info::after,
.woocommerce-cart .woocommerce-error::after {
  content: none !important;
  display: none !important;
}

.woocommerce-cart .woocommerce-notices-wrapper .blockUI,
.woocommerce-cart .woocommerce-notices-wrapper .blockOverlay,
.woocommerce-cart .woocommerce-message .blockUI,
.woocommerce-cart .woocommerce-message .blockOverlay {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

.woocommerce-cart .woocommerce-message,
.woocommerce-cart .woocommerce-info,
.woocommerce-cart .woocommerce-error {
  position: relative !important;
  min-height: 54px !important;
  padding: 15px 18px 15px 54px !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  overflow: hidden !important;
}

.woocommerce-cart .woocommerce-message::before,
.woocommerce-cart .woocommerce-info::before,
.woocommerce-cart .woocommerce-error::before {
  content: "✓" !important;
  font-family: inherit !important;
  speak: never !important;
  position: absolute !important;
  left: 18px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 25px !important;
  height: 25px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 999px !important;
  background: #83b51b !important;
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  box-shadow: 0 6px 14px rgba(131,181,27,.18) !important;
}

.woocommerce-cart .woocommerce-info::before { content: "i" !important; background: #3b82f6 !important; }
.woocommerce-cart .woocommerce-error::before { content: "!" !important; background: #ef4444 !important; }

.woocommerce-cart .woocommerce-message a.restore-item,
.woocommerce-cart .woocommerce-message .button.wc-forward {
  margin-left: 4px !important;
  color: var(--vlg-primary) !important;
  font-weight: 900 !important;
  text-decoration: none !important;
}

.vlg-hero-preset-field > span {
  display: block !important;
  font-weight: 900 !important;
  margin-bottom: 8px !important;
}

.vlg-hero-preset-grid {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(120px, 1fr)) !important;
  gap: 10px !important;
}

.vlg-hero-preset-card {
  display: grid !important;
  gap: 8px !important;
  padding: 9px !important;
  border: 1px solid #d8e1ee !important;
  border-radius: 14px !important;
  background: #fff !important;
  cursor: pointer !important;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease !important;
}

.vlg-hero-preset-card:hover,
.vlg-hero-preset-card.is-selected,
.vlg-hero-preset-card:has(input:checked) {
  border-color: var(--vlg-primary, #f28a00) !important;
  box-shadow: 0 10px 24px rgba(242,138,0,.12) !important;
  transform: translateY(-1px) !important;
}

.vlg-hero-preset-card input {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.vlg-hero-preset-card img,
.vlg-hero-preset-custom {
  width: 100% !important;
  aspect-ratio: 16 / 7 !important;
  border-radius: 10px !important;
  object-fit: cover !important;
  background: linear-gradient(135deg, #f8fafc, #fff4e5) !important;
}

.vlg-hero-preset-custom {
  display: grid !important;
  place-items: center !important;
  font-size: 34px !important;
  font-weight: 900 !important;
  color: var(--vlg-primary, #f28a00) !important;
  border: 1px dashed rgba(242,138,0,.35) !important;
}

.vlg-hero-preset-card strong {
  font-size: 12px !important;
  color: #142033 !important;
  line-height: 1.25 !important;
}

.vlg-cookie-notice {
  position: fixed !important;
  left: 22px !important;
  right: 22px !important;
  bottom: 20px !important;
  z-index: 99999 !important;
  width: min(920px, calc(100vw - 44px)) !important;
  margin: 0 auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  padding: 16px 18px !important;
  border-radius: 18px !important;
  border: 1px solid rgba(17,32,55,.12) !important;
  background: rgba(255,255,255,.96) !important;
  box-shadow: 0 18px 50px rgba(7,18,36,.18) !important;
  backdrop-filter: blur(14px) !important;
}

.vlg-cookie-notice[hidden] { display: none !important; }
.vlg-cookie-notice p { margin: 0 !important; color: #243147 !important; font-size: 14px !important; line-height: 1.45 !important; }
.vlg-cookie-notice a { color: var(--vlg-primary, #f28a00) !important; font-weight: 800 !important; }
.vlg-cookie-notice__button {
  border: 0 !important;
  border-radius: 999px !important;
  background: var(--vlg-primary, #f28a00) !important;
  color: #fff !important;
  font-weight: 900 !important;
  padding: 12px 18px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
}

@media (max-width: 900px) {
  .vlg-hero-preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .vlg-cookie-notice { flex-direction: column !important; align-items: flex-start !important; }
  .vlg-cookie-notice__button { width: 100% !important; }
}
