{% schema %}
{
  "name": "Avis Google Design",
  "tag": "section",
  "class": "section-google-avis",
  "settings": [
    {
      "type": "text",
      "id": "note",
      "label": "Note",
      "default": "4.9"
    },
    {
      "type": "text",
      "id": "nombre_avis",
      "label": "Nombre d’avis",
      "default": "15"
    },
    {
      "type": "text",
      "id": "lien_google",
      "label": "Lien vers Google Avis",
      "default": "https://g.page/r/xxxxxxxxxxxxx/review"
    }
  ],
  "presets": [
    {
      "name": "Bloc Avis Google Design"
    }
  ]
}
{% endschema %}

<style>
  .avis-google-box {
    background-color: #eaeaea;
    border-radius: 12px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    max-width: 700px;
    margin: 30px auto;
  }

  .avis-google-left {
    display: flex;
    flex-direction: column;
  }

  .avis-google-stars {
    color: #3d75bd;
    font-weight: bold;
    font-size: 18px;
  }

  .avis-google-count {
    font-size: 14px;
    color: #333;
  }

  .avis-google-logo img {
    height: 28px;
    width: auto;
    object-fit: contain;
  }
</style>

<a href="{{ section.settings.lien_google }}" target="_blank" rel="noopener" style="text-decoration: none; color: inherit;">
  <div class="avis-google-box">
    <div class="avis-google-left">
      <div class="avis-google-stars">
        {{ section.settings.note }}
      </div>
      <div class="avis-google-count">{{ section.settings.nombre_avis }} </div>
    </div>
    <div class="avis-google-logo">
      <img src="https://cdn.shopify.com/s/files/1/0887/2194/9006/files/Google__G__logo_svg.png?v=1751916618" alt="Logo Google">
    </div>
  </div>
</a>