/** Shopify CDN: Minification failed

Line 16:0 Unexpected "{"
Line 16:1 Unexpected "{"
Line 16:3 Expected identifier but found "'component-card.css'"
Line 17:0 Unexpected "{"
Line 17:1 Unexpected "{"
Line 17:3 Expected identifier but found "'component-price.css'"
Line 19:0 Unexpected "{"
Line 19:1 Unexpected "{"
Line 19:3 Expected identifier but found "'component-slider.css'"
Line 20:0 Unexpected "{"
... and 378 more hidden warnings

**/
{{ 'component-card.css' | asset_url | stylesheet_tag }}
{{ 'component-price.css' | asset_url | stylesheet_tag }}

{{ 'component-slider.css' | asset_url | stylesheet_tag }}
{{ 'template-collection.css' | asset_url | stylesheet_tag }}

{% if section.settings.image_shape == 'blob' %}
  {{ 'mask-blobs.css' | asset_url | stylesheet_tag }}
{%- endif -%}

{%- unless section.settings.quick_add == 'none' -%}
  {{ 'quick-add.css' | asset_url | stylesheet_tag }}
  <script src="{{ 'product-form.js' | asset_url }}" defer="defer"></script>
{%- endunless -%}

{%- if section.settings.quick_add == 'standard' -%}
  <script src="{{ 'quick-add.js' | asset_url }}" defer="defer"></script>
{%- endif -%}

{%- if section.settings.quick_add == 'bulk' -%}
  <script src="{{ 'quick-add-bulk.js' | asset_url }}" defer="defer"></script>
  <script src="{{ 'quantity-popover.js' | asset_url }}" defer="defer"></script>
  <script src="{{ 'price-per-item.js' | asset_url }}" defer="defer"></script>
  <script src="{{ 'quick-order-list.js' | asset_url }}" defer="defer"></script>
{%- endif -%}

{%- style -%}
  /* ===== Section padding (scoped) ===== */
  #shopify-section-{{ section.id }} .section-{{ section.id }}-padding {
    padding-top: {{ section.settings.padding_top | times: 0.75 | round: 0 }}px;
    padding-bottom: {{ section.settings.padding_bottom | times: 0.75 | round: 0 }}px;
  }
  @media screen and (min-width: 750px) {
    #shopify-section-{{ section.id }} .section-{{ section.id }}-padding {
      padding-top: {{ section.settings.padding_top }}px;
      padding-bottom: {{ section.settings.padding_bottom }}px;
    }
  }

  /* ===== Design tokens (scoped) ===== */
  #shopify-section-{{ section.id }}{
    --fc-radius-{{ section.id }}: clamp(16px, 2.2vw, 22px);
    --fc-img-radius-{{ section.id }}: calc(var(--fc-radius-{{ section.id }}) - 2px);
    --fc-shadow-{{ section.id }}: 0 10px 22px rgba(0,0,0,.12);
    --fc-shadow-hover-{{ section.id }}: 0 16px 36px rgba(0,0,0,.18);

    /* Title pill — MATCH Preorder Categories */
    --pill-bg-{{ section.id }}: rgba(88, 92, 102, .48);
    --pill-bg-hover-{{ section.id }}: rgba(88, 92, 102, .58);
    --pill-border-{{ section.id }}: rgba(255,255,255,.28);
    --pill-border-hover-{{ section.id }}: rgba(255,255,255,.34);
    --pill-text-{{ section.id }}: #fff;

    /* sizes identical to the Preorder pill */
    --pill-fz-{{ section.id }}: clamp(1.25rem, 2.2vw, 1.6rem);
    --pill-pad-y-{{ section.id }}: .95rem;
    --pill-pad-x-{{ section.id }}: 1.6rem;
    --pill-letter-{{ section.id }}: .18px;
    --pill-lh-{{ section.id }}: 1.1;

    /* Modal (high-contrast) */
    --overlay-bg-{{ section.id }}: rgba(10,12,16,.72);
    --modal-bg-{{ section.id }}: #ffffff;
    --modal-border-{{ section.id }}: rgba(0,0,0,.10);
    --modal-shadow-{{ section.id }}: 0 40px 90px rgba(0,0,0,.30);
    --modal-text-{{ section.id }}: #1a1c1f;
  }

  @media (prefers-color-scheme: dark){
    #shopify-section-{{ section.id }}{
      --pill-bg-{{ section.id }}: rgba(88, 92, 102, .50);
      --pill-bg-hover-{{ section.id }}: rgba(88, 92, 102, .60);
      --pill-border-{{ section.id }}: rgba(255,255,255,.24);
      --pill-border-hover-{{ section.id }}: rgba(255,255,255,.32);

      --overlay-bg-{{ section.id }}: rgba(0,0,0,.72);
      --modal-bg-{{ section.id }}: #22272e;
      --modal-border-{{ section.id }}: rgba(255,255,255,.10);
      --modal-shadow-{{ section.id }}: 0 40px 90px rgba(0,0,0,.55);
      --modal-text-{{ section.id }}: #f3f4f6;
    }
  }

  /* ===== Title + actions (MATCH Preorder Category pill) ===== */
  #shopify-section-{{ section.id }} .collection__title{ text-align:center; }

  #shopify-section-{{ section.id }} .collection__title .title{
    padding: var(--pill-pad-y-{{ section.id }}) var(--pill-pad-x-{{ section.id }});
    font-size: var(--pill-fz-{{ section.id }}) !important;
    font-weight: 800;
    letter-spacing: var(--pill-letter-{{ section.id }});
    line-height: var(--pill-lh-{{ section.id }});

    position:relative; overflow:hidden; cursor:default;
    display:inline-flex; align-items:center; gap:.6rem;
    margin:0 auto .55rem;
    border-radius:999px;
    background:var(--pill-bg-{{ section.id }});
    border:1px solid var(--pill-border-{{ section.id }});
    color:var(--pill-text-{{ section.id }});
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    backdrop-filter: blur(12px) saturate(140%);
    box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 12px 22px rgba(0,0,0,.14);
    transition: transform .22s ease, background .22s ease, border-color .22s ease, box-shadow .22s ease;
  }

  #shopify-section-{{ section.id }} .collection__title .title::before{
    content:""; position:absolute; left:0; right:0; top:0; height:55%;
    background:linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,0));
    pointer-events:none; mix-blend:screen; opacity:.7;
  }

  #shopify-section-{{ section.id }} .collection__title .title::after{
    content:""; position:absolute; inset:-20%;
    transform:translateX(-120%) rotate(12deg);
    background:linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.22), rgba(255,255,255,0));
    filter:blur(4px); opacity:.55; pointer-events:none; transition: transform .7s ease;
  }

  @media (hover:hover){
    #shopify-section-{{ section.id }} .collection__title .title:hover{
      transform: translateY(-2px);
      background: var(--pill-bg-hover-{{ section.id }});
      border-color: var(--pill-border-hover-{{ section.id }});
      box-shadow: 0 0 0 1px rgba(255,255,255,.05) inset, 0 16px 30px rgba(0,0,0,.22);
    }
    #shopify-section-{{ section.id }} .collection__title .title:hover::after{
      transform:translateX(120%) rotate(12deg);
    }
  }

  #shopify-section-{{ section.id }} .title-actions{
    display:flex; justify-content:center; align-items:center; gap:.6rem; margin-top:.15rem;
  }

  /* “Pre-order info” button */
  #shopify-section-{{ section.id }} .info-btn{
    display:inline-flex; align-items:center; gap:.5rem;
    padding:.55rem 1rem; border-radius:999px;
    font-weight:800; letter-spacing:.01em;
    border:1px solid rgba(0,0,0,.06);
    background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,.65));
    color: var(--color-foreground);
    box-shadow: 0 10px 22px rgba(0,0,0,.10);
    cursor:pointer;
    min-height:44px; min-width:44px;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  }
  #shopify-section-{{ section.id }} .info-btn .ico{ width:16px; height:16px; display:inline-block; }
  #shopify-section-{{ section.id }} .info-btn:hover{
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(0,0,0,.14);
  }
  #shopify-section-{{ section.id }} .info-btn:focus-visible{
    outline: 3px solid rgba(59,130,246,.45); outline-offset: 3px;
  }

  /* ===== Modal (clear, high-contrast) ===== */
  #shopify-section-{{ section.id }} .fc-modal-overlay[hidden],
  #shopify-section-{{ section.id }} .fc-modal[hidden]{ display:none; }

  #shopify-section-{{ section.id }} .fc-modal-overlay{
    position:fixed; inset:0;
    background: var(--overlay-bg-{{ section.id }});
    z-index:998;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
  }

  #shopify-section-{{ section.id }} .fc-modal{
    position:fixed; inset:0; z-index:999;
    display:flex; align-items:center; justify-content:center;
    padding: 24px;
  }

  #shopify-section-{{ section.id }} .fc-modal__card{
    position:relative;
    width:min(92vw, 880px); max-height: 82vh; overflow:auto;
    background: var(--modal-bg-{{ section.id }});
    border:1px solid var(--modal-border-{{ section.id }});
    box-shadow: var(--modal-shadow-{{ section.id }});
    border-radius: 22px;
    padding: 28px 28px 22px;
    color: var(--modal-text-{{ section.id }});
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  #shopify-section-{{ section.id }} .fc-modal__header{
    display:flex; align-items:center; justify-content:flex-start; gap:1rem; margin-bottom:.6rem;
  }

  /* Title explicitly inherits modal text colour */
  #shopify-section-{{ section.id }} .fc-modal__title{
    margin:0;
    color: var(--modal-text-{{ section.id }});
    font-weight:900; letter-spacing:.01em;
    font-size: clamp(1.28rem, 2.2vw, 1.6rem);
    line-height:1.2;
  }

  /* Close button */
  #shopify-section-{{ section.id }} .fc-modal__close{
    position:absolute; top:10px; right:10px;
    width:44px; height:44px;
    display:inline-flex; align-items:center; justify-content:center;
    border-radius:999px;
    background:#ffffff;
    color:#111827;
    border:1px solid rgba(0,0,0,.10);
    font-size:26px; line-height:1; cursor:pointer;
    box-shadow:0 8px 20px rgba(0,0,0,.12);
  }
  @media (prefers-color-scheme: dark){
    #shopify-section-{{ section.id }} .fc-modal__close{
      background:#2b3139; color:#f3f4f6; border-color:rgba(255,255,255,.12);
    }
  }
  #shopify-section-{{ section.id }} .fc-modal__close:hover{ filter:brightness(1.05); }
  #shopify-section-{{ section.id }} .fc-modal__close:focus-visible{
    outline:3px solid rgba(59,130,246,.55); outline-offset:3px;
  }

  #shopify-section-{{ section.id }} .fc-modal__body{
    font-size: clamp(1.08rem, 1.4vw, 1.2rem);
    line-height: 1.8;
    opacity: .98;
  }

  /* ===== Cards ===== */
  #shopify-section-{{ section.id }} .product-grid .card-wrapper{ height:100%; }
  #shopify-section-{{ section.id }} .product-grid .card{
    border-radius:var(--fc-radius-{{ section.id }});
    overflow:hidden;
    box-shadow:var(--fc-shadow-{{ section.id }});
    transition:transform .22s ease, box-shadow .22s ease, border-color .22s ease;
    background:var(--color-background);
    contain: layout paint;
  }
  #shopify-section-{{ section.id }} .product-grid .card:hover{
    transform:translateY(-4px);
    box-shadow:var(--fc-shadow-hover-{{ section.id }});
  }
  {% if section.settings.image_shape == 'default' %}
  #shopify-section-{{ section.id }} .product-grid .card__inner,
  #shopify-section-{{ section.id }} .product-grid .card__media,
  #shopify-section-{{ section.id }} .product-grid .media,
  #shopify-section-{{ section.id }} .product-grid .media > *{
    border-top-left-radius:var(--fc-img-radius-{{ section.id }});
    border-top-right-radius:var(--fc-img-radius-{{ section.id }});
    overflow:hidden;
  }
  {% endif %}
  #shopify-section-{{ section.id }} .product-grid .media img,
  #shopify-section-{{ section.id }} .product-grid img.motion-reduce{
    width:100%; height:100%; object-fit:cover; object-position:center;
  }
  #shopify-section-{{ section.id }} .product-grid .card__content{ padding:12px 16px 14px; }
  #shopify-section-{{ section.id }} .product-grid .card__information{ padding:0; }
  #shopify-section-{{ section.id }} .product-grid .card-information{ display:block; margin-top:2px; }
  #shopify-section-{{ section.id }} .product-grid .card__heading{ margin:0 0 6px; }
  #shopify-section-{{ section.id }} .product-grid .card__heading .full-unstyled-link{
    display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden;
    min-height:2.6em;
    color:var(--color-foreground) !important;
    font-weight:900; font-size:clamp(1.08rem,1.9vw,1.32rem); line-height:1.3;
    text-decoration:none; word-break:break-word;
  }
  #shopify-section-{{ section.id }} .product-grid .price{ margin-top:6px; color:var(--color-foreground) !important; line-height:1.28; }
  #shopify-section-{{ section.id }} .product-grid .price .price-item{
    color:var(--color-foreground) !important; font-weight:900; font-size:clamp(1.04rem,1.6vw,1.24rem);
  }
  #shopify-section-{{ section.id }} .product-grid .price .price-override{
    display:inline-block; font-weight:900; font-size:clamp(1.04rem,1.6vw,1.24rem);
    color:var(--color-foreground);
  }

  /* ===== View-all button (glass pill) ===== */
  #shopify-section-{{ section.id }} .collection__view-all .button{
    display:inline-flex; align-items:center; justify-content:center;
    gap:.5rem; padding:.65rem 1.15rem;
    border-radius:999px !important;
    background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,.65)) !important;
    border:0 !important;
    color: var(--color-foreground) !important;
    font-weight:800; letter-spacing:.01em;
    -webkit-backdrop-filter: blur(8px) saturate(120%);
    backdrop-filter: blur(8px) saturate(120%);
    box-shadow: 0 10px 22px rgba(0,0,0,.10);
    transition: transform .15s ease, box-shadow .15s ease;
    text-decoration:none;
    min-height:44px;
  }
  #shopify-section-{{ section.id }} .collection__view-all .button::before,
  #shopify-section-{{ section.id }} .collection__view-all .button::after{ content:none !important; display:none !important; }
  #shopify-section-{{ section.id }} .collection__view-all .button:hover{
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(0,0,0,.14);
  }
  #shopify-section-{{ section.id }} .collection__view-all .button:focus-visible{
    outline:3px solid rgba(59,130,246,.45); outline-offset:3px;
  }

  /* ===== Reveal-on-scroll (restored) ===== */
  #shopify-section-{{ section.id }} .js-reveal-{{ section.id }}{
    opacity:0; transform: translateY(12px);
    transition: opacity .45s ease, transform .45s ease;
    transition-delay: var(--delay, 0s);
    will-change: opacity, transform;
  }
  #shopify-section-{{ section.id }} .js-reveal-{{ section.id }}.is-visible{
    opacity:1; transform: none;
  }

  @media (prefers-reduced-motion: reduce){
    #shopify-section-{{ section.id }} .product-grid .card,
    #shopify-section-{{ section.id }} .collection__view-all .button,
    #shopify-section-{{ section.id }} .collection__title .title{ transition:none; }
    #shopify-section-{{ section.id }} .collection__title .title::after{ display:none; }
    #shopify-section-{{ section.id }} .js-reveal-{{ section.id }}{ opacity:1; transform:none; transition:none; }
  }
{%- endstyle -%}

{%- liquid
  assign products_to_display = section.settings.collection.all_products_count

  if section.settings.collection.all_products_count > section.settings.products_to_show
    assign products_to_display = section.settings.products_to_show
    assign more_in_collection = true
  endif

  assign columns_mobile_int = section.settings.columns_mobile | plus: 0
  assign columns_desktop_int = section.settings.columns_desktop | plus: 0
  assign show_mobile_slider = false
  if section.settings.swipe_on_mobile and products_to_display > columns_mobile_int
    assign show_mobile_slider = true
  endif

  assign max_columns_to_show = columns_mobile_int
  if columns_desktop_int > columns_mobile_int
    assign max_columns_to_show = columns_desktop_int
  endif

  assign show_desktop_slider = false
  if section.settings.enable_desktop_slider and products_to_display > section.settings.columns_desktop
    assign show_desktop_slider = true
  endif

  assign show_desc_content = false
  if section.settings.description != blank
    assign show_desc_content = true
  elsif section.settings.show_description and section.settings.collection.description != empty
    assign show_desc_content = true
  endif
-%}

<div class="color-{{ section.settings.color_scheme }} isolate gradient">
  <div
    class="collection{% if section.settings.quick_add == 'bulk' %} collection-quick-add-bulk{% endif %} section-{{ section.id }}-padding{% if section.settings.full_width %} collection--full-width{% endif %}"
    id="collection-{{ section.id }}"
    data-id="{{ section.id }}"
  >
    <div class="collection__title title-wrapper title-wrapper--no-top-margin page-width{% if show_mobile_slider %} title-wrapper--self-padded-tablet-down{% endif %}{% if show_desktop_slider %} collection__title--desktop-slider{% endif %}">
      {%- if section.settings.title != blank -%}
        <h2 class="title inline-richtext {{ section.settings.heading_size }}{% if settings.animations_reveal_on_scroll %} scroll-trigger animate--slide-in{% endif %} js-reveal-{{ section.id }}">
          {{ section.settings.title }}
        </h2>
      {%- endif -%}

      {% if show_desc_content %}
        <div class="title-actions{% if settings.animations_reveal_on_scroll %} scroll-trigger animate--slide-in{% endif %} js-reveal-{{ section.id }}" style="--delay:.06s;">
          <button type="button"
                  id="InfoOpen-{{ section.id }}"
                  class="info-btn"
                  aria-haspopup="dialog"
                  aria-expanded="false"
                  aria-controls="InfoModal-{{ section.id }}">
            <svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
              <circle cx="12" cy="12" r="10" fill="none" stroke="currentColor" stroke-width="2"/>
              <line x1="12" y1="10" x2="12" y2="17" stroke="currentColor" stroke-width="2"/>
              <circle cx="12" cy="7" r="1.5" fill="currentColor"/>
            </svg>
            Pre-order info
          </button>
        </div>
      {% endif %}
    </div>

    <slider-component class="slider-mobile-gutter{% if section.settings.full_width %} slider-component-full-width{% endif %}{% if show_mobile_slider == false %} page-width{% endif %}{% if show_desktop_slider == false and section.settings.full_width == false %} page-width-desktop{% endif %}{% if show_desktop_slider %} slider-component-desktop{% endif %}{% if settings.animations_reveal_on_scroll %} scroll-trigger animate--slide-in{% endif %} js-reveal-{{ section.id }}" style="--delay:.1s;">
      <ul
        id="Slider-{{ section.id }}"
        data-id="{{ section.id }}"
        class="grid product-grid contains-card contains-card--product{% if settings.card_style == 'standard' %} contains-card--standard{% endif %} grid--{{ section.settings.columns_desktop }}-col-desktop{% if section.settings.collection == blank %} grid--2-col-tablet-down{% else %} grid--{{ section.settings.columns_mobile }}-col-tablet-down{% endif %}{% if show_mobile_slider or show_desktop_slider %} slider{% if show_desktop_slider %} slider--desktop{% endif %}{% if show_mobile_slider %} slider--tablet grid--peek{% endif %}{% endif %}"
        role="list"
        aria-label="{{ 'general.slider.name' | t }}"
      >
        {% assign skip_card_product_styles = false %}

        {%- if section.settings.collection.products.size > 0 -%}
          {% assign lazy_load = false %}
          {% paginate section.settings.collection.products by section.settings.products_to_show %}
            {%- for product in section.settings.collection.products limit: section.settings.products_to_show -%}
              {% if lazy_load == false and forloop.index > max_columns_to_show %}
                {% assign lazy_load = true %}
              {% endif %}
              <li
                id="Slide-{{ section.id }}-{{ forloop.index }}"
                class="grid__item{% if show_mobile_slider or show_desktop_slider %} slider__slide{% endif %}{% if settings.animations_reveal_on_scroll %} scroll-trigger animate--slide-in{% endif %} js-reveal-{{ section.id }}"
                {% if settings.animations_reveal_on_scroll %}
                  data-cascade
                  style="--animation-order: {{ forloop.index }}; --delay: calc({{ forloop.index }} * 90ms);"
                {% else %}
                  style="--delay: calc({{ forloop.index }} * 90ms);"
                {% endif %}
              >
                {% render 'card-product',
                  card_product: product,
                  media_aspect_ratio: section.settings.image_ratio,
                  image_shape: section.settings.image_shape,
                  lazy_load: lazy_load,
                  show_secondary_image: section.settings.show_secondary_image,
                  show_vendor: section.settings.show_vendor,
                  show_rating: section.settings.show_rating,
                  skip_styles: skip_card_product_styles,
                  section_id: section.id,
                  quick_add: section.settings.quick_add
                %}
              </li>
              {%- assign skip_card_product_styles = true -%}
            {%- endfor -%}
          {% endpaginate %}
        {%- else -%}
          {%- for i in (1..section.settings.columns_desktop) -%}
            <li
              class="grid__item{% if settings.animations_reveal_on_scroll %} scroll-trigger animate--slide-in{% endif %} js-reveal-{{ section.id }}"
              {% if settings.animations_reveal_on_scroll %}
                data-cascade
                style="--animation-order: {{ forloop.index }}; --delay: calc({{ forloop.index }} * 90ms);"
              {% else %}
                style="--delay: calc({{ forloop.index }} * 90ms);"
              {% endif %}
            >
              {% liquid
                assign ridx = forloop.rindex
                case ridx
                  when 5 then assign ridx = 1
                  when 6 then assign ridx = 2
                endcase
              %}
              {%- assign placeholder_image = 'product-apparel-' | append: ridx -%}
              {% render 'card-product',
                show_vendor: section.settings.show_vendor,
                media_aspect_ratio: section.settings.image_ratio,
                image_shape: section.settings.image_shape,
                lazy_load: false,
                placeholder_image: placeholder_image
              %}
            </li>
          {%- endfor -%}
        {%- endif -%}
      </ul>

      {%- if show_mobile_slider or show_desktop_slider -%}
        <div class="slider-buttons">
          <button
            type="button"
            class="slider-button slider-button--prev"
            name="previous"
            aria-label="{{ 'general.slider.previous_slide' | t }}"
            aria-controls="Slider-{{ section.id }}"
          >
            <span class="svg-wrapper">{{- 'icon-caret.svg' | inline_asset_content -}}</span>
          </button>
          <div class="slider-counter caption">
            <span class="slider-counter--current">1</span>
            <span aria-hidden="true"> / </span>
            <span class="visually-hidden">{{ 'general.slider.of' | t }}</span>
            <span class="slider-counter--total">{{ products_to_display }}</span>
          </div>
          <button
            type="button"
            class="slider-button slider-button--next"
            name="next"
            aria-label="{{ 'general.slider.next_slide' | t }}"
            aria-controls="Slider-{{ section.id }}"
          >
            <span class="svg-wrapper">{{- 'icon-caret.svg' | inline_asset_content -}}</span>
          </button>
        </div>
      {%- endif -%}
    </slider-component>

    {%- if section.settings.show_view_all and more_in_collection -%}
      <div class="center collection__view-all{% if settings.animations_reveal_on_scroll %} scroll-trigger animate--slide-in{% endif %} js-reveal-{{ section.id }}" style="--delay:.12s;">
        <a
          href="{{ section.settings.collection.url }}"
          class="button"
          aria-label="{{ 'sections.featured_collection.view_all_label' | t: collection_name: section.settings.collection.title | escape }}"
        >
          {{ 'sections.featured_collection.view_all' | t }}
        </a>
      </div>
    {%- endif -%}

    {% comment %} Modal with description content {% endcomment %}
    {% if show_desc_content %}
      <div class="fc-modal-overlay" id="InfoOverlay-{{ section.id }}" hidden></div>
      <div class="fc-modal" id="InfoModal-{{ section.id }}" role="dialog" aria-modal="true" aria-labelledby="InfoTitle-{{ section.id }}" hidden>
        <div class="fc-modal__card">
          <div class="fc-modal__header">
            <h3 id="InfoTitle-{{ section.id }}" class="fc-modal__title">Pre-order information</h3>
            <button type="button" class="fc-modal__close" id="InfoClose-{{ section.id }}" aria-label="Close">×</button>
          </div>
          <div class="fc-modal__body rte" id="InfoDesc-{{ section.id }}">
            {%- if section.settings.show_description -%}
              {{ section.settings.collection.description }}
            {%- else -%}
              {{ section.settings.description -}}
            {%- endif %}
          </div>
        </div>
      </div>
    {% endif %}

    {% if section.settings.image_shape == 'arch' %}
      {{ 'mask-arch.svg' | inline_asset_content }}
    {%- endif -%}
  </div>
</div>

<script>
  document.addEventListener('DOMContentLoaded', function () {
    var root = document.getElementById('collection-{{ section.id }}');
    if (!root) return;

    /* Replace "£0.00" with visible "From £8" but keep semantic price for SRs */
    var overrideText = 'From £8';
    root.querySelectorAll('.price').forEach(function (node) {
      if (node.getAttribute('data-price-override-applied') === 'true') return;
      var plain = (node.textContent || '').replace(/\s+/g,' ').trim();
      var zero = /£\s*0(?:\.00)?(?:\s*GBP)?$/i.test(plain) || /^0(?:\.00)?\s*GBP$/i.test(plain);
      if (zero) {
        var original = node.innerHTML;
        node.innerHTML =
          '<span class="visually-hidden">' + original + '</span>' +
          '<span class="price-override" aria-hidden="true">' + overrideText + '</span>';
        node.setAttribute('data-price-override-applied', 'true');
      }
    });

    /* Make the whole card clickable (except interactive controls) */
    root.querySelectorAll('.card').forEach(function(card){
      card.addEventListener('click', function(e){
        if (e.defaultPrevented) return;
        if (e.target.closest('a,button,input,select,textarea,[role="button"],.quantity,.quick-add')) return;
        var link = card.querySelector('.card__heading a');
        if (link && link.href) { window.location.href = link.href; }
      }, { passive: true });
      card.style.cursor = 'pointer';
    });

    /* Modal behaviour with focus restore */
    var btnOpen  = document.getElementById('InfoOpen-{{ section.id }}');
    var modal    = document.getElementById('InfoModal-{{ section.id }}');
    var overlay  = document.getElementById('InfoOverlay-{{ section.id }}');
    var btnClose = document.getElementById('InfoClose-{{ section.id }}');
    var lastFocused = null;

    function trapFocus(e){
      if (!modal || modal.hidden) return;
      var focusables = modal.querySelectorAll('a,button,input,select,textarea,[tabindex]:not([tabindex="-1"])');
      focusables = Array.prototype.slice.call(focusables).filter(function(el){ return !el.hasAttribute('disabled'); });
      if (focusables.length === 0) return;
      var first = focusables[0], last = focusables[focusables.length - 1];
      if (e.key === 'Tab'){
        if (e.shiftKey && document.activeElement === first){ last.focus(); e.preventDefault(); }
        else if (!e.shiftKey && document.activeElement === last){ first.focus(); e.preventDefault(); }
      }
    }

    function openModal(){
      if (!modal || !overlay) return;
      lastFocused = document.activeElement;
      modal.hidden = false; overlay.hidden = false;
      document.body.style.overflow = 'hidden';
      document.addEventListener('keydown', trapFocus, true);
      var card = modal.querySelector('.fc-modal__card');
      (btnClose || card || modal).focus({preventScroll:true});
      if (btnOpen) btnOpen.setAttribute('aria-expanded', 'true');
    }
    function closeModal(){
      if (!modal || !overlay) return;
      modal.hidden = true; overlay.hidden = true;
      document.body.style.overflow = '';
      document.removeEventListener('keydown', trapFocus, true);
      if (btnOpen) btnOpen.setAttribute('aria-expanded', 'false');
      if (lastFocused && typeof lastFocused.focus === 'function'){ lastFocused.focus({preventScroll:true}); }
    }
    if (btnOpen){ btnOpen.addEventListener('click', openModal, { passive: true }); }
    if (btnClose){ btnClose.addEventListener('click', closeModal, { passive: true }); }
    if (overlay){ overlay.addEventListener('click', closeModal, { passive: true }); }
    document.addEventListener('keydown', function(e){
      if (e.key === 'Escape' && modal && !modal.hidden) closeModal();
    }, { passive: true });

    /* Reveal-on-scroll fallback */
    var reduceMotion = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
    var revealEls = root.querySelectorAll('.js-reveal-{{ section.id }}');
    if (reduceMotion) {
      revealEls.forEach(function(el){ el.classList.add('is-visible'); });
      return;
    }
    if ('IntersectionObserver' in window) {
      var io = new IntersectionObserver(function(entries){
        entries.forEach(function(entry){
          if (entry.isIntersecting){
            var el = entry.target;
            el.classList.add('is-visible');
            io.unobserve(el);
          }
        });
      }, { root:null, rootMargin:'0px 0px -10% 0px', threshold:0.15 });
      revealEls.forEach(function(el){ io.observe(el); });
    } else {
      revealEls.forEach(function(el){ el.classList.add('is-visible'); });
    }
  });
</script>

{% schema %}
{
  "name": "t:sections.featured-collection.name",
  "tag": "section",
  "class": "section",
  "disabled_on": { "groups": ["header", "footer"] },
  "settings": [
    { "type": "collection", "id": "collection", "label": "t:sections.featured-collection.settings.collection.label" },
    { "type": "range", "id": "products_to_show", "min": 2, "max": 25, "step": 1, "default": 4, "label": "t:sections.featured-collection.settings.products_to_show.label" },
    { "type": "header", "content": "t:sections.featured-collection.settings.header_text.content" },
    { "type": "inline_richtext", "id": "title", "default": "t:sections.featured-collection.settings.title.default", "label": "t:sections.featured-collection.settings.title.label" },
    {
      "type": "select", "id": "heading_size",
      "options": [
        { "value": "h2", "label": "t:sections.all.heading_size.options__1.label" },
        { "value": "h1", "label": "t:sections.all.heading_size.options__2.label" },
        { "value": "h0", "label": "t:sections.all.heading_size.options__3.label" },
        { "value": "hxl", "label": "t:sections.all.heading_size.options__4.label" },
        { "value": "hxxl","label": "t:sections.all.heading_size.options__5.label" }
      ],
      "default": "h1", "label": "t:sections.all.heading_size.label"
    },
    { "type": "richtext", "id": "description", "label": "t:sections.featured-collection.settings.description.label" },
    { "type": "checkbox", "id": "show_description", "label": "t:sections.featured-collection.settings.show_description.label", "default": false },
    { "type": "select", "id": "description_style", "label": "t:sections.featured-collection.settings.description_style.label",
      "options": [
        { "value": "body", "label": "t:sections.featured-collection.settings.description_style.options__1.label" },
        { "value": "subtitle", "label": "t:sections.featured-collection.settings.description_style.options__2.label" },
        { "value": "uppercase", "label": "t:sections.featured-collection.settings.description_style.options__3.label" }
      ],
      "default": "body"
    },
    { "type": "header", "content": "t:sections.featured-collection.settings.header_collection.content" },
    { "type": "range", "id": "columns_desktop", "min": 1, "max": 6, "step": 1, "default": 4, "label": "t:sections.featured-collection.settings.columns_desktop.label" },
    { "type": "checkbox", "id": "enable_desktop_slider", "label": "t:sections.featured-collection.settings.enable_desktop_slider.label", "default": false },
    { "type": "checkbox", "id": "full_width", "label": "t:sections.featured-collection.settings.full_width.label", "default": false },
    { "type": "checkbox", "id": "show_view_all", "default": true, "label": "t:sections.featured-collection.settings.show_view_all.label", "info": "t:sections.featured-collection.settings.show_view_all.info" },
    { "type": "color_scheme", "id": "color_scheme", "label": "t:sections.all.colors.label", "info": "t:sections.all.colors.has_cards_info", "default": "scheme-1" },
    { "type": "header", "content": "t:sections.featured-collection.settings.header.content" },
    { "type": "select", "id": "image_ratio",
      "options": [
        { "value": "adapt", "label": "t:sections.featured-collection.settings.image_ratio.options__1.label" },
        { "value": "portrait", "label": "t:sections.featured-collection.settings.image_ratio.options__2.label" },
        { "value": "square", "label": "t:sections.featured-collection.settings.image_ratio.options__3.label" }
      ],
      "default": "adapt", "label": "t:sections.featured-collection.settings.image_ratio.label"
    },
    { "type": "select", "id": "image_shape",
      "options": [
        { "value": "default", "label": "t:sections.all.image_shape.options__1.label" },
        { "value": "arch", "label": "t:sections.all.image_shape.options__2.label" },
        { "value": "blob", "label": "t:sections.all.image_shape.options__3.label" },
        { "value": "chevronleft", "label": "t:sections.all.image_shape.options__4.label" },
        { "value": "chevronright", "label": "t:sections.all.image_shape.options__5.label" },
        { "value": "diamond", "label": "t:sections.all.image_shape.options__6.label" },
        { "value": "parallelogram", "label": "t:sections.all.image_shape.options__7.label" },
        { "value": "round", "label": "t:sections.all.image_shape.options__8.label" }
      ],
      "default": "default", "label": "t:sections.all.image_shape.label"
    },
    { "type": "checkbox", "id": "show_secondary_image", "default": false, "label": "t:sections.featured-collection.settings.show_secondary_image.label" },
    { "type": "checkbox", "id": "show_vendor", "default": false, "label": "t:sections.featured-collection.settings.show_vendor.label" },
    { "type": "checkbox", "id": "show_rating", "default": false, "label": "t:sections.featured-collection.settings.show_rating.label", "info": "t:sections.featured-collection.settings.show_rating.info" },
    { "type": "select", "id": "quick_add", "default": "none", "label": "t:sections.main-collection-product-grid.settings.quick_add.label",
      "options": [
        { "value": "none", "label": "t:sections.main-collection-product-grid.settings.quick_add.options.option_1" },
        { "value": "standard", "label": "t:sections.main-collection-product-grid.settings.quick_add.options.option_2" },
        { "value": "bulk", "label": "t:sections.main-collection-product-grid.settings.quick_add.options.option_3" }
      ]
    },
    { "type": "header", "content": "t:sections.featured-collection.settings.header_mobile.content" },
    { "type": "select", "id": "columns_mobile", "default": "2", "label": "t:sections.featured-collection.settings.columns_mobile.label",
      "options": [
        { "value": "1", "label": "t:sections.featured-collection.settings.columns_mobile.options__1.label" },
        { "value": "2", "label": "t:sections.featured-collection.settings.columns_mobile.options__2.label" }
      ]
    },
    { "type": "checkbox", "id": "swipe_on_mobile", "default": false, "label": "t:sections.featured-collection.settings.swipe_on_mobile.label" },
    { "type": "header", "content": "t:sections.all.padding.section_padding_heading" },
    { "type": "range", "id": "padding_top", "min": 0, "max": 100, "step": 4, "unit": "px", "label": "t:sections.all.padding.padding_top", "default": 36 },
    { "type": "range", "id": "padding_bottom", "min": 0, "max": 100, "step": 4, "unit": "px", "label": "t:sections.all.padding.padding_bottom", "default": 36 }
  ],
  "presets": [{ "name": "t:sections.featured-collection.presets.name" }]
}
{% endschema %}
