<nav id="nav" class="header only-desk">
<div class="bg-blanco">
<div class="container">
<div class="row">
<div class="col-2 d-flex align-items-center justify-content-center">
<a href="{{ path('homepage') }}" class="py-4">
<img class="logo" src="{{ asset('img/SVG/logo.svg') }}" alt="">
</a>
</div>
<div class="col-10">
<div class="py-2 d-flex justify-content-end align-items-center nav-1">
<div class="nav-item">
<div class="search-box">
<form action="{{ path('buscador') }}">
{# buscador desktop #}
<input class="search" type="text" placeholder="Buscar" name="search" value="{{ app.request.get('search',"") }}" required>
<button><i class="icon-search color-naranja"></i></button>
</form>
</div>
</div>
<div class="nav-item">
<button class="btn border"><a href="{{ path('blog') }}">Blog </a></button>
</div>
<div class="nav-item">
<button class="btn btn-naranja"><a href="{{ path('tiendas') }}">Tiendas</a></button>
</div>
<div class="nav-item">
<a class="icon-nav openCar"><i class="icon-carrito"></i></a>
<span class="badge_carrito">{{ qi.carritoLength }}</span>
</div>
{# perfill desktop #}
{% if not app.user %}
<div class="nav-item">
<a class="icon-nav login-display"><i class="icon-person"></i></a>
</div>
{% else %}
<div class="nav-item">
<a class="icon-nav login-display"><i class="icon-person"></i></a>
<ul class="opciones-usuario">
<li>
<a href="{{path('mis-datos')}}" class="btn x-grande color-negro border-0 px-2">{{ qi.texto('mis-datos') }}</a>
</li>
<li>
<a href="{{path('mis-compras')}}" class="btn x-grande color- border-0 px-2">{{ qi.texto('mis-pedidos') }}</a>
</li>
<li>
<a href="{{path('mis-direcciones')}}" class="btn x-grande color-negro border-0 px-2">{{ qi.texto('mis-direcciones') }}</a>
</li>
{# <li>
<a href="{{path('mis-compras')}}" class="btn x-grande color-negro border-0 px-2">{{ qi.texto('mis-compras') }}</a>
</li> #}
<li>
<a href="{{path('mis-favoritos')}}" class="btn x-grande color-negro border-0 px-2">{{ qi.texto('mis-favoritos') }}</a>
</li>
<li>
<a href="javascript:void(0)" class="btn py-1 px-3 mb-1 px-1" id="cerrar_sesion">{{ qi.texto('cerrar-sesion') }}</a>
</li>
</ul>
</div>
{% endif %}
</div>
{# desplegable/menuu desktop #}
<div class="py-2 d-flex justify-content-end align-items-start" >
<ul class="items">
{% for cat in qi.CategoriasConProductos() %}
<li class="it-busqueda"
{% set clasif = null %}
{# {% if qi.getSubCategoriasConProductos(cat.id) %}data-firmeza="1"{% else %}data-firmeza="0"{% endif %} {% if qi.medidasProducto(cat.id) %}data-medida="1"{% else %}data-medida="0"{% endif %} {% if qi.materialProducto(cat.id) %}data-material="1"{% else %}data-material="0"{% endif %}#} data-id="{{ cat.id }}" data-name="{{cat.nombre}}" data-slug="{{cat.slug}}" {% if qi.getSubCategoriasConProductos(cat.id) and qi.clasificacionespercategoria(cat.id) %}data-desplegable="1"{% else %}data-desplegable="0"{% endif %}
>
<a>
<span class="img">
<img src="{{ cat.imagen }}" alt=""/>
</span>
<span class="sm {% if idprincipal is defined and idprincipal == cat.id %} active {% endif %}">{{ cat.nombre | raw }}</span>
</a>
</li>
{% endfor %}
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- AQUĆ ANTES ESTABA basic/busqueda.html.twig -->
</nav>
<div class="only-mobile">
<nav class="bg-gris2 pt-2">
<div class="text-center">
<a href="/"><img class="logo-menu" src="{{ asset('img/SVG/logo.svg') }}" alt=""></a>
</div>
<div class="d-flex justify-content-between align-items-center">
<a class="icon-nav menu" id="menu-collapse"><img src="{{ asset('img/SVG/menu.svg') }}" alt=""></a>
<a href="{{ path('blog') }}" class="border rounded border-naranja-1 color-naranja py-1 px-2 font-weight-bold mr-2">Blog</a>
{# buscador mobile #}
<a class="icon-nav openSearch"><i class="icon-search"></i><br>
</a>
<a class="icon-nav openCar" id="cart" href="#"><i class="icon-carrito"></i><br>
</a>
<span class="badge_carrito">{{ qi.carritoLength }}</span>
{# perfill mobile #}
{% if not app.user %}
<a class="icon-nav login-display"><i class="icon-person"></i> <br>
</a>
{% endif %}
{% if app.user %}
<div class="nav-item">
<a class="icon-nav login-display" >
<i class="icon-person"></i>
</a>
<ul class="opciones-usuario">
<li>
<a href="{{path('mis-datos')}}" class="btn py-1 px-3">{{ qi.texto('mis-datos') }}</a>
</li>
<li>
<a href="{{path('mis-compras')}}" class="btn py-1 px-3">{{ qi.texto('mis-pedidos') }}</a>
</li>
<li>
<a href="{{path('mis-direcciones')}}" class="btn py-1 px-3">{{ qi.texto('mis-direcciones') }}</a>
</li>
{# <li>
<a href="{{path('mis-compras')}}" class="btn x-grande color-negro border-0 px-2">{{ qi.texto('mis-compras') }}</a>
</li> #}
<li>
<a href="{{path('mis-favoritos')}}" class="btn py-1 px-3">{{ qi.texto('mis-favoritos') }}</a>
</li>
<li>
<a href="javascript:void(0)" class="btn py-1 px-3" id="cerrar_sesion">{{ qi.texto('cerrar-sesion') }}</a>
</li>
</ul>
</div>
{% endif %}
<!-- <a class="icon-nav menu" id="menu-collapse"><img src="{{ asset('img/SVG/menu.svg') }}" alt=""></a> -->
</div>
<div class="buscador-mobile position-absolute">
<form action="{{ path('buscador') }}" class="d-flex justify-content-center align-items-strech p-2">
<input type="search" placeholder="Buscar..." name="search" value="{{ app.request.get('search',"") }}" required/>
<button type="submit" class="p-1">
<i class="icon-search color-naranja"></i>
</button>
</form>
</div>
</nav>
<div class="menu-mobile bg-gris2">
{# menuu de mobile #}
<ul class="pt-3">
{% for cat in qi.CategoriasConProductos() %}
{% set medidas = qi.medidasProducto(cat.id)|length %}
{% set materiales = qi.materialProducto(cat.id)|length %}
<li class="d-flex justify-content-between align-items-center flex-wrap">
{% set catslug = cat.slug %}
<a class="item-link" href="{{ path('categoria_slug', {categoria: catslug }) }}">
<img class="img-iconos" src="{{cat.imagen}}" alt="{{cat.nombre}}"/>
<span class="medium mb-0">{{ cat.nombre }}</span>
</a>
{% if qi.clasificacionespercategoria(cat.id)|length > 0 %}
<a class="control"><i class="icon-right"></i></a>
<ul class="submenu bg-naranja">
{% for div in qi.clasificacionespercategoria(cat.id) %}
<li class="d-flex justify-content-between align-items-center flex-wrap">
<a class="color-blanco">{{div.nombre|capitalize}}</a>
<a class="control">
<i class="icon-right"></i>
</a>
{% set clasif = div.clasificacion.id %}
<ul class="submenu bg-naranja px-3">
{% for sub in qi.getProductosdesplegable(clasif,cat.id) %}
<div class="d-flex align-items-center">
<img src="{{sub.icono}}" alt="Icon" class="icono mr-2">
<a href="{{ sub.enlace }}" class="color-blanco"> {{ sub.nombre|capitalize }} </a>
</div>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
</div>
</div>
{{ include('basic/car.html.twig') }}
{% if not app.user %}
{{ include('basic/login-panel.html.twig') }}
{% endif %}