{% set copyright %}
<div class="text-sm">
  &copy; {{ 'now' | date('Y') }}
  {{ d__('theme', 'All rights reserved.') }}

  {% if option.business.name is defined and option.business.name is not empty %}
  <strong>{{ option.business.name }}</strong>
  {% elseif option.site.name is defined and option.site.name is not empty %}
  <strong>{{ option.site.name }}</strong>
  {% endif %}
</div>
{% endset %}

<footer class="mb-10 xl:mb-28 wrapper enter">
  <div class="p-12 bg-contrast-secondary">
    <div class="items-start justify-between gap-20 md:flex">
      <div>
        <img
          src="{{ option.brand.alternative_logo_dark ?? option.brand.logo_dark ?? '/assets/logo-light.svg' }}"
          alt="{{ option.site.name ?? 'Logo'  }}"
          class="hidden group-data-[mode=dark]/html:block max-w-[140px]">

        <img
          src="{{ option.brand.alternative_logo ?? option.brand.logo ?? '/assets/logo-dark.svg' }}"
          alt="{{ option.site.name ?? 'Logo'  }}"
          class="block group-data-[mode=dark]/html:hidden  max-w-[140px]">

        <div class="mt-6">
          {% if option.business is not defined and option.links is not defined %}
          {{ copyright }}
          {% elseif option.business.address is defined and option.business.address is not empty %}
          <address class="not-italic">
            {{ option.business.address|nl2br }}
          </address>
          {% endif %}
        </div>
      </div>

      <nav class="flex items-start gap-20 mt-6 font-bold md:mt-0">
        <ul class="flex flex-col gap-4">
          <li>
            <a href="/#product">{{ dp__('theme', 'button', 'Product') }}</a>
          </li>

          <li>
            <a href="/#pricing">{{ dp__('theme', 'button', 'Pricing') }}</a>
          </li>

          <li>
            <a href="/#faq">{{ dp__('theme', 'button', 'FAQ') }}</a>
          </li>
        </ul>

        <ul class="flex flex-col gap-4">
          {% if option.policies.tos is defined and option.policies.tos is not empty %}
          <li><a href="/policies/terms">
              {{ dp__('theme', 'button', 'Terms of services')  }}
            </a></li>
          {% endif %}

          {% if option.policies.privacy is defined and option.policies.privacy is not empty %}
          <li><a href="/policies/privacy">
              {{ dp__('theme', 'button', 'Privacy policy')  }}
            </a></li>
          {% endif %}

          {% if option.policies.refund is defined and option.policies.refund is not empty %}
          <li><a href="/policies/refund">
              {{ dp__('theme', 'button', 'Refund policy')  }}
            </a></li>
          {% endif %}
        </ul>
      </nav>
    </div>

    {% if option.business is defined or option.links is defined %}
    <div
      class="items-center justify-between gap-20 mt-12 md:flex text-secondary">
      {{ copyright }}

      <ul class="flex items-center gap-4 mt-6 md:mt-0">
        {% set links = ['x', 'facebook', 'instagram', 'tiktok', 'discord', 'linkedin', 'youtube', 'github', 'telegram', 'vk'] %}

        {% for link in links %}
        {% if option.links[link] is defined and option.links[link] is not empty  %}
        <li>
          <a href="{{ option.links[link]|e('html_attr') }}" target="_blank"
            class="transition-all hover:no-underline hover:text-primary"
            aria-label="{{ link|capitalize }}">
            <i class="text-lg ti ti-brand-{{ link }}"></i>
          </a>
        </li>
        {% endif %}
        {% endfor %}
      </ul>
    </div>
    {% endif %}
  </div>
</footer>