/* ==========================================================================
   XJ SCRIPTS — rejilla, buscador, filtros y tarjeta de producto
   La tarjeta se usa en categorias y en la portada.
   ========================================================================== */

/* --- cabecera de catalogo ------------------------------------------------ */

.xj-catalog{
  max-width:var(--xj-max);
  margin:0 auto;
  padding:34px var(--xj-gutter) 0;
}

.xj-toolbar{
  display:flex; align-items:center; gap:14px; flex-wrap:wrap;
  margin-bottom:26px;
}

.xj-search{
  position:relative;
  flex:1 1 260px;
  max-width:420px;
}
.xj-search input{
  width:100%; height:46px;
  padding:0 44px 0 16px;
  border-radius:999px;
  border:1px solid var(--xj-line);
  background:rgba(8,20,38,.72);
  color:var(--xj-text);
  font-family:var(--xj-body);
  font-size:14.5px;
  transition:border-color .2s var(--xj-ease), box-shadow .2s var(--xj-ease);
}
.xj-search input::placeholder{ color:var(--xj-dim-2); }
.xj-search input:focus{
  outline:none;
  border-color:var(--xj-blue);
  box-shadow:var(--xj-glow-soft);
}
.xj-search__ico{
  position:absolute; right:16px; top:50%;
  width:14px; height:14px; margin-top:-9px;
  border:2px solid var(--xj-dim);
  border-radius:50%;
  pointer-events:none;
}
.xj-search__ico::after{
  content:""; position:absolute; right:-5px; bottom:-4px;
  width:7px; height:2px; border-radius:2px;
  background:var(--xj-dim);
  transform:rotate(45deg);
}

.xj-filters{ display:flex; gap:7px; flex-wrap:wrap; }
.xj-filter{
  padding:10px 16px;
  border-radius:999px;
  border:1px solid var(--xj-line);
  background:rgba(8,20,38,.6);
  color:var(--xj-dim);
  font-family:var(--xj-head);
  font-size:13px; font-weight:600;
  letter-spacing:.09em; text-transform:uppercase;
  cursor:pointer;
  transition:all .2s var(--xj-ease);
}
.xj-filter:hover{ color:var(--xj-text); border-color:var(--xj-blue); }
.xj-filter.is-active{
  color:#021022; border-color:transparent;
  background:linear-gradient(135deg, var(--xj-blue), var(--xj-cyan));
  box-shadow:var(--xj-glow-soft);
}

.xj-count{
  margin-left:auto;
  font-family:var(--xj-head);
  font-size:13px; font-weight:600;
  letter-spacing:.12em; text-transform:uppercase;
  color:var(--xj-dim-2);
}

/* --- rejilla ------------------------------------------------------------- */

.xj-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(268px, 1fr));
  gap:20px;
}

.xj-empty{
  padding:56px 24px;
  text-align:center;
  border-radius:var(--xj-radius);
  border:1px dashed var(--xj-line);
  color:var(--xj-dim);
}

/* --- tarjeta ------------------------------------------------------------- */

.xj-card{
  position:relative;
  display:flex; flex-direction:column;
  border-radius:var(--xj-radius);
  border:1px solid var(--xj-line);
  background:linear-gradient(170deg, var(--xj-panel) 0%, #040d1a 100%);
  overflow:hidden;
  transition:transform .26s var(--xj-ease), border-color .26s var(--xj-ease),
             box-shadow .26s var(--xj-ease);
}
.xj-card:hover{
  transform:translateY(-6px);
  border-color:rgba(7,140,255,.6);
  box-shadow:var(--xj-glow);
}
.xj-card[hidden]{ display:none; }

/* filo superior que se enciende al pasar */
.xj-card::before{
  content:"";
  position:absolute; top:0; left:0; right:0; height:2px;
  background:linear-gradient(90deg, transparent, var(--xj-cyan), transparent);
  opacity:0;
  transition:opacity .26s var(--xj-ease);
  z-index:3;
}
.xj-card:hover::before{ opacity:1; }

.xj-card__media{
  position:relative;
  display:block;
  aspect-ratio:16/9;
  overflow:hidden;
  background:#040d1a;
}
.xj-card__media img{
  width:100% !important;
  height:100% !important;
  max-height:none !important;
  object-fit:cover;
  display:block;
  transition:transform .5s var(--xj-ease);
}
.xj-card:hover .xj-card__media img{ transform:scale(1.06); }

.xj-card__media::after{
  content:"";
  position:absolute; inset:0;
  background:linear-gradient(180deg, transparent 42%, rgba(4,13,26,.92) 100%);
  pointer-events:none;
}

.xj-card__noimg{
  position:absolute; inset:0;
  display:grid; place-items:center;
  font-family:var(--xj-head);
  font-size:30px; font-weight:700;
  letter-spacing:.3em;
  color:rgba(150,171,198,.22);
}

.xj-card__flag{
  position:absolute; top:12px; left:12px; z-index:2;
  padding:6px 12px;
  border-radius:999px;
  background:linear-gradient(135deg, var(--xj-blue), var(--xj-cyan));
  color:#021022;
  font-family:var(--xj-head);
  font-size:11.5px; font-weight:700;
  letter-spacing:.12em; text-transform:uppercase;
}
.xj-card__flag--soon{ background:linear-gradient(135deg,#ff8a3d,#ffc46b); }

.xj-card__body{
  display:flex; flex-direction:column; gap:10px;
  padding:17px 18px 0;
  flex:1;
}

.xj-card__name{
  margin:0;
  font-family:var(--xj-head);
  font-size:19px; font-weight:700;
  line-height:1.18;
  letter-spacing:.03em;
  text-transform:uppercase;
}
.xj-card__name a{ color:var(--xj-text); }
.xj-card__name a:hover{ color:var(--xj-cyan); }

.xj-card__tags{ display:flex; flex-wrap:wrap; gap:6px; }
.xj-tag{
  padding:5px 10px;
  border-radius:6px;
  border:1px solid var(--xj-line);
  background:rgba(7,140,255,.07);
  font-size:11.5px; font-weight:600;
  letter-spacing:.07em; text-transform:uppercase;
  color:var(--xj-dim);
}

.xj-card__foot{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px;
  margin-top:auto;
  padding:16px 18px 18px;
}

.xj-card__price{
  display:flex; flex-direction:column; gap:2px;
  font-family:var(--xj-head);
}
.xj-card__price small{
  font-size:11px; font-weight:600;
  letter-spacing:.14em; text-transform:uppercase;
  color:var(--xj-dim-2);
}
.xj-card__price strong{
  font-size:23px; font-weight:700;
  color:var(--xj-text);
}
.xj-card__price del{
  font-size:13px; font-weight:500;
  color:var(--xj-dim-2);
  margin-left:7px;
}

.xj-card__add{
  display:inline-flex; align-items:center; gap:8px;
  height:42px; padding:0 18px;
  border-radius:var(--xj-radius-sm);
  background:linear-gradient(135deg, var(--xj-blue), var(--xj-cyan));
  color:#021022 !important;
  font-family:var(--xj-head);
  font-size:13.5px; font-weight:700;
  letter-spacing:.09em; text-transform:uppercase;
  white-space:nowrap;
  transition:box-shadow .2s var(--xj-ease), transform .2s var(--xj-ease);
}
.xj-card__add:hover{ transform:translateY(-2px); box-shadow:var(--xj-glow); }

.xj-card__add--off{
  background:rgba(26,52,85,.7);
  color:var(--xj-dim) !important;
  cursor:not-allowed;
}
.xj-card__add--off:hover{ transform:none; box-shadow:none; }

/* --- ficha de producto --------------------------------------------------- */

.xj-product{
  max-width:var(--xj-max);
  margin:0 auto;
  padding:34px var(--xj-gutter) 0;
  display:grid;
  grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);
  gap:28px;
  align-items:start;
}

.xj-product__media{
  border-radius:var(--xj-radius);
  border:1px solid var(--xj-line);
  overflow:hidden;
  background:#040d1a;
}
.xj-product__media img{
  width:100% !important;
  height:auto !important;
  max-height:none !important;
  display:block;
}

.xj-product__panel{
  position:sticky; top:96px;
  padding:24px;
  border-radius:var(--xj-radius);
  border:1px solid var(--xj-line);
  background:linear-gradient(170deg, var(--xj-panel), #040d1a);
  box-shadow:var(--xj-shadow);
}
.xj-product__title{
  margin:0 0 14px;
  font-size:clamp(26px,3vw,36px);
  font-weight:700;
  line-height:1.08;
  text-transform:uppercase;
}
.xj-product__price{
  display:flex; align-items:baseline; gap:10px;
  margin-bottom:18px;
  font-family:var(--xj-head);
  font-size:32px; font-weight:700;
  color:var(--xj-cyan);
}
.xj-product__desc{
  margin-top:26px;
  grid-column:1 / -1;
  padding:26px;
  border-radius:var(--xj-radius);
  border:1px solid var(--xj-line);
  background:rgba(6,15,28,.72);
  line-height:1.75;
  color:var(--xj-dim);
}
.xj-product__desc h1,.xj-product__desc h2,.xj-product__desc h3,
.xj-product__desc h4,.xj-product__desc strong{ color:var(--xj-text); }
.xj-product__desc img{ max-width:100%; height:auto; border-radius:var(--xj-radius-sm); }

/* --- adaptacion ---------------------------------------------------------- */

@media (max-width:900px){
  .xj-product{ grid-template-columns:1fr; }
  .xj-product__panel{ position:static; }
}

@media (max-width:560px){
  .xj-grid{ grid-template-columns:1fr; }
  .xj-count{ margin-left:0; width:100%; }
  .xj-card__foot{ flex-direction:column; align-items:stretch; gap:12px; }
  .xj-card__add{ justify-content:center; }
}

/* --- panel de compra: estilos sobre el markup de Tebex ------------------ */

.xj-product.store-product{
  display:grid !important;
  float:none !important;
  width:auto !important;
  background:transparent !important;
  border:0 !important;
  padding:0 !important;
}

.xj-product__panel .product-actions{
  display:flex; flex-direction:column; gap:14px;
  margin:18px 0 0; padding:0; border:0; background:transparent;
}
.xj-product__panel .product-actions .price{
  margin:0;
  font-family:var(--xj-head);
  font-size:34px; font-weight:700;
  color:var(--xj-cyan);
}
.xj-product__panel .product-actions .price strong{ font-weight:700; }
.xj-product__panel .product-actions .price del{
  display:block;
  font-size:16px; color:var(--xj-dim-2); font-weight:500;
}
.xj-product__panel .product-actions a,
.xj-product__panel .product-actions button{
  width:100% !important;
  height:50px;
  display:inline-flex; align-items:center; justify-content:center;
  border-radius:var(--xj-radius-sm) !important;
  font-family:var(--xj-head);
  font-size:15px; font-weight:700;
  letter-spacing:.09em; text-transform:uppercase;
}

/* dentro de la ficha rapida (popup) todo va en una columna */
.popup .xj-product{ grid-template-columns:1fr !important; padding:0 !important; }
.popup .xj-product__panel{ position:static; }

/* --- FIX panel de compra: el tema pone alturas y tamanos propios -------- */

.xj-product__panel .product-actions .price{
  font-size:34px !important;
  line-height:1.1 !important;
  color:var(--xj-cyan) !important;
}
.xj-product__panel .product-actions .price strong{
  font-size:34px !important;
  color:var(--xj-cyan) !important;
}
.xj-product__panel .product-actions .price del,
.xj-product__panel .product-actions .price del strong{
  font-size:16px !important;
  color:var(--xj-dim-2) !important;
}

.xj-product__panel .product-actions a,
.xj-product__panel .product-actions button{
  height:52px !important;
  min-height:0 !important;
  padding:0 20px !important;
  line-height:1 !important;
  font-size:15px !important;
}

/* El tema deja los botones como flex-item estirable: por eso crecian. */
.xj-product__panel .product-actions{
  flex-direction:column !important;
  align-items:stretch !important;
}
.xj-product__panel .product-actions a,
.xj-product__panel .product-actions button{
  flex:0 0 52px !important;
  align-self:stretch !important;
}

/* ==========================================================================
   Tarjetas escritas a mano en Tienda > Paginas > Homepage.
   Llevan el markup de Tebex (.store-product) y aqui se les da la piel XJ.
   ========================================================================== */

.xj-free .xj-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(268px,1fr));
  gap:20px;
}

.xj-free .store-product{
  display:flex; flex-direction:column;
  border-radius:var(--xj-radius);
  border:1px solid var(--xj-line);
  background:linear-gradient(170deg, var(--xj-panel) 0%, #040d1a 100%);
  overflow:hidden;
  transition:transform .26s var(--xj-ease), border-color .26s var(--xj-ease), box-shadow .26s var(--xj-ease);
}
.xj-free .store-product:hover{
  transform:translateY(-6px);
  border-color:rgba(7,140,255,.6);
  box-shadow:var(--xj-glow);
}

.xj-free .store-product .image-link{
  display:block;
  aspect-ratio:16/9;
  overflow:hidden;
  background:#040d1a;
}
.xj-free .store-product img.image{
  width:100% !important;
  height:100% !important;
  max-height:none !important;
  object-fit:cover;
  display:block;
  transition:transform .5s var(--xj-ease);
}
.xj-free .store-product:hover img.image{ transform:scale(1.06); }

.xj-free .store-product .product-title{
  margin:16px 18px 0;
  font-family:var(--xj-head);
  font-size:19px !important; font-weight:700;
  line-height:1.18;
  letter-spacing:.03em; text-transform:uppercase;
  text-align:left;
}
.xj-free .store-product .product-title a{ color:var(--xj-text); }
.xj-free .store-product .product-title a:hover{ color:var(--xj-cyan); }

.xj-free .xj-card-sub{
  margin:7px 18px 0;
  font-size:13.5px; line-height:1.5;
  color:var(--xj-dim);
  text-align:left;
}

.xj-free .xj-tags{
  display:flex; flex-wrap:wrap; gap:6px;
  margin:11px 18px 0;
}
.xj-free .xj-tag{
  padding:5px 10px;
  border-radius:6px;
  border:1px solid var(--xj-line);
  background:rgba(7,140,255,.07);
  font-size:11.5px; font-weight:600;
  letter-spacing:.07em; text-transform:uppercase;
  color:var(--xj-dim);
}

.xj-free .store-product .product-actions{
  display:flex !important;
  flex-direction:row !important;
  align-items:center; justify-content:space-between;
  gap:12px;
  margin:auto 0 0;
  padding:16px 18px 18px;
  border:0; background:transparent;
}
.xj-free .store-product .price{
  margin:0;
  font-family:var(--xj-head);
  font-size:23px !important; font-weight:700;
  color:var(--xj-text) !important;
}
.xj-free .store-product a.add{
  flex:none !important;
  height:42px !important;
  padding:0 18px !important;
  display:inline-flex; align-items:center; justify-content:center;
  border-radius:var(--xj-radius-sm) !important;
  background:linear-gradient(135deg, var(--xj-blue), var(--xj-cyan)) !important;
  color:#021022 !important;
  font-family:var(--xj-head);
  font-size:13.5px !important; font-weight:700;
  letter-spacing:.09em; text-transform:uppercase;
  white-space:nowrap;
  line-height:1 !important;
}
.xj-free .store-product a.add:hover{ box-shadow:var(--xj-glow); }


/* ==========================================================================
   Cabecera de categoria y tarjeta en vertical
   ========================================================================== */

.xj-cat-head{
  display:flex; align-items:flex-start; gap:18px;
  margin-bottom:22px;
}
.xj-cat-head__mark{
  display:flex; flex-direction:column; gap:5px;
  padding-top:6px;
  flex:none;
}
.xj-cat-head__mark i{
  display:block;
  width:17px; height:9px;
  border-radius:2px;
  background:var(--xj-blue);
  box-shadow:0 0 12px rgba(7,140,255,.6);
}
.xj-cat-head__mark i:nth-child(2){ background:var(--xj-cyan); opacity:.85; }
.xj-cat-head__mark i:nth-child(3){ background:var(--xj-blue); opacity:.45; box-shadow:none; }

.xj-cat-head__title{
  margin:0 !important;
  font-family:var(--xj-head);
  font-size:clamp(32px, 4.2vw, 48px) !important;
  font-weight:700;
  line-height:1;
  letter-spacing:.01em;
  text-transform:uppercase;
}
.xj-cat-head__sub{
  margin:9px 0 0;
  font-size:15px;
  color:var(--xj-dim);
}

/* buscador ancho, como en la referencia */
.xj-search--wide{
  display:block;
  flex:none;
  width:100%;
  max-width:none;
  margin:0 0 18px;
}
.xj-search--wide input{
  height:52px;
  padding:0 62px 0 20px;
  border-radius:12px;
  font-size:15px;
}
.xj-search__btn{
  position:absolute; right:6px; top:6px;
  width:46px; height:40px;
  display:inline-flex; align-items:center; justify-content:center;
  border:0;
  border-radius:9px;
  background:linear-gradient(135deg, var(--xj-blue), var(--xj-cyan));
  cursor:pointer;
}
.xj-search__btn .xj-search__ico{
  position:static; margin:0;
  border-color:#021022;
}
.xj-search__btn .xj-search__ico::after{ background:#021022; }

/* --- tarjeta: imagen con marco y boton a todo lo ancho ------------------- */

.xj-card{ padding:10px; }

.xj-card__media{
  border-radius:12px;
}

/* el filo de arriba deja de ser solo de hover */
.xj-card::before{
  left:28%; right:28%;
  height:3px;
  border-radius:0 0 3px 3px;
  opacity:.4;
}
.xj-card:hover::before{ opacity:1; }

.xj-card__body{ padding:15px 8px 0; }
.xj-card__name{ font-size:17px; }

.xj-card__foot{
  flex-direction:column;
  align-items:stretch;
  gap:12px;
  padding:14px 8px 8px;
}
.xj-card__price{ gap:3px; }
.xj-card__price strong{ font-size:25px; color:var(--xj-cyan); }
.xj-card__add{
  width:100%;
  justify-content:center;
}

@media (max-width:560px){
  .xj-card__foot{ padding:14px 8px 8px; }
  .xj-cat-head__mark i{ width:14px; height:8px; }
}
