/**
 * Fitness360 Søgemaskine — recommendations.css
 *
 * Styles for two widget modes:
 *   1. Flat widget  — .f360s-widget  (also_viewed / for_you / popular on shop pages)
 *   2. Popular slider — .f360s-popular-section  (homepage "MEST POPULÆRE PRODUKTER LIGE NU"
 *      and category "MEST POPULÆR I DENNE KATEGORI")
 *
 * Typography mirrors the live fitness360.dk Astra/Elementor theme:
 *   - Headings & product titles: "Bebas Neue", weight 400, uppercase, #1D1D1D
 *   - Body / prices / buttons:   "Roboto Condensed", weight 300/400
 *   - Buttons: black (#1D1D1D), white text, uppercase, border-radius 4px,
 *     full width, padding 5px 0 (matches the theme's .button override)
 */

/* ── Box-sizing reset ─────────────────────────────────────────────────────── */
.f360s-reco-widget,
.f360s-reco-widget *,
.f360s-reco-widget *::before,
.f360s-reco-widget *::after {
  box-sizing: border-box;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FLAT WIDGET  (also_viewed, for_you, popular on shop/category pages)
   ═══════════════════════════════════════════════════════════════════════════ */

.f360s-widget {
  margin: 40px 0;
  font-family: "Roboto Condensed", "Barlow", sans-serif;
  font-weight: 300;
}

.f360s-widget-title {
  font-family: "Bebas Neue", "Oswald", sans-serif;
  font-size: 24px;
  font-weight: 400;
  text-transform: uppercase;
  color: #1d1d1d;
  margin: 0 0 16px;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

/* Horizontal scrollable row */
.f360s-widget-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.f360s-widget-track::-webkit-scrollbar { height: 4px; }
.f360s-widget-track::-webkit-scrollbar-track { background: #f0f0f0; border-radius: 4px; }
.f360s-widget-track::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

/* Card — flat mode: borderless & centered like the live shop grid */
.f360s-card {
  flex: 0 0 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  background: #fff;
  scroll-snap-align: start;
}

.f360s-card:hover .f360s-card-img { transform: scale(1.04); }

.f360s-card-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #fff;
  display: block;
  transition: transform 0.2s ease;
}

.f360s-card-img--placeholder {
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.f360s-card-body {
  padding: 10px 6px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex: 1;
  width: 100%;
}

.f360s-card-name {
  font-family: "Roboto Condensed", "Barlow", sans-serif;
  font-size: 17px;
  font-weight: 300;
  text-transform: uppercase;
  color: #1d1d1d;
  line-height: 1.4;
  letter-spacing: 0.02em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* Always reserve exactly two lines so price aligns across cards */
  height: 2.8em;
}

.f360s-card-price {
  font-size: 17px;
  font-weight: 700;
  color: #1a1a1a;
  text-transform: uppercase;
  margin-top: auto;
}

.f360s-card-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 400;
  padding: 2px 8px;
  border-radius: 3px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.f360s-card-badge--instock   { background: #e6f9f0; color: #1a7a4a; }
.f360s-card-badge--outofstock { background: #fce8e8; color: #b91c1c; }

/* ═══════════════════════════════════════════════════════════════════════════
   POPULAR SLIDER SECTION
   ("MEST POPULÆRE PRODUKTER LIGE NU" / "MEST POPULÆR I DENNE KATEGORI")

   Matches the live fitness360.dk product grid: white background, centered
   Bebas Neue heading, borderless centered cards, round black discount badge,
   grey strikethrough old price + bold current price in Roboto Condensed,
   full-width black 4px-rounded CTA button and square black slider arrows.
   ═══════════════════════════════════════════════════════════════════════════ */

.f360s-popular-section {
  background: #fff;
  padding: 48px 0 56px;
  width: 100%;
  font-family: "Roboto Condensed", "Barlow", sans-serif;
  font-weight: 300;
  overflow: hidden;
}

.f360s-popular-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 32px;
}

.f360s-popular-title {
  font-family: "Bebas Neue", "Oswald", sans-serif;
  font-size: 28px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.3;
  color: #1d1d1d;
  text-align: center;
  margin: 0 0 32px;
}

/* Wrapper: viewport with arrows overlaid at the edges */
.f360s-slider-wrap {
  position: relative;
}

/* Arrow buttons — small black squares with white chevrons (live-shop look).
   JS sets `top` to the image midpoint on every layout pass; translateY(-50%)
   keeps the square centered on that line. */
.f360s-slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 30px;
  height: 30px;
  border-radius: 2px;
  border: none;
  background: #1d1d1d;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, opacity 0.15s;
  padding: 0;
  user-select: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.f360s-slider-btn--prev { left: 0; }
.f360s-slider-btn--next { right: 0; }

.f360s-slider-btn:hover:not(:disabled) { background: #3a3a3a; }

.f360s-slider-btn:disabled {
  opacity: 0.2;
  cursor: default;
}

/* Viewport clips the sliding track */
.f360s-slider-viewport {
  width: 100%;
  overflow: hidden;
}

/* Track: flex row of cards, slides via transform */
.f360s-slider-track {
  display: flex;
  gap: 16px;
  will-change: transform;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Card — light, borderless, centered like live product cards */
.f360s-scard {
  flex: 0 0 calc(25% - 12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  background: #fff;
}

.f360s-scard-img-wrap {
  position: relative;
  width: 100%;
  display: block;
}

/* Round black discount badge, top-right of the image (live-shop style) */
.f360s-scard-discount {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #1d1d1d;
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
}

.f360s-scard-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #fff;
  display: block;
  transition: transform 0.2s ease;
}

.f360s-scard:hover .f360s-scard-img { transform: scale(1.04); }

.f360s-scard-img--placeholder {
  background: #f5f5f5;
  min-height: 180px;
}

.f360s-scard-body {
  padding: 12px 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  width: 100%;
}

/* Product title — Roboto Condensed uppercase (matches live slider cards) */
.f360s-scard-name {
  font-family: "Roboto Condensed", "Barlow", sans-serif;
  font-size: 20px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #1d1d1d;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* Always reserve exactly two lines so price & button align across cards */
  height: 2.8em;
}

/* Price row: strikethrough old price + bold current price, "KR." uppercase */
.f360s-scard-price-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  text-transform: uppercase;
}

.f360s-scard-old-price {
  font-size: 15px;
  font-weight: 300;
  color: #b9b9b9;
  text-decoration: line-through;
}

.f360s-scard-price {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
}

/* Black full-width CTA button — mirrors the theme's .button override:
   Roboto Condensed 16px/400, uppercase, 4px radius, padding 5px 0 */
.f360s-scard-btn {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: auto;
  background: #1d1d1d;
  color: #f0f0f0;
  font-family: "Roboto Condensed", "Barlow", sans-serif;
  font-size: 15px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 11px 0;
  border-radius: 7px;
  transition: background 0.15s;
}

.f360s-scard:hover .f360s-scard-btn { background: #3a3a3a; }

/* Disabled out-of-stock button — muted appearance, never changes on hover */
.f360s-scard-btn--out {
  background: #e5e7eb;
  color: #6b7280;
  cursor: default;
  pointer-events: none;
}

.f360s-scard:hover .f360s-scard-btn--out {
  background: #e5e7eb;
}

/* Restock date hint below the Udsolgt button */
.f360s-scard-restock {
  display: block;
  font-size: 12px;
  color: #6b7280;
  text-align: center;
  margin-top: 4px;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .f360s-scard { flex-basis: calc(33.333% - 11px); }
  .f360s-scard-name { font-size: 17px; }
}

@media (max-width: 760px) {
  .f360s-popular-section { padding: 32px 0 40px; }
  .f360s-popular-inner   { padding: 0 16px; }
  .f360s-popular-title   { font-size: 22px; margin-bottom: 22px; }
  .f360s-scard           { flex-basis: calc(50% - 8px); }
  .f360s-scard-name      { font-size: 17px; }
  .f360s-scard-price     { font-size: 18px; }
  .f360s-scard-btn       { font-size: 14px; padding: 9px 0; }
  .f360s-slider-btn      { width: 26px; height: 26px; font-size: 16px; }
  .f360s-scard-discount  { width: 36px; height: 36px; font-size: 11px; }
}

@media (max-width: 480px) {
  .f360s-scard { flex-basis: calc(70% - 8px); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   MINI-CART WIDGET  (basket preview flyout, desktop only)
   "MÅSKE KUNNE NOGLE AF DISSE PRODUKTER HAVE DIN INTERESSE?"
   Mirrors the Hello Retail basket-preview box: centered Barlow Semi Condensed
   headline uppercased via CSS, compact 4-column product grid above the cart
   items. Prepended into .elementor-menu-cart__main by recommendations.js.
   ═══════════════════════════════════════════════════════════════════════════ */

.f360s-cart-reco-mount,
.f360s-cart-reco-mount *,
.f360s-cart-reco-mount *::before,
.f360s-cart-reco-mount *::after {
  box-sizing: border-box;
}

.f360s-cart-reco {
  padding: 16px 14px 14px;
  border-bottom: 1px solid #e8e8e8;
  background: #fff;
  font-family: "Roboto Condensed", "Barlow", sans-serif;
}

.f360s-cart-reco-title {
  font-family: "Barlow Semi Condensed", "Barlow", "Roboto Condensed", sans-serif;
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  text-align: center;
  color: #1d1d1d;
  letter-spacing: 0.03em;
  line-height: 1.35;
  margin: 0 0 14px;
}

.f360s-cart-reco-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.f360s-cart-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: inherit;
  background: #fff;
  cursor: pointer;
}

.f360s-cart-card-img-wrap {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  margin-bottom: 6px;
}

.f360s-cart-card-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  transition: transform 0.2s ease;
}

.f360s-cart-card:hover .f360s-cart-card-img { transform: scale(1.05); }

.f360s-cart-card-img--placeholder { background: #f4f4f4; }

.f360s-cart-card-name {
  font-family: "Barlow Semi Condensed", "Barlow", "Roboto Condensed", sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #1d1d1d;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* Reserve two lines so prices & buttons align across the grid */
  height: 2.5em;
  margin-bottom: 4px;
}

.f360s-cart-card-price {
  font-family: "Barlow Semi Condensed", "Barlow", "Roboto Condensed", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.f360s-cart-card-btn {
  display: block;
  width: 100%;
  margin-top: auto;
  background: #1d1d1d;
  color: #f0f0f0;
  font-family: "Barlow Semi Condensed", "Barlow", "Roboto Condensed", sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 6px 0;
  border-radius: 4px;
  transition: background 0.15s;
}

.f360s-cart-card:hover .f360s-cart-card-btn { background: #3a3a3a; }

/* Belt & braces: the widget is desktop-only (injection already checks the
   same breakpoint, but a resize after render must hide it too). */
@media (max-width: 1024px) {
  .f360s-cart-reco-mount { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CART FLYOUT DESIGN  (Elementor mini-cart restyling, desktop only)

   Ports the approved "DIN KURV" basket design onto Elementor Pro's mini-cart
   flyout: dark header bar (injected by recommendations.js), 52px rounded
   product thumbnails, Roboto Condensed item typography, red remove button,
   Bebas Neue subtotal label, outlined "Se kurv" + solid black "Til kassen"
   buttons.

   Desktop only (min-width: 1025px) — below that breakpoint Elementor's own
   mobile cart styling is completely untouched. Purely visual: every rule
   targets WooCommerce/Elementor's existing nodes (or our additive header),
   never wraps or moves them, so remove links, fragment refreshes and
   checkout navigation keep working unchanged.

   Specificity: rules are anchored on .elementor-menu-cart__main descendants
   (0,2,0+) which outranks Elementor's single-class widget defaults; the few
   !important flags are limited to properties Elementor itself sets with high
   specificity (remove-button geometry, thumbnail sizing).
   ═══════════════════════════════════════════════════════════════════════════ */

@media (min-width: 1025px) {
  /* Panel frame */
  .elementor-menu-cart__main {
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    background: #fff;
    overflow: hidden;
  }

  /* Injected dark header bar (additive sibling node, see recommendations.js) */
  .elementor-menu-cart__main .f360s-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    background: #1a1a1a;
    padding: 10px 14px;
    margin: 0;
  }

  .elementor-menu-cart__main .f360s-cart-header-title {
    font-family: "Bebas Neue", "Oswald", sans-serif;
    font-size: 18px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.1;
    color: #fff;
  }

  .elementor-menu-cart__main .f360s-cart-header-count {
    font-family: "Roboto Condensed", "Barlow", sans-serif;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 2px 8px;
    white-space: nowrap;
  }

  /* Item list */
  .elementor-menu-cart__main ul.woocommerce-mini-cart {
    list-style: none;
    margin: 0;
    padding: 8px 14px;
  }

  .elementor-menu-cart__main li.woocommerce-mini-cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    margin: 0;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
  }

  /* Remove (×) — restyle WooCommerce's own link, keep its node & handlers.
     Elementor positions it absolutely and draws a circle; reset both. */
  .elementor-menu-cart__main li.woocommerce-mini-cart-item a.remove,
  .elementor-menu-cart__main li.woocommerce-mini-cart-item a.remove_from_cart_button {
    position: static !important;
    display: block;
    flex-shrink: 0;
    width: auto !important;
    height: auto !important;
    background: transparent !important;
    border: none;
    border-radius: 0;
    color: #c0392b !important;
    font-size: 16px !important;
    font-weight: 400;
    line-height: 1 !important;
    text-align: left;
    text-decoration: none;
  }

  .elementor-menu-cart__main li.woocommerce-mini-cart-item a.remove:hover,
  .elementor-menu-cart__main li.woocommerce-mini-cart-item a.remove_from_cart_button:hover {
    color: #96281b !important;
    background: transparent !important;
  }

  /* Product thumbnails — WooCommerce renders the img inside the product link */
  .elementor-menu-cart__main li.woocommerce-mini-cart-item img {
    width: 52px !important;
    height: 52px !important;
    max-width: none;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #f0f0f0;
    display: block;
    float: none;
    margin: 0;
    flex-shrink: 0;
  }

  /* Product link / name typography (excludes the remove button) */
  .elementor-menu-cart__main li.woocommerce-mini-cart-item a:not(.remove):not(.remove_from_cart_button) {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: #1a1a1a;
    text-decoration: none;
    font-family: "Roboto Condensed", "Barlow", sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
  }

  /* Quantity — pushed to the right edge of the row */
  .elementor-menu-cart__main li.woocommerce-mini-cart-item .quantity {
    margin-left: auto;
    flex-shrink: 0;
    font-family: "Roboto Condensed", "Barlow", sans-serif;
    font-size: 12px;
    color: #888;
    white-space: nowrap;
  }

  /* Subtotal row */
  .elementor-menu-cart__main .woocommerce-mini-cart__total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    padding: 12px 14px;
    border-top: 1px solid #e5e5e5;
    border-bottom: none;
  }

  .elementor-menu-cart__main .woocommerce-mini-cart__total strong {
    font-family: "Bebas Neue", "Oswald", sans-serif;
    font-size: 16px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #1a1a1a;
  }

  .elementor-menu-cart__main .woocommerce-mini-cart__total .woocommerce-Price-amount {
    font-family: "Roboto Condensed", "Barlow", sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
  }

  /* Buttons row: outlined "Se kurv" + solid black "Til kassen" */
  .elementor-menu-cart__main .woocommerce-mini-cart__buttons {
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 0 14px 14px;
  }

  .elementor-menu-cart__main .woocommerce-mini-cart__buttons a {
    flex: 1;
    display: block;
    box-sizing: border-box;
    text-align: center;
    background: transparent;
    color: #1a1a1a;
    border: 1px solid #1a1a1a;
    border-radius: 3px;
    font-family: "Roboto Condensed", "Barlow", sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.2;
    padding: 10px 0;
    margin: 0;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
  }

  .elementor-menu-cart__main .woocommerce-mini-cart__buttons a:hover {
    background: rgba(26, 26, 26, 0.06);
    color: #1a1a1a;
  }

  .elementor-menu-cart__main .woocommerce-mini-cart__buttons a.checkout,
  .elementor-menu-cart__main .woocommerce-mini-cart__buttons a:last-child {
    background: #1a1a1a;
    color: #fff;
  }

  .elementor-menu-cart__main .woocommerce-mini-cart__buttons a.checkout:hover,
  .elementor-menu-cart__main .woocommerce-mini-cart__buttons a:last-child:hover {
    background: #3a3a3a;
    color: #fff;
  }
}
