/* Barra de Taopix convertida en la botonera fija de abajo, en todos los
   tamaños de pantalla: Inicio · Álbumes · Mis proyectos · Cesta · Cuenta.
   Los iconos van en ::before porque el script de Taopix reescribe el texto
   de los botones y el HTML de la cesta. Se carga después del CSS de Taopix. */

#tpx-basket-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  background: color-mix(in srgb, var(--papel) 92%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--linea);
  border-bottom: 0;
  box-shadow: none;
}

#tpx-basket-bar .tpx-bar-container {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  position: static;
}

#tpx-basket-bar ul.tpx-accountLinks {
  float: none;
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}

#tpx-basket-bar ul.tpx-accountLinks > li {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  display: block;
}

#tpx-basket-bar li#tpx-homelinkli { order: 1; }
#tpx-basket-bar li#tlb-albumesli { order: 2; }
#tpx-projectslinkli { order: 3; }
#tpx-basket-bar ul.tpx-accountLinks > li:has(#tpx-basketButtonWrapper) { order: 4; }
#tpx-basket-bar ul.tpx-accountLinks > li:has(#tpx-register) { order: 5; }

#tpx-basket-bar a#tpx-homelink,
#tpx-basket-bar a#tlb-albumeslink,
#tpx-basket-bar a#tpx-projectslist,
#tpx-basket-bar a#tpx-register,
#tpx-basket-bar a#tpx-basketlink {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  height: 58px;
  padding: 0 4px 7px;
  box-sizing: border-box;
  font: 600 11px/1.2 var(--sans);
  text-transform: none;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--suave);
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}

#tpx-basket-bar a#tpx-homelink::before,
#tpx-basket-bar a#tlb-albumeslink::before,
#tpx-basket-bar a#tpx-projectslist::before,
#tpx-basket-bar a#tpx-register::before,
#tpx-basket-bar a#tpx-basketlink::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 24px;
  height: 24px;
  margin-left: -12px;
  background: currentColor;
  -webkit-mask: var(--tpx-icon) center / contain no-repeat;
  mask: var(--tpx-icon) center / contain no-repeat;
}

#tpx-basket-bar a#tpx-homelink {
  --tpx-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10.5 12 3l9 7.5'/%3E%3Cpath d='M5 9.5V20a1 1 0 0 0 1 1h4v-6h4v6h4a1 1 0 0 0 1-1V9.5'/%3E%3C/svg%3E");
}

/* Libro abierto */
#tpx-basket-bar a#tlb-albumeslink {
  --tpx-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 6.5C10 5 7 4.5 3 5v13c4-.5 7 0 9 1.5 2-1.5 5-2 9-1.5V5c-4-.5-7 0-9 1.5z'/%3E%3Cpath d='M12 6.5v13'/%3E%3C/svg%3E");
}

#tpx-basket-bar a#tpx-projectslist {
  --tpx-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h11a1 1 0 0 1 1 1v14l-3.5-2-3.5 2V6'/%3E%3Cpath d='M4 5v13a1 1 0 0 0 1 1h4'/%3E%3Cpath d='M16 7h3a1 1 0 0 1 1 1v12'/%3E%3C/svg%3E");
}

#tpx-basket-bar a#tpx-basketlink {
  --tpx-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7.5 10V8.5a4.5 4.5 0 0 1 9 0V10'/%3E%3Cpath d='M3 10h18a9 9 0 0 1-18 0z'/%3E%3C/svg%3E");
}

#tpx-basket-bar a#tpx-register {
  --tpx-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21a8 8 0 0 1 16 0'/%3E%3C/svg%3E");
}

#tpx-basket-bar a.activa,
#tpx-basket-bar a#tpx-homelink:hover,
#tpx-basket-bar a#tlb-albumeslink:hover,
#tpx-basket-bar a#tpx-projectslist:hover,
#tpx-basket-bar a#tpx-register:hover,
#tpx-basket-bar a#tpx-basketlink:hover,
#tpx-basket-bar a#tpx-basketlink:active {
  color: var(--dorado);
  background: none;
  text-decoration: none;
}

#tpx-basket-bar #tpx-basketButtonWrapper { display: block; }

#tpx-basket-bar .tpx-basketLabel {
  display: block;
  float: none;
  padding: 0;
}

#tpx-basket-bar .tpx-basketCount {
  position: absolute;
  top: 4px;
  left: 50%;
  margin-left: 6px;
  float: none;
  width: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  box-sizing: border-box;
  border-radius: 9px;
  border: 2px solid var(--papel);
  background: var(--dorado);
  color: #fff;
  font-size: 10px;
  line-height: 14px;
  text-align: center;
  z-index: 1;
}

/* Cesta y Mis proyectos: panel que sube desde abajo, encima de la botonera.
   El script de Taopix pone `left` en línea al abrir Mis proyectos. */
#tpx-basket-bar .tpx-shopping-cart,
#tpx-basket-bar .tpx-projectlist {
  position: fixed;
  top: auto !important;
  left: 0 !important;
  right: 0;
  bottom: calc(59px + env(safe-area-inset-bottom, 0px));
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  max-height: calc(100vh - 140px);
  box-sizing: border-box;
  overflow: auto;
  border: 0;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.18);
}

#tpx-basket-bar .tpx-shopping-cart:after,
#tpx-basket-bar .tpx-projectlist:after { display: none; }

#tpx-basket-bar .tpx-shopping-cart-items-container {
  height: auto;
  min-height: 120px;
  max-height: 45vh;
}

#tpx-basket-bar .tpx-projectlist-items-container {
  height: auto;
  min-height: 120px;
  max-height: calc(100vh - 200px);
}

#tpx-basket-bar a.tpx-checkout-button {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 16px;
  background: var(--tinta);
  color: var(--papel);
  border-radius: 999px;
}
