/* =========================================================
   FOUNDRY — estilos del sitio
   (unifica custom-foundry.css + estilos de header y grilla
   que antes estaban dentro de las secciones de Shopify)
   ========================================================= */

:root{
  --black: #0B0B0A;
  --charcoal-2: #1A1815;
  --ash: #EDEAE3;
  --steel: #77746C;
  --ember: #FF5A1F;
  --ember-2: #FF8A3D;
}

*{ margin:0; padding:0; box-sizing:border-box; }

html,body{
  background: var(--black);
  color: var(--ash);
  font-family: 'IBM Plex Mono', monospace;
  overflow-x: hidden;
}

body.detail-open,
body.cart-open{ overflow: hidden; }

button{ font-family: inherit; cursor: pointer; }

/* =========================================================
   HEADER
   ========================================================= */
.corner-gif{
  position: fixed;
  top: 12px;
  left: 12px;
  width: clamp(34px, 7vw, 60px);
  height: auto;
  z-index: 60;
  pointer-events: none;
}
.site-header{
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 32px 14px;
}
.brand-mark{ height: 30px; width: auto; }
.brand-text{
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 24px;
  letter-spacing: 4px;
}

/* =========================================================
   BOTÓN DE CARRITO FLOTANTE
   ========================================================= */
.floating-cart-btn{
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  background: var(--black);
  border: 1px solid var(--ash);
  color: var(--ash);
  padding: 10px 16px;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}
.floating-cart-btn:hover{ background: var(--ash); color: var(--black); }
.floating-cart-btn .cart-icon{ font-size: 16px; }
.floating-cart-btn .cart-count{
  background: var(--ember);
  color: var(--black);
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: bold;
  font-size: 11px;
}
.floating-cart-btn.bump .cart-count{ animation: bump 0.4s ease; }
@keyframes bump{ 50%{ transform: scale(1.35); } }

/* =========================================================
   CARRITO LATERAL
   ========================================================= */
.cart-drawer{
  position: fixed;
  inset: 0;
  z-index: 10000;
  visibility: hidden;
  pointer-events: none;
}
.cart-drawer.open{ visibility: visible; pointer-events: auto; }
.cart-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(11,11,10,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.cart-drawer.open .cart-backdrop{ opacity: 1; }
.cart-panel{
  position: absolute;
  top: 0;
  right: 0;
  width: min(420px, 90vw);
  height: 100%;
  background: var(--black);
  border-left: 1px solid var(--charcoal-2);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(.2,.8,.2,1);
  display: flex;
  flex-direction: column;
}
.cart-drawer.open .cart-panel{ transform: translateX(0); }
.cart-header{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid var(--charcoal-2);
}
.cart-header h3{
  font-family: 'Oswald', sans-serif;
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.cart-close{
  background: none;
  border: none;
  color: var(--ash);
  font-size: 20px;
  padding: 4px 8px;
}
.cart-items{ flex: 1; overflow-y: auto; padding: 16px 24px; }
.cart-empty{
  color: var(--steel);
  font-size: 13px;
  text-align: center;
  padding: 40px 20px;
}
.cart-item{
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--charcoal-2);
  align-items: center;
}
.cart-item img{
  width: 60px;
  height: 60px;
  object-fit: contain;
  background: var(--charcoal-2);
  border-radius: 4px;
}
.cart-item-info{ flex: 1; }
.cart-item-name{
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.cart-item-variant{ font-size: 11px; color: var(--steel); margin-bottom: 4px; }
.cart-item-price{ font-size: 12px; color: var(--ember-2); }
.cart-item-controls{ display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.qty-btn{
  background: var(--charcoal-2);
  border: 1px solid var(--steel);
  color: var(--ash);
  width: 24px;
  height: 24px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.qty-btn:hover:not(:disabled){
  background: var(--ember);
  border-color: var(--ember);
  color: var(--black);
}
.qty-btn:disabled{ opacity: 0.3; }
.qty-display{ font-size: 12px; min-width: 20px; text-align: center; }
.cart-item-remove{
  background: none;
  border: none;
  color: var(--steel);
  font-size: 16px;
  padding: 4px 8px;
  transition: color 0.2s;
}
.cart-item-remove:hover{ color: var(--ember); }
.cart-footer{ padding: 24px; border-top: 1px solid var(--charcoal-2); }
.cart-total{
  display: flex;
  justify-content: space-between;
  font-family: 'Oswald', sans-serif;
  font-size: 16px;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.cart-total span:last-child{ color: var(--ember-2); }
.cart-checkout-btn{
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--ember);
  color: var(--black);
  border: none;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: background 0.2s;
}
.cart-checkout-btn:hover:not(:disabled){ background: var(--ember-2); }
.cart-checkout-btn:disabled{ opacity: 0.5; cursor: not-allowed; }

/* =========================================================
   FORMULARIO DE CHECKOUT
   ========================================================= */
.checkout-form{
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px 24px;
  flex-direction: column;
  gap: 14px;
}
.cart-drawer.form-mode .checkout-form{ display: flex; }
.cart-drawer.form-mode .cart-items,
.cart-drawer.form-mode .cart-footer{ display: none; }
.checkout-back{
  align-self: flex-start;
  background: none;
  border: none;
  color: var(--steel);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 0;
}
.checkout-back:hover{ color: var(--ash); }
.field{ display: flex; flex-direction: column; gap: 6px; border: none; }
.field > span, .field legend{
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--steel);
}
.field em{ font-style: normal; opacity: 0.7; text-transform: none; letter-spacing: 0; }
.field input, .field textarea{
  background: var(--charcoal-2);
  border: 1px solid #2e2b26;
  color: var(--ash);
  font-family: inherit;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 0;
  resize: vertical;
}
.field input:focus, .field textarea:focus{ outline: none; border-color: var(--ember); }
.delivery{ gap: 8px; }
.delivery legend{ margin-bottom: 8px; }
.radio{ display: flex; align-items: center; gap: 10px; font-size: 12px; }
.radio input{ accent-color: var(--ember); }
.checkout-delivery-note{ font-size: 11px; color: var(--steel); line-height: 1.5; }
.checkout-delivery-note:empty{ display: none; }
.checkout-total-row{ margin: 6px 0 0; }
.checkout-error{ color: var(--ember-2); font-size: 12px; min-height: 1em; }
.checkout-error:empty{ display: none; }
.checkout-note{ font-size: 10.5px; color: var(--steel); line-height: 1.6; text-align: center; }
.grid-message{
  grid-column: 1 / -1;
  text-align: center;
  color: var(--steel);
  font-size: 13px;
  padding: 80px 20px;
}

/* =========================================================
   VIDEO DE FONDO
   ========================================================= */
.hero{
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  z-index: 0;
}
.hero video{
  position: absolute;
  top: 50%; left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto; height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
}
.content-wrap{ position: relative; z-index: 10; }

/* Pantalla de carga: tapa todo hasta que el video empieza */
.page-loader{
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--black);
  transition: opacity 0.6s ease;
}
.page-loader img{
  width: 120px;
  height: auto;
  animation: loader-pulse 1.4s ease-in-out infinite;
}
.page-loader.hidden{ opacity: 0; pointer-events: none; }
@keyframes loader-pulse{
  0%, 100%{ opacity: 0.35; }
  50%{ opacity: 1; }
}
@media (prefers-reduced-motion: reduce){
  .page-loader img{ animation: none; }
}

/* =========================================================
   GRILLA DE PRODUCTOS
   ========================================================= */
.product-grid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 40px 24px 120px;
}
.product-card{
  position: relative;
  aspect-ratio: 3/4;
  cursor: pointer;
}
.product-card img{
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(1);
  width: 62%;
  height: auto;
  transition: transform 0.45s cubic-bezier(.2,.8,.2,1), filter 0.45s ease, opacity 0.25s ease;
  filter: drop-shadow(0 10px 14px rgba(0,0,0,0.55));
  z-index: 2;
}
.product-card:hover img:not(.cloth-ready),
.product-card:focus-visible img:not(.cloth-ready){
  transform: translate(-50%, -50%) scale(1.14);
  filter:
    drop-shadow(0 0 3px var(--ember))
    drop-shadow(0 0 16px var(--ember))
    drop-shadow(0 0 34px rgba(255,90,31,0.65));
}
.product-card img.cloth-ready{ visibility: hidden; }
.product-card.is-flying-source img,
.product-card.is-flying-source .cloth-canvas{ opacity: 0; }
.cloth-canvas{
  position: absolute;
  z-index: 2;
  pointer-events: none;
  transition: transform 0.45s cubic-bezier(.2,.8,.2,1), filter 0.45s ease, opacity 0.25s ease;
  filter: drop-shadow(0 10px 14px rgba(0,0,0,0.55));
  transform: scale(1);
  will-change: transform, filter;
}
.product-card.is-hover .cloth-canvas{
  transform: scale(1.14);
  filter:
    drop-shadow(0 0 3px var(--ember))
    drop-shadow(0 0 16px var(--ember))
    drop-shadow(0 0 34px rgba(255,90,31,0.65));
}
.product-info{
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 16px 18px;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(.2,.8,.2,1), opacity 0.4s ease;
  z-index: 3;
  pointer-events: none;
}
.product-info .name{
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.product-info .price{ font-size: 12px; color: var(--ember-2); margin-top: 2px; }
.product-card:hover .product-info,
.product-card:focus-visible .product-info{ transform: translateY(0); opacity: 1; }
.product-card:focus-visible{ outline: 1px dashed var(--ember); outline-offset: -8px; }
.product-card .sold-out-tag{
  position: absolute;
  top: 14px; left: 14px;
  z-index: 3;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--steel);
  border: 1px solid var(--steel);
  padding: 3px 7px;
}

/* En pantallas táctiles no hay hover: la info siempre visible */
@media (hover: none){
  .product-info{
    opacity: 1;
    transform: none;
    background: linear-gradient(0deg, rgba(0,0,0,0.75), rgba(0,0,0,0));
    padding-top: 40px;
  }
}

/* =========================================================
   CURSOR PERSONALIZADO
   Sólo se oculta el cursor nativo si el GIF cargó bien
   (clase .has-custom-cursor la pone app.js)
   ========================================================= */
#custom-cursor{
  position: fixed;
  top: 0; left: 0;
  width: 34px;
  height: 34px;
  pointer-events: none !important;
  z-index: 99999;
  will-change: transform;
  display: none;
}
@media (hover: hover) and (min-width: 769px){
  html.has-custom-cursor #custom-cursor{ display: block; }
  html.has-custom-cursor *,
  html.has-custom-cursor *::before,
  html.has-custom-cursor *::after{ cursor: none !important; }
}

/* =========================================================
   ESQUELETO
   ========================================================= */
.skeleton-overlay{
  position: fixed;
  top: 50%;
  left: 100vw;
  width: 200px;
  height: 200px;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-50%);
}
.skeleton-overlay.visible{
  opacity: 1;
  animation: skeletonFlyRightToLeft 3.5s cubic-bezier(.2,.8,.2,1) forwards;
}
.skeleton-overlay img{ width: 100%; height: 100%; object-fit: contain; }
@keyframes skeletonFlyRightToLeft{
  0%{
    left: 100vw;
    opacity: 1;
    transform: translateY(-50%) rotate(0deg) scale(1);
  }
  100%{
    left: -250px;
    opacity: 0;
    transform: translateY(-50%) rotate(-10deg) scale(0.8);
  }
}

/* =========================================================
   VISTA DE DETALLE
   ========================================================= */
.detail-overlay{
  position: fixed;
  inset: 0;
  z-index: 500;
  visibility: hidden;
  pointer-events: none;
}
.detail-overlay.active{ visibility: visible; pointer-events: auto; }
.detail-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(11,11,10,0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.detail-overlay.active .detail-backdrop{ opacity: 1; }
.detail-panel{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 56px;
  padding: 40px;
  pointer-events: none;
}
.detail-panel > *{ pointer-events: auto; }
.detail-media{
  position: relative;
  width: min(44vw, 480px);
  height: min(70vh, 620px);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
#detail-hero-img{
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.9)) drop-shadow(0 0 25px rgba(0,0,0,0.95));
}
.detail-slider-dots{
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  z-index: 2;
}
.detail-dot{
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--steel);
  border: none;
  padding: 0;
}
.detail-dot.active{ background: var(--ember); }
.detail-arrow{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--ash);
  font-size: 30px;
  line-height: 1;
  opacity: 0.55;
  padding: 10px;
  z-index: 2;
}
.detail-arrow:hover{ opacity: 1; }
.detail-arrow.prev{ left: -6px; }
.detail-arrow.next{ right: -6px; }
.detail-media.single .detail-arrow,
.detail-media.single .detail-slider-dots{ display: none; }
.detail-info{
  width: min(32vw, 400px);
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.detail-info.visible{ opacity: 1; transform: translateX(0); }
.detail-info h2{
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 30px;
  letter-spacing: 0.5px;
}
.detail-price{ color: var(--ember-2); font-size: 17px; margin-top: 8px; }
.detail-desc{ margin-top: 18px; font-size: 12.5px; line-height: 1.7; color: var(--steel); }
.detail-label{
  margin-top: 24px;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--steel);
}
.detail-sizes{ display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.size-btn{
  border: 1px solid var(--steel);
  background: transparent;
  color: var(--ash);
  padding: 9px 14px;
  font-size: 12px;
}
.size-btn.selected{ border-color: var(--ember); color: var(--ember-2); }
.size-btn.disabled-size{
  opacity: 0.3;
  text-decoration: line-through;
  cursor: not-allowed;
  border-color: var(--charcoal-2);
}
.detail-buy{
  margin-top: 30px;
  width: 100%;
  padding: 15px;
  background: var(--ember);
  border: none;
  color: var(--black);
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 13px;
}
.detail-buy:disabled{ opacity: 0.5; cursor: not-allowed; }
.detail-close{
  margin-top: 12px;
  width: 100%;
  padding: 13px;
  background: transparent;
  border: 1px solid var(--steel);
  color: var(--steel);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.detail-close:hover{ border-color: var(--ash); color: var(--ash); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px){
  .product-grid{ grid-template-columns: repeat(2, 1fr); }
  .detail-panel{
    flex-direction: column;
    overflow-y: auto;
    padding: 76px 20px 40px;
    gap: 20px;
    justify-content: flex-start;
  }
  .detail-media{ width: 100%; height: 46vh; }
  .detail-info{ width: 100%; }
}

@media (max-width: 768px){
  .site-header{ padding: 16px 20px 12px; }
  .brand-mark{ height: 24px; }
  .floating-cart-btn{ top: 12px; right: 12px; padding: 8px 12px; font-size: 11px; }
  .floating-cart-btn .cart-icon{ font-size: 14px; }
  .corner-gif{ width: clamp(28px, 9vw, 40px); top: 10px; left: 10px; }

  .product-grid{ padding: 20px 16px 80px; gap: 16px; }
  .product-card img,
  .product-card .cloth-canvas{ width: 85%; }
  .product-info{ padding: 10px 12px; }
  .product-info .name{ font-size: 11px; }
  .product-info .price{ font-size: 10px; }

  .cart-panel{ width: 100%; }
  .cart-header{ padding: 18px 16px; }
  .cart-items{ padding: 12px 16px; }
  .cart-item{ gap: 12px; padding: 14px 0; }
  .cart-item img{ width: 50px; height: 50px; }
  .cart-footer{ padding: 18px 16px; }

  .skeleton-overlay{ width: 140px; height: 140px; }
}

@media (max-width: 360px){
  .product-grid{ grid-template-columns: 1fr; gap: 24px; }
  .product-card{ aspect-ratio: 4/3; }
  .product-card img,
  .product-card .cloth-canvas{ width: 60%; }
}

@media (prefers-reduced-motion: reduce){
  .skeleton-overlay{ display: none; }
}
