{% liquid if customer assign account_url = routes.account_url else assign account_url = routes.account_login_url endif if section.settings.promo_text != blank assign promo_text = section.settings.promo_text else assign promo_text = 'header.promo' | t endif %}
{% if promo_text != blank %}
{% if section.settings.promo_link != blank %} {{ promo_text }} {% else %}

{{ promo_text }}

{% endif %}
{% endif %}
{% stylesheet %} .header__logo-mark svg, .header__logo-image { display: block; width: 223px; height: auto; } .header__icon { display: flex; align-items: center; justify-content: center; } .header__icon svg { display: block; } .header__icon--menu svg { width: 30px; height: 30px; } .header__icon--search svg { width: 22px; height: 22px; } .header__icon--user svg { width: 22px; height: 22px; } .header__icon--bag svg { width: 30px; height: 30px; } .header__shell { z-index: 2; } .header__promo { position: relative; z-index: 1; } .header__caret-button { width: 10px; height: 10px; } .header__submenu { min-width: 280px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08); } .header__icon--caret { display: flex; transform: rotate(180deg); transition: transform 0.2s ease; } .header__icon--caret svg { width: 10px; height: 10px; } .header__item.is-open .header__icon--caret { transform: rotate(0deg); } .header__icon--close { display: none; position: relative; width: 18px; height: 18px; } .header__icon--close::before, .header__icon--close::after { content: ''; position: absolute; left: 0; top: 8px; width: 18px; height: 1.4px; background: #000; } .header__icon--close::before { transform: rotate(45deg); } .header__icon--close::after { transform: rotate(-45deg); } .header__account-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; } .header button, .header input { font: inherit; color: inherit; } .header input[type='search']::-webkit-search-decoration, .header input[type='search']::-webkit-search-cancel-button { appearance: none; } @media (min-width: 1120px) { .header__submenu::before { content: ''; position: absolute; top: -16px; left: 0; width: 100%; height: 16px; } .header__submenu { margin-top: 8px; } .header__item:hover > .header__submenu, .header__item:focus-within > .header__submenu, .header__item.is-open > .header__submenu { display: block; } } @media (max-width: 1119px) { .header__shell { position: relative; display: flex; align-items: center; height: 55px; padding: 0 10px; } .header__toggle { display: grid; position: relative; z-index: 50; order: 1; flex: 0 0 30px; } .header.is-menu-open .header__icon--menu { display: none; } .header.is-menu-open .header__icon--close { display: block; } .header__logo { position: absolute; top: 0; left: 50%; z-index: 1; display: flex; align-items: center; width: 150px; height: 55px; margin: 0; transform: translateX(-50%); } .header__logo-mark svg, .header__logo-image { width: 150px; } .header__search { position: absolute; top: 12px; right: 50px; z-index: 2; width: 30px; height: 30px; max-width: none; margin: 0; padding: 0; overflow: hidden; background: transparent; } .header__search-button { width: 30px; height: 30px; background-color: #9dd6c7; border-radius: 999px; } .header__icon--search svg { width: 14px; height: 14px; } .header__search-input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; } .header__search.is-open { top: 6px; right: 50px; left: 10px; z-index: 3; width: auto; height: 44px; overflow: visible; padding: 5px; background: #f8f8f8; } .header__search.is-open .header__search-input { position: static; width: auto; height: auto; margin: 0; padding: 0 12px; overflow: visible; clip: auto; white-space: normal; } .header__cart { position: absolute; top: 12px; right: 10px; z-index: 2; flex: 0 0 30px; width: 30px; height: 30px; } .header__icon--bag svg { width: 18px; height: 18px; } .header__nav { position: absolute; top: 100%; right: 0; left: 0; z-index: 40; display: none; pointer-events: auto; max-height: calc(100dvh - 90px); overflow: auto; background: #fff; padding: 8px 16px 28px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08); } .header__nav.is-open { display: flex; flex-direction: column; gap: 20px; } .header__menu { order: 1; flex-direction: column; align-items: stretch; gap: 20px; margin-top: 0; padding-top: 4px; } .header__links { flex-direction: column; align-items: stretch; gap: 0; } .header__links .header__item { flex-wrap: wrap; justify-content: space-between; width: 100%; padding: 14px 0; border-bottom: 1px solid #ececec; } .header__caret-button { width: 32px; height: 32px; } .header__nav .header__submenu { position: static; top: auto; left: auto; z-index: auto; flex: 0 0 100%; min-width: 0; width: 100%; margin: 8px 0 0; padding: 4px 0 8px; background: transparent; border-radius: 0; box-shadow: none; } .header__nav .header__item.is-open > .header__submenu { display: flex; flex-direction: column; gap: 12px; } .header__pills { flex-wrap: wrap; gap: 10px; } .header__utility { order: 2; flex-direction: column; align-items: flex-start; gap: 8px; margin-right: 0; } .header__utility > ul { flex-direction: column; align-items: flex-start; gap: 4px; } .header__account { width: auto; height: auto; justify-content: flex-start; gap: 10px; padding: 10px 20px 10px 0; } .header__account-label { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; white-space: normal; } .header__promo { height: 30px; } .header__promo a, .header__promo p { font-size: 14px; } .header.is-menu-open .header__shell { z-index: 3; } .header.is-menu-open .header__backdrop { z-index: 1; display: block; } } @media (max-width: 380px) { .header__logo, .header__logo-mark svg, .header__logo-image { width: 128px; } } {% endstylesheet %} {% javascript %} (() => { if (window.__seasonHeader) return; window.__seasonHeader = true; const mobileQuery = window.matchMedia('(max-width: 1119px)'); const closeMenu = (header) => { const menu = header.querySelector('[data-menu]'); const toggle = header.querySelector('[data-menu-toggle]'); menu?.classList.remove('is-open'); header.classList.remove('is-menu-open'); toggle?.setAttribute('aria-expanded', 'false'); if (toggle) toggle.setAttribute('aria-label', toggle.dataset.labelOpen || ''); document.documentElement.classList.remove('overflow-hidden'); }; const closeSearch = (header) => { header.querySelector('[data-search]')?.classList.remove('is-open'); }; const bind = (header) => { if (header.dataset.ready === 'true') return; header.dataset.ready = 'true'; const toggle = header.querySelector('[data-menu-toggle]'); const menu = header.querySelector('[data-menu]'); const searchForm = header.querySelector('[data-search]'); const searchInput = header.querySelector('[data-search-input]'); const backdrop = header.querySelector('[data-menu-backdrop]'); if (toggle) { toggle.dataset.labelOpen = toggle.getAttribute('aria-label') || ''; toggle.dataset.labelClose = header.dataset.menuClose || toggle.dataset.labelOpen; } toggle?.addEventListener('click', () => { const willOpen = !menu.classList.contains('is-open'); closeSearch(header); menu.classList.toggle('is-open', willOpen); header.classList.toggle('is-menu-open', willOpen); toggle.setAttribute('aria-expanded', willOpen ? 'true' : 'false'); toggle.setAttribute('aria-label', willOpen ? toggle.dataset.labelClose : toggle.dataset.labelOpen); document.documentElement.classList.toggle('overflow-hidden', willOpen); }); backdrop?.addEventListener('click', () => closeMenu(header)); searchForm?.addEventListener('submit', (event) => { if (!mobileQuery.matches || searchForm.classList.contains('is-open')) return; event.preventDefault(); closeMenu(header); searchForm.classList.add('is-open'); searchInput?.focus(); }); menu?.addEventListener('click', (event) => { const submenuToggle = event.target.closest('[data-submenu-toggle]'); const toggleSubmenu = (submenuToggle) => { const item = submenuToggle.closest('[data-menu-item]'); const expanded = submenuToggle.getAttribute('aria-expanded') === 'true'; item.parentElement.querySelectorAll('[data-menu-item].is-open').forEach((sibling) => { if (sibling === item) return; sibling.classList.remove('is-open'); sibling.querySelector('[data-submenu-toggle]')?.setAttribute('aria-expanded', 'false'); }); item.classList.toggle('is-open', !expanded); submenuToggle.setAttribute('aria-expanded', expanded ? 'false' : 'true'); }; if (submenuToggle) { event.preventDefault(); toggleSubmenu(submenuToggle); return; } const parentLink = event.target.closest('[data-menu-item] > a'); if (mobileQuery.matches && parentLink) { const submenuToggleForLink = parentLink.parentElement.querySelector('[data-submenu-toggle]'); if (submenuToggleForLink) { event.preventDefault(); toggleSubmenu(submenuToggleForLink); return; } } if (mobileQuery.matches && event.target.closest('a')) closeMenu(header); }); }; document.querySelectorAll('[data-header]').forEach((header) => { header.dataset.menuClose = header.getAttribute('data-menu-close') || ''; bind(header); }); document.addEventListener('click', (event) => { document.querySelectorAll('[data-header]').forEach((header) => { if (header.contains(event.target)) return; closeMenu(header); closeSearch(header); }); }); document.addEventListener('keydown', (event) => { if (event.key !== 'Escape') return; document.querySelectorAll('[data-header]').forEach((header) => { closeMenu(header); closeSearch(header); }); }); mobileQuery.addEventListener('change', (event) => { if (event.matches) return; document.querySelectorAll('[data-header]').forEach((header) => { closeMenu(header); closeSearch(header); }); }); document.addEventListener('shopify:section:load', (event) => { const header = event.target.querySelector('[data-header]'); if (header) bind(header); }); })(); {% endjavascript %} {% schema %} { "name": "t:general.header", "settings": [ { "type": "image_picker", "id": "logo", "label": "t:header.logo" }, { "type": "link_list", "id": "menu", "label": "t:header.main_menu", "info": "t:header.main_menu_info" }, { "type": "link_list", "id": "pills_menu", "label": "t:header.pills_menu" }, { "type": "link_list", "id": "utility_menu", "label": "t:header.utility_menu" }, { "type": "text", "id": "promo_text", "label": "t:header.promo_text", "default": "Cambia tu piel ¡hoy!" }, { "type": "url", "id": "promo_link", "label": "t:header.promo_link" } ] } {% endschema %}