{**
 * Copyright since 2007 PrestaShop SA and Contributors
 * PrestaShop is an International Registered Trademark & Property of PrestaShop SA
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License 3.0 (AFL-3.0)
 * that is bundled with this package in the file LICENSE.md.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/AFL-3.0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to https://devdocs.prestashop.com/ for more information.
 *
 * @author    PrestaShop SA and Contributors <contact@prestashop.com>
 * @copyright Since 2007 PrestaShop SA and Contributors
 * @license   https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
 *}

{* MÉRIDIAN — Bande newsletter (hook displayFooterBefore).
   Markup fidèle à la maquette « NewsletterBand » (.nlb), en conservant
   les champs et hooks PrestaShop : message d'état, displayNewsletterRegistration,
   consentement RGPD (displayGDPRConsent), conditions. *}
<div class="nlb" data-tone="surface" id="blockEmailSubscription_{$hookName}">
  <div class="mrd-container nlb-inner">

    <div class="nlb-copy">
      <h2 class="display" style="font-size:clamp(26px,3.4vw,42px);font-weight:500;line-height:1.04;margin:0">{l s='Rejoignez la Société' d='Shop.Theme.Global'}</h2>
      <p class="muted" style="font-size:15.5px;margin-top:12px;max-width:420px">{l s='Accès anticipé aux collections, ventes privées et quelques mots de l\'atelier. Rien de superflu.' d='Shop.Theme.Global'}</p>
    </div>

    <div class="nlb-form-wrap">
      <form action="{$urls.current_url}#blockEmailSubscription_{$hookName}" method="post">
        {if $msg}
          <p class="nlb-msg alert {if $nw_error}alert-danger{else}alert-success{/if}">{$msg}</p>
        {/if}

        {hook h='displayNewsletterRegistration'}

        <div class="nlb-field">
          <input type="email" name="email" value="{$value}" required
            placeholder="{l s='Votre adresse e-mail' d='Shop.Forms.Labels'}"
            aria-label="{l s='Adresse e-mail' d='Shop.Forms.Labels'}">
          <button type="submit" name="submitNewsletter" value="1" class="btn btn-primary">
            {l s='S\'inscrire' d='Shop.Theme.Actions'}
            <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><path d="M5 12h14M13 6l6 6-6 6"/></svg>
          </button>
        </div>

        {* Consentement RGPD : on privilégie le consentement officiel psgdpr s'il
           est actif ; sinon on affiche une case à cocher requise (fidèle maquette). *}
        {capture name='gdprHook'}{if isset($id_module)}{hook h='displayGDPRConsent' id_module=$id_module}{/if}{/capture}
        {if $smarty.capture.gdprHook|trim}
          <div class="nlb-gdpr-hook">{$smarty.capture.gdprHook nofilter}</div>
        {else}
          <label class="nlb-gdpr">
            <input type="checkbox" name="newsletter_consent" value="1" class="nlb-gdpr-input" required>
            <span class="nlb-gdpr-box" aria-hidden="true"><svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.8" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5"/></svg></span>
            <span class="nlb-gdpr-txt">{l s='J\'accepte de recevoir la newsletter et que mes données soient traitées à cette fin.' d='Shop.Theme.Global'}</span>
          </label>
        {/if}

        {if $conditions}
          <p class="nlb-note muted">{$conditions}</p>
        {/if}

        <input type="hidden" name="blockHookName" value="{$hookName}">
        <input type="hidden" name="action" value="0">
      </form>
    </div>

  </div>
</div>
