/* Phox Fluent Elements: Fluent Cart's own product popup (the "View Options"
   modal of Fluent Cart's product cards and blocks) in the Product Display
   look. Fluent Cart prints the popup at the end of <body>, outside any of our
   elements, so these rules are page-wide; they load on pages that use one of
   our elements. Colours go through Fluent Cart's own variables where it has
   them. */

.fct-product-modal {
  --pfe-text: #222; --pfe-text-2: #666; --pfe-muted: #999; --pfe-border: #e5e5e5;
  --pfe-surface: #fff; --pfe-surface-2: #f5f5f5; --pfe-primary: #222; --pfe-primary-text: #fff; --pfe-primary-hover: #000;
  --pfe-accent: #e85d3a; --pfe-success: #2e9e5b; --pfe-radius: 8px; --pfe-radius-lg: 12px;
  --fct-popup-radius: var(--pfe-radius-lg);
  --fct-single-product-primary-text-color: var(--pfe-text);
  --fct-single-product-secondary-text-color: var(--pfe-text-2);
  --fct-single-product-border-color: var(--pfe-border);
  --fct-single-product-active-border-color: var(--pfe-primary);
  --fct-single-product-qty-bg: var(--pfe-surface-2);
  --fct-single-product-qty-text-color: var(--pfe-text);
  --fct-card-bg-color: var(--pfe-surface);
  --fct-variant-radius: var(--pfe-radius);
  --fct-btn-radius: var(--pfe-radius);
  --fct-add-to-cart-btn-bg-color: var(--pfe-primary);
  --fct-add-to-cart-btn-hover-bg-color: var(--pfe-primary-hover);
  --fct-add-to-cart-btn-text-color: var(--pfe-primary-text);
  --fct-add-to-cart-btn-border-color: var(--pfe-primary);
  --fct-direct-btn-bg-color: var(--pfe-surface);
  --fct-direct-btn-text-color: var(--pfe-text);
  --fct-direct-btn-hover-bg-color: var(--pfe-text);
  --fct-direct-btn-hover-text-color: var(--pfe-surface);
}
.fct-product-modal .fct-product-modal-overlay { background-color: rgba(0, 0, 0, .55); opacity: 1; }
.fct-product-modal .fct-product-modal-body { color: var(--pfe-text); box-shadow: 0 24px 60px rgba(0, 0, 0, .18); }

/* Title: an h1, so it keeps the site's heading font; Product Display's size. */
.fct-product-modal .fct-product-modal-body .fct-product-title :is(h1, h2, h3) { font-size: 26px; font-weight: 600; line-height: 1.25; color: var(--pfe-text); margin: 0 0 10px; }

/* Stock: coloured dot and text, as Product Display. */
.fct-product-modal .fct-product-modal-body .fct-product-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 0 0 12px; }
.fct-product-modal .fct-product-modal-body .fct-product-stock .fct-stock-label { display: none; }
.fct-product-modal .fct-product-modal-body .fct-product-stock .fct-stock-badge { display: inline-flex; align-items: center; gap: 7px; padding: 0; background: none; border: 0; font-size: 14px; font-weight: 600; color: var(--pfe-success); }
.fct-product-modal .fct-product-modal-body .fct-product-stock .fct-stock-badge::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.fct-product-modal .fct-product-modal-body .fct-product-stock.out-of-stock .fct-stock-badge { color: #c0392b; }
.fct-product-modal .fct-product-modal-body .fct-product-sku { font-size: 13px; color: var(--pfe-muted); }
.fct-product-modal .fct-product-modal-body .fct-product-excerpt { color: var(--pfe-text-2); font-size: 15px; line-height: 1.6; margin: 0 0 16px; }
.fct-product-modal .fct-product-modal-body .fct-product-excerpt p { margin: 0 0 .6em; }

/* Price once: the chosen variation's price, large, above the options (the
   product's price range above it repeats it). */
.fct-product-modal .fct-product-modal-body .fct-product-prices { display: none; }
.fct-product-modal .fct-product-modal-body .fct_buy_section { display: flex; flex-direction: column; align-items: stretch; gap: 16px; }
.fct-product-modal .fct-product-modal-body .fct_buy_section > * { margin: 0; }
.fct-product-modal .fct-product-modal-body .fct_buy_section .fct-product-item-price { order: -1; font-size: 24px; font-weight: 700; color: var(--pfe-text); }
.fct-product-modal .fct-product-modal-body .fct_buy_section .fct-product-item-price.is-hidden { display: none; }
.fct-product-modal .fct-product-modal-body .fct_buy_section .fct-product-item-price :is(del, .fct-compare-price) { font-size: 16px; font-weight: 400; color: var(--pfe-muted); margin-right: 8px; }

/* Option pills: outlined, the selected one filled dark. */
.fct-product-modal .fct-product-modal-body .fct-product-variants { display: flex !important; flex-wrap: wrap; gap: 8px; grid-template-columns: none !important; }
.fct-product-modal .fct-product-modal-body .fct-product-variant-item { flex: 0 0 auto; border-width: 1.5px; border-style: solid; box-shadow: none; }
.fct-product-modal .fct-product-modal-body .fct-product-variant-item:not(.fct_variation_view_type_image) { min-height: 40px; padding: 6px 14px; }
.fct-product-modal .fct-product-modal-body .fct-product-variant-item.fct_variation_view_type_both { padding: 4px 14px 4px 4px; }
.fct-product-modal .fct-product-modal-body .fct-product-variant-item .fct-product-variant-title { font-size: 14px; font-weight: 500; color: inherit; }
.fct-product-modal .fct-product-modal-body .fct-product-variant-item .fct-product-variant-price { display: none; }
.fct-product-modal .fct-product-modal-body .fct-product-variant-item.selected { box-shadow: none; }
.fct-product-modal .fct-product-modal-body .fct-product-variant-item.selected:not(.fct_variation_view_type_image) { background-color: var(--pfe-primary); border-color: var(--pfe-primary); color: var(--pfe-primary-text); --fct-single-product-primary-text-color: var(--pfe-primary-text); }
.fct-product-modal .fct-product-modal-body .fct-product-variant-item[data-item-stock="out-of-stock"] { opacity: .55; }
.fct-product-modal .fct-product-modal-body .fct-attribute-label { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--pfe-muted); }
.fct-product-modal .fct-product-modal-body .fct-attribute-selector .fct-swatch-label { height: auto; min-height: 40px; padding: 9px 16px; border-width: 1.5px; border-style: solid; }
.fct-product-modal .fct-product-modal-body .fct-attribute-selector .fct-swatch-label:not(.selected) { border-color: var(--pfe-border); background-color: var(--pfe-surface); color: var(--pfe-text); }
.fct-product-modal .fct-product-modal-body .fct-attribute-selector .fct-swatch-label.selected { --fct-card-bg-color: var(--pfe-primary); --fct-single-product-active-text-color: var(--pfe-primary-text); }

/* Quantity */
.fct-product-modal .fct-product-modal-body .fct-product-quantity-container .quantity-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--pfe-muted); }
.fct-product-modal .fct-product-modal-body .fct-product-quantity { border-radius: var(--pfe-radius); }
.fct-product-modal .fct-product-modal-body .fct-product-quantity .fct-quantity-input { -moz-appearance: textfield; appearance: textfield; text-align: center; }
.fct-product-modal .fct-product-modal-body .fct-product-quantity .fct-quantity-input::-webkit-outer-spin-button,
.fct-product-modal .fct-product-modal-body .fct-product-quantity .fct-quantity-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Buttons: flat dark Add to basket first, outlined Buy now; Buy now is
   the dark one when it is the only button (subscriptions). */
.fct-product-modal .fct-product-modal-body .fct-product-buttons-wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fct-product-modal .fct-product-modal-body .fct-product-buttons-wrap:not(:has(.fluent-cart-add-to-cart-button:not(.is-hidden))),
.fct-product-modal .fct-product-modal-body .fct-product-buttons-wrap:not(:has(.fluent-cart-direct-checkout-button:not(.is-hidden))) { grid-template-columns: minmax(0, 1fr); }
.fct-product-modal .fct-product-modal-body .fct-product-buttons-wrap .fluent-cart-add-to-cart-button { order: -1; }
.fct-product-modal .fct-product-modal-body :is(.fluent-cart-add-to-cart-button, .fluent-cart-direct-checkout-button) { min-height: 48px; max-height: none; font-size: 15px; font-weight: 600; text-transform: none; border-width: 1.5px; border-style: solid; background-image: none; box-shadow: none; }
.fct-product-modal .fct-product-modal-body .fluent-cart-direct-checkout-button { border-color: var(--fct-direct-btn-text-color); }
.fct-product-modal .fct-product-modal-body .fct-product-buttons-wrap:not(:has(.fluent-cart-add-to-cart-button:not(.is-hidden))) {
  --fct-direct-btn-bg-color: var(--pfe-primary); --fct-direct-btn-text-color: var(--pfe-primary-text);
  --fct-direct-btn-hover-bg-color: var(--pfe-primary-hover); --fct-direct-btn-hover-text-color: var(--pfe-primary-text);
}

/* Gallery: rounded main image; thumbnails one scrolling row of small tiles. */
.fct-product-modal .fct-product-modal-body .fct-product-gallery-thumb img { border-radius: var(--pfe-radius); }
.fct-product-modal .fct-product-modal-body .fct-product-gallery-wrapper .fct-gallery-thumb-controls { display: flex; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; gap: 8px; scrollbar-width: thin; }
.fct-product-modal .fct-product-modal-body .fct-product-gallery-wrapper .fct-gallery-thumb-control-button { flex: 0 0 64px; width: 64px; height: 64px; border-radius: var(--pfe-radius); border-width: 1.5px; }
.fct-product-modal .fct-product-modal-body .fct-product-gallery-wrapper .fct-gallery-thumb-control-button.active { border-color: var(--pfe-primary); }

/* Phones: a shorter image, so the title, price and buttons start on the
   first screen; the popup itself scrolls. */
@media (max-width: 767px) {
  .fct-product-modal { padding: 12px; }
  .fct-product-modal .fct-product-modal-body { width: 100%; max-height: calc(100dvh - 24px); overflow-y: auto; padding: 20px 16px; }
  .fct-product-modal .fct-product-modal-body .fct-product-gallery-thumb { max-height: 42vh; overflow: hidden; }
  .fct-product-modal .fct-product-modal-body .fct-product-gallery-thumb img { max-height: 42vh; width: 100%; object-fit: contain; }
  .fct-product-modal .fct-product-modal-body .fct-product-gallery-wrapper .fct-gallery-thumb-controls { margin-top: 10px; }
  .fct-product-modal .fct-product-modal-body .fct-product-gallery-wrapper .fct-gallery-thumb-control-button { flex-basis: 52px; width: 52px; height: 52px; }
  .fct-product-modal .fct-product-modal-body .fct-product-title :is(h1, h2, h3) { font-size: 22px; }
}

/* ---- Cart drawer extras (Mini Cart > Cart Drawer) ----
   Free delivery bar, product suggestions, discount code and order note,
   added to Fluent Cart's drawer by the Mini Cart runtime. Colours follow
   the drawer's own variables, so the Mini Cart's drawer colours apply. */
.fct-cart-drawer [data-pfe-dx] { --pfe-dx-text: var(--fct-cart-drawer-primary-text-color, #222); --pfe-dx-muted: var(--fct-cart-drawer-secondary-text-color, #666); --pfe-dx-border: var(--fct-cart-drawer-border-color, #e5e5e5); --pfe-dx-accent: var(--fct-cart-drawer-btn-bg-color, #222); --pfe-dx-accent-text: var(--fct-cart-drawer-btn-text-color, #fff); color: var(--pfe-dx-text); font-size: 14px; line-height: 1.45; }

/* Layout: Fluent pins the footer over the list (absolute, with the list
   capped at 100% - 220px), so anything added to the footer covered the
   end of the list. A flex column instead: header and footer take their
   own height, the list takes the rest and scrolls. */
.fct-cart-drawer-container .fct-cart-drawer { display: flex; flex-direction: column; }
.fct-cart-drawer-container .fct-cart-drawer > .fct-cart-drawer-header { flex: 0 0 auto; }
.fct-cart-drawer-container .fct-cart-drawer > .fct-cart-drawer-content-wrapper { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; overscroll-behavior: contain; }
.fct-cart-drawer-container .fct-cart-drawer > .fct-cart-drawer-footer { position: relative; bottom: auto; flex: 0 0 auto; }
.fct-cart-drawer-container .fct-cart-drawer > .fct-cart-drawer-footer:has(> .pfe-dx-foot) { border-top: 1px solid var(--fct-cart-drawer-border-color, #e5e5e5); }

.fct-cart-drawer .pfe-dx-bar { padding: 14px 20px; border-bottom: 1px solid var(--pfe-dx-border); }
.fct-cart-drawer .pfe-dx-bar__text { margin: 0 0 8px; font-size: 13px; }
.fct-cart-drawer .pfe-dx-bar__track { height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--pfe-dx-border) 70%, transparent); overflow: hidden; }
.fct-cart-drawer .pfe-dx-bar__fill { display: block; height: 100%; border-radius: inherit; background: var(--pfe-dx-accent); transition: width .3s ease; }
.fct-cart-drawer .pfe-dx-bar.is-done .pfe-dx-bar__fill { background: #2e9e5b; }
.fct-cart-drawer .pfe-dx-bar.is-done .pfe-dx-bar__text { color: #2e9e5b; font-weight: 600; }

.fct-cart-drawer .pfe-dx-sugg { padding: 16px 20px 20px; border-top: 1px solid var(--pfe-dx-border); }
.fct-cart-drawer .pfe-dx-sugg__head { margin: 0 0 10px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--pfe-dx-muted); }
.fct-cart-drawer .pfe-dx-sugg__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.fct-cart-drawer .pfe-dx-sugg__item { display: flex; align-items: center; gap: 12px; margin: 0; }
.fct-cart-drawer .pfe-dx-sugg__img { flex: 0 0 52px; width: 52px; height: 52px; border-radius: 8px; overflow: hidden; background: #f5f5f5; }
.fct-cart-drawer .pfe-dx-sugg__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fct-cart-drawer .pfe-dx-sugg__info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fct-cart-drawer .pfe-dx-sugg__title { color: var(--pfe-dx-text); font-weight: 600; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fct-cart-drawer .pfe-dx-sugg__title:where(:hover, :focus) { color: var(--pfe-dx-text); text-decoration: underline; }
.fct-cart-drawer .pfe-dx-sugg__price { font-size: 13px; color: var(--pfe-dx-muted); }
.fct-cart-drawer .pfe-dx-sugg__price del { opacity: .7; margin-right: 4px; }
.fct-cart-drawer .pfe-dx-sugg__price ins { text-decoration: none; }
.fct-cart-drawer .pfe-dx-sugg .pfe-dx-sugg__add { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; min-height: 34px; max-height: none; width: auto; padding: 0 14px; border: 1.5px solid var(--pfe-dx-text); border-radius: 8px; background: transparent; background-image: none; box-shadow: none; color: var(--pfe-dx-text); font-size: 13px; font-weight: 600; text-decoration: none; text-transform: none; cursor: pointer; }
.fct-cart-drawer .pfe-dx-sugg .pfe-dx-sugg__add:where(:hover, :focus-visible) { background: var(--pfe-dx-text); color: #fff; }
.fct-cart-drawer .pfe-dx-sugg .pfe-dx-sugg__add.fct-loading { opacity: .6; pointer-events: none; }

.fct-cart-drawer .pfe-dx-foot { display: grid; gap: 10px; padding: 14px 20px 4px; }
.fct-cart-drawer .pfe-dx-coupon { margin: 0; display: grid; gap: 8px; }
.fct-cart-drawer .pfe-dx-coupon__row { display: flex; gap: 8px; }
.fct-cart-drawer .pfe-dx-coupon__input { flex: 1 1 auto; min-width: 0; height: 40px; margin: 0; padding: 0 12px; border: 1px solid var(--pfe-dx-border); border-radius: 8px; background: #fff; color: var(--pfe-dx-text); font-size: 14px; box-shadow: none; }
.fct-cart-drawer .pfe-dx-coupon__input:focus { outline: none; border-color: var(--pfe-dx-text); }
.fct-cart-drawer .pfe-dx-coupon .pfe-dx-coupon__apply { flex: 0 0 auto; height: 40px; padding: 0 16px; border: 1.5px solid var(--pfe-dx-text); border-radius: 8px; background: transparent; color: var(--pfe-dx-text); font-size: 14px; font-weight: 600; cursor: pointer; }
.fct-cart-drawer .pfe-dx-coupon .pfe-dx-coupon__apply:where(:hover, :focus-visible) { background: var(--pfe-dx-text); color: #fff; }
.fct-cart-drawer .pfe-dx-coupon.is-busy { opacity: .6; pointer-events: none; }
.fct-cart-drawer .pfe-dx-coupon__msg { margin: 0; font-size: 13px; color: #c0392b; }
.fct-cart-drawer .pfe-dx-coupon__codes { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.fct-cart-drawer .pfe-dx-coupon__code { display: inline-flex; align-items: center; gap: 4px; margin: 0; padding: 3px 4px 3px 10px; border-radius: 99px; background: #f5f5f5; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.fct-cart-drawer .pfe-dx-coupon .pfe-dx-coupon__remove { width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--pfe-dx-muted); font-size: 15px; line-height: 1; cursor: pointer; }
.fct-cart-drawer .pfe-dx-coupon .pfe-dx-coupon__remove:hover { background: #e5e5e5; color: var(--pfe-dx-text); }
.fct-cart-drawer .pfe-dx-coupon__discount { display: flex; justify-content: space-between; font-size: 14px; color: #2e9e5b; font-weight: 600; }

.fct-cart-drawer .pfe-dx-note { display: grid; gap: 8px; }
.fct-cart-drawer .pfe-dx-note .pfe-dx-note__toggle { justify-self: start; padding: 0; border: 0; background: none; color: var(--pfe-dx-text); font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.fct-cart-drawer .pfe-dx-note__field { width: 100%; min-height: 72px; margin: 0; padding: 10px 12px; border: 1px solid var(--pfe-dx-border); border-radius: 8px; background: #fff; color: var(--pfe-dx-text); font: inherit; font-size: 14px; resize: vertical; }
.fct-cart-drawer .pfe-dx-note__field:focus { outline: none; border-color: var(--pfe-dx-text); }
.fct-cart-drawer .pfe-dx-note__field[hidden] { display: none; }

/* Fluent Cart's plan tabs (Monthly / Quarterly...) scroll sideways when they
   don't fit. Keep the swipe, hide the scrollbar: Windows draws a classic one
   with arrow buttons even when nothing overflows. */
.fct-product-tab-nav { scrollbar-width: none; }
.fct-product-tab-nav::-webkit-scrollbar { display: none; }
