/* ==========================================================
 * DRAWER / CARRITO LATERAL TRIK
 * ======================================================= */

.trik-cart {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  font-family: inherit;
}

/* Fondo negro transparente */
.trik-cart__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.25s ease;
}

/* Drawer lateral derecho, 90% del alto */
.trik-cart__drawer {
  position: absolute;
  right: 0;
  top: 5%;
  bottom: 5%;
  width: min(420px, 100%);
  background: #ffffff;
  border-radius: 18px 0 0 18px;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.25);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Estado ABIERTO */
.trik-cart.is-open {
  pointer-events: auto;
}

.trik-cart.is-open .trik-cart__overlay {
  opacity: 1;
}

.trik-cart.is-open .trik-cart__drawer {
  transform: translateX(0);
}

/* Cabecera: título + cruz */
.trik-cart__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.trik-cart__title {
  margin: 0 !important;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.trik-cart__close {
  border: none;
  background: transparent;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
}

/* Cuerpo del drawer */
.trik-cart__body {
  display: flex;
  flex-direction: column;
  height: calc(100% - 52px); /* header aprox 52px */
}

/* Layout interno: items scroll + footer fijo */
.trik-cart__body-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Zona de items scrollable */
.trik-cart__items-wrapper {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 10px;
    padding-top: 0;
}

/* Items */
.trik-cart__items {
  display: flex;
  flex-direction: column;
}

/* Cada item: línea separadora + grid 2 columnas (imagen + info) */
.trik-cart__item {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid #e2e2e2;
}

.trik-cart__item:last-child {
  border-bottom: none;
}

/* Imagen del item */
.trik-cart__item-image {
    border-radius: 12px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 11px;
    height: 88px;
}

.trik-cart__item-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* Info del item + precio absoluto a la derecha */
.trik-cart__item-info {
  position: relative;               /* para posicionar el precio */
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-right: 76px;              /* espacio reservado para el precio a la derecha */
}

/* Título del producto */
.trik-cart__item-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}

.trik-cart__item-title a {
  color: inherit;
  text-decoration: none;
}

/* Fila de personalización: NAME, NUMMER, GRÖSSE (chips) */
.trik-cart__item-personalization {
    font-size: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    opacity: 0.9;
    align-items: center;
}

.trik-cart__item-personalization-chip {
    padding: 0px 7px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    background: #f8f8f8;
    align-items: center;
    display: flex;
    line-height: 2px;
    height: 20px;
}

/* Otros atributos (si los hubiera), en pequeño */
.trik-cart__item-attrs {
  font-size: 11px;
  color: #666;
}

/* Precio del item: centrado vertical y pegado a la derecha */
.trik-cart__item-price {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

/* Footer fijo: resumen + botón */
.trik-cart__footer {
    flex-shrink: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding-top: 8px;
    background: #fff;
    padding: 12px;
    box-shadow: 0 7px 14.5px 8px #0000002e;
    border-radius: 20px;
}

/* Resumen de precios */
.trik-cart__summary {
    margin: 0 0 8px 0;
    padding: 4px 0 6px;
    display: grid;
    font-size: 13px;
}

.trik-cart__row {
    line-height: 17px;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    font-size: .75rem;
    color: #002041;
}

.trik-cart__row--total {
    margin-top: 8px;
    font-size: 17px;
    font-weight: 700;
    color: #002041;
}

/* Botón de finalizar compra: 100% ancho */
.trik-cart__checkout-btn {
    width: 100%;
    border-radius: 15px;
    border: none;
    text-transform: uppercase !important;
    font-size: 18px !important;
    font-weight: 800 !important;
    cursor: pointer;
    background: #001c3d !important;
    padding: 15px 20px;
    color: #fff !important;
}

.trik-cart__checkout-btn a{
    color: #fff !important;
}

/* Estado carrito vacío */
.trik-cart__empty {
  font-size: 14px;
  padding: 12px 0;
}

/* Responsive: en móviles, el drawer ocupa toda la pantalla */
@media (max-width: 600px) {
  .trik-cart__drawer {
    top: 0;
    bottom: 0;
    border-radius: 0;
    width: 100%;
  }

  .trik-cart__body {
    height: calc(100% - 52px);
  }
}




/* Dentro de .trik-cart__item-info ya tenemos: */
.trik-cart__item-info {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-right: 76px; /* espacio para precio + icono eliminar */
}

/* Botón eliminar dentro del item */
.trik-cart__item-remove {
    position: absolute;
    top: 4px;
    right: 0;
    border: none;
    background: transparent !important;
    padding: 0;
    cursor: pointer;
    fill: #d4d4d4;
    transition: .2s;
}

.trik-cart__item-remove:hover{
    fill: #db0000;
    transform: rotate(-22deg);
}

.trik-cart__item-remove-icon {
  display: block;
  width: 16px;
  height: 16px;
}

/* Precio, centrado vertical y a la derecha (debajo del icono) */
.trik-cart__item-price {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    text-align: right;
}



/* Utilidad genérica para ocultar elementos */
.is-hidden {
  display: none !important;
}

.trik-cart__patches{
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.trik-cart__patch-img{
  width: 22px;
  height: 22px;
  object-fit: cover;
}

/* Header más delgado */
.trik-cart__header{
  padding: 10px 16px;          /* antes seguramente más grande */
  min-height: 48px;            /* compacto */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(0,0,0,.08);
}

/* Título más compacto */
.trik-cart__title{
  margin: 0;
  font-size: 20px;
  line-height: 1.1;
  font-weight: 700;
}

/* Botón close “bonito” */
.trik-cart__close{
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .12s ease, background-color .12s ease, border-color .12s ease;
}

.trik-cart__close:hover{
  background: rgb(255 0 0 / 13%);
  transform: scale(1.03);
}

.trik-cart__close:active{
  transform: scale(0.98);
}

/* El wrapper del SVG */
.trik-cart__close-icon{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}

/* Forzar que el SVG herede color (por si viene con fills raros) */
.trik-cart__close-icon svg{
    width: 16px;
    height: 16px;
    display: block;
    color: #d90000;
}

.trik-cart__close-icon svg *{
  fill: currentColor !important;
  stroke: currentColor !important;
}
