/** Shopify CDN: Minification failed

Line 16:0 Unexpected "{"
Line 16:1 Expected identifier but found "%"
Line 17:32 Unexpected "("
Line 21:1 Expected identifier but found "%"
Line 23:0 Unexpected "{"
Line 23:1 Unexpected "{"
Line 23:3 Expected identifier but found "'component-slider.css'"
Line 25:0 Unexpected "{"
Line 25:1 Expected identifier but found "%"
Line 26:12 Unexpected "{"
... and 175 more hidden warnings

**/
{% comment %}
  GlobalBeauty — Testimonials (Dawn Slider)
  - Скрол на ревютата с вграден Shopify/Dawn <slider-component>
  - Без custom JS (ползва component-slider.js на темата)
  - Достъпност (ARIA), опционални стрелки и брояч
{% endcomment %}

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

{%- style -%}
  .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 (min-width: 750px) {
    .section-{{ section.id }}-padding {
      padding-top: {{ section.settings.padding_top }}px;
      padding-bottom: {{ section.settings.padding_bottom }}px;
    }
  }

  /* Карта/стилизация (минимум, може да пипнем към вашата палитра) */
  .gb-testimonial-card {
    height: 100%;
    border-radius: 12px;
    background: #fff;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
    border: 1px solid rgba(0,0,0,.06);
  }
  .gb-testimonial-head {
    display: flex; align-items: center; gap: 12px; margin-bottom: .75rem;
  }
  .gb-testimonial-photo, .gb-testimonial-photo--ph {
    width: 64px; height: 64px; border-radius: 50%; background:#f5f5f5; object-fit:cover; flex-shrink:0;
    border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.12);
  }
  .gb-testimonial-photo--ph { display:flex; align-items:center; justify-content:center; }
  .gb-testimonial-name { margin:0; font-weight:600; color:#222; }
  .gb-testimonial-meta { color:#666; font-size:.95rem; }
  .gb-testimonial-stars { margin:.25rem 0 .5rem; }
  .gb-star, .gb-star--empty { color:#ffc107; font-size:18px; letter-spacing:3px; }
  .gb-star--empty { color:#e0e0e0; }
  .gb-testimonial-text { margin:0; color:#333; line-height:1.6; }
  .gb-testimonial-logo { margin-left:auto; max-height:36px; object-fit:contain; }
  .gb-testimonial-link { display:inline-block; margin-top:.75rem; text-decoration:underline; }


  /* Опционални точки (ако решите да добавим — по подразбиране Dawn не слага точки тук) */

{%- endstyle -%}

{%- liquid
  assign blocks_count = section.blocks.size
  assign columns_mobile_int = section.settings.columns_mobile | plus: 0
  assign show_mobile_slider = false
  if blocks_count > columns_mobile_int
    if section.settings.swipe_on_mobile
      assign show_mobile_slider = true
    endif
  endif

  assign show_desktop_slider = false
  if blocks_count > section.settings.columns_desktop
    if section.settings.enable_desktop_slider
      assign show_desktop_slider = true
    endif
  endif
-%}

<section class="color-{{ section.settings.color_scheme }} isolate gradient section-{{ section.id }}-padding">
  <div class="page-width{% if show_mobile_slider %} page-width--narrow-mobile{% endif %}">
    <div class="title-wrapper title-wrapper--no-top-margin{% if show_desktop_slider %} collection__title--desktop-slider{% endif %}">
      {% if section.settings.title != blank %}
        <h2 class="title inline-richtext {{ section.settings.heading_size }}">{{ section.settings.title }}</h2>
      {% endif %}
      {% if section.settings.description != blank %}
        <div class="rte">{{ section.settings.description }}</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 %}">
      <ul
        id="Slider-{{ section.id }}"
        data-id="{{ section.id }}"
        class="grid contains-card grid--{{ section.settings.columns_desktop }}-col-desktop{% 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 %}{% else %} grid--{{ section.settings.columns_mobile }}-col-tablet-down{% endif %}"
        role="list"
        aria-label="Карусел с отзиви"
      >
        {% for block in section.blocks %}
          {% if block.type == 'testimonial' %}
            <li
              id="Slide-{{ section.id }}-{{ forloop.index }}"
              class="grid__item{% if show_mobile_slider or show_desktop_slider %} slider__slide{% endif %}"
              {{ block.shopify_attributes }}
            >
              <article class="gb-testimonial-card" role="group" aria-roledescription="slide">
                <div class="gb-testimonial-head">
                  {% if block.settings.author_image %}
                    <img class="gb-testimonial-photo"
                         src="{{ block.settings.author_image | img_url: '160x160', crop: 'center' }}"
                         alt="{{ block.settings.author_name | escape }}"
                         width="64" height="64" loading="lazy">
                  {% else %}
                    <div class="gb-testimonial-photo--ph" aria-hidden="true">
                      <svg width="28" height="28" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                        <path d="M12 11c2.21 0 4-1.79 4-4s-1.79-4-4-4S8 4.79 8 7s1.79 4 4 4Z" stroke="#aaa" stroke-width="2"/>
                        <path d="M4 21v-1c0-3.31 2.69-6 6-6h4c3.31 0 6 2.69 6 6v1" stroke="#aaa" stroke-width="2"/>
                      </svg>
                    </div>
                  {% endif %}

                  <div style="flex:1;min-width:0">
                    <h3 class="gb-testimonial-name">{{ block.settings.author_name }}</h3>
                    <div class="gb-testimonial-meta">
                      {% if block.settings.author_role %}{{ block.settings.author_role }}{% endif %}
                      {% if block.settings.company %}{% if block.settings.author_role %} · {% endif %}{{ block.settings.company }}{% endif %}
                      {% if block.settings.location %} · {{ block.settings.location }}{% endif %}
                      {% if block.settings.date %} · {{ block.settings.date }}{% endif %}
                    </div>
                  </div>

                  {% if block.settings.company_logo %}
                    <img class="gb-testimonial-logo"
                         src="{{ block.settings.company_logo | img_url: '200x' }}"
                         alt="Лого {{ block.settings.company | escape }}"
                         loading="lazy" height="36">
                  {% endif %}
                </div>

                {% if section.settings.show_rating %}
                  <div class="gb-testimonial-stars" aria-label="{{ block.settings.star_rating }} от 5">
                    {% assign full = block.settings.star_rating %}
                    {% assign empty = 5 | minus: block.settings.star_rating %}
                    {% for i in (1..full) %}<span class="gb-star">★</span>{% endfor %}
                    {% for i in (1..empty) %}<span class="gb-star--empty">★</span>{% endfor %}
                  </div>
                {% endif %}

                {% if block.settings.testimonial %}
                  <p class="gb-testimonial-text">{{ block.settings.testimonial }}</p>
                {% endif %}

                {% if block.settings.case_url %}
                  <a class="gb-testimonial-link" href="{{ block.settings.case_url }}" target="_blank" rel="noopener">
                    {{ block.settings.case_label | default: 'Вижте кейса' }}
                  </a>
                {% endif %}
              </article>
            </li>
          {% endif %}
        {% endfor %}
      </ul>

      {% if (show_mobile_slider or show_desktop_slider) and section.settings.show_arrows %}
        <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>
          {% if section.settings.show_counter %}
            <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">{{ blocks_count }}</span>
            </div>
          {% endif %}
          <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>
  </div>
</section>

{% comment %}
  SEO (по избор): AggregateRating за организацията
{% endcomment %}
{% assign total = 0 %}{% assign cnt = 0 %}
{% for b in section.blocks %}
  {% if b.type == 'testimonial' and b.settings.star_rating %}
    {% assign total = total | plus: b.settings.star_rating %}
    {% assign cnt = cnt | plus: 1 %}
  {% endif %}
{% endfor %}
{% if section.settings.show_rating and cnt > 0 %}
<script type="application/ld+json">
{
  "@context":"https://schema.org",
  "@type":"Organization",
  "name":"GlobalBeauty",
  "aggregateRating":{
    "@type":"AggregateRating",
    "ratingValue":"{{ total | divided_by: cnt | round: 1 }}",
    "reviewCount":"{{ cnt }}"
  }
}
</script>
{% endif %}

{% schema %}
{
  "name": "Отзиви (Dawn карусел)",
  "tag": "section",
  "class": "section",
  "disabled_on": { "groups": ["header","footer"] },
  "settings": [
    { "type": "inline_richtext", "id": "title", "label": "Заглавие", "default": "Отзиви от партньори" },
    { "type": "richtext", "id": "description", "label": "Описание" },

    {
      "type": "select",
      "id": "heading_size",
      "label": "Размер на заглавието",
      "options": [
        { "value": "h2", "label": "H2" },
        { "value": "h1", "label": "H1" },
        { "value": "h0", "label": "H0" }
      ],
      "default": "h2"
    },

    { "type": "checkbox", "id": "show_rating", "label": "Показвай рейтинг (звезди)", "default": true },

    { "type": "range", "id": "columns_desktop", "min": 1, "max": 3, "step": 1, "label": "Карти на ред (Desktop ≥ 990px)", "default": 3 },
    {
      "type": "select",
      "id": "columns_mobile",
      "label": "Карти на ред (Tablet/Mobile)",
      "options": [
        { "value": "1", "label": "1" },
        { "value": "2", "label": "2" }
      ],
      "default": "1"
    },

    { "type": "checkbox", "id": "swipe_on_mobile", "label": "Позволи swipe на мобилно", "default": true },
    { "type": "checkbox", "id": "enable_desktop_slider", "label": "Активирай карусел на десктоп", "default": true },

    { "type": "checkbox", "id": "show_arrows", "label": "Показвай стрелки", "default": true },
    { "type": "checkbox", "id": "show_counter", "label": "Показвай брояч", "default": true },

    { "type": "checkbox", "id": "full_width", "label": "Пълна ширина", "default": false },

    { "type": "color_scheme", "id": "color_scheme", "label": "Цветова схема", "default": "scheme-1" },

    { "type": "header", "content": "Отстояния" },
    { "type": "range", "id": "padding_top", "min": 0, "max": 100, "step": 4, "unit": "px", "label": "Горен отстъп", "default": 36 },
    { "type": "range", "id": "padding_bottom", "min": 0, "max": 100, "step": 4, "unit": "px", "label": "Долен отстъп", "default": 36 }
  ],
  "blocks": [
    {
      "type": "testimonial",
      "name": "Отзив",
      "settings": [
        { "type": "image_picker", "id": "author_image", "label": "Снимка" },
        { "type": "image_picker", "id": "company_logo", "label": "Лого на салон/фирма (по избор)" },

        { "type": "text", "id": "author_name", "label": "Име/инициали", "default": "Име, Фамилия" },
        { "type": "text", "id": "author_role", "label": "Роля/позиция" },
        { "type": "text", "id": "company", "label": "Салон/Компания" },
        { "type": "text", "id": "location", "label": "Град/Локация" },

        { "type": "range", "id": "star_rating", "min": 1, "max": 5, "step": 1, "label": "Оценка (звезди)", "default": 5 },
        { "type": "text", "id": "date", "label": "Дата (напр. 05.2025)" },

        { "type": "textarea", "id": "testimonial", "label": "Текст на отзива", "default": "Прекрасно партньорство и видими резултати." },

        { "type": "url", "id": "case_url", "label": "Линк към кейс (по избор)" },
        { "type": "text", "id": "case_label", "label": "Текст на линка", "default": "Вижте кейса" }
      ]
    }
  ],
  "presets": [{ "name": "Отзиви (карусел)" }]
}
{% endschema %}
