/* =========================
   RESET
========================= */

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

/* =========================
   VARIABLES
========================= */

:root{

  --bg:
    radial-gradient(
      circle at top,
      #2d2d2d,
      #101010
    );

  --card:
    rgba(255,255,255,.06);

  --text:
    #ffffff;

  --sub:
    rgba(255,255,255,.65);

  --border:
    rgba(255,255,255,.08);

  --primary:
    linear-gradient(
      135deg,
      #00ff95,
      #00c853
    );

  --shadow:
    0 10px 40px rgba(0,0,0,.45);

}

/* =========================
   LIGHT MODE
========================= */

body.dark{

  --bg:
    linear-gradient(
      to bottom,
      #f8f8f8,
      #ececec
    );

  --card:
    rgba(255,255,255,.75);

  --text:
    #111;

  --sub:
    #666;

  --border:
    rgba(0,0,0,.06);

  --shadow:
    0 10px 30px rgba(0,0,0,.08);

}

/* =========================
   BODY
========================= */

body{

  min-height:100vh;

  background:var(--bg);

  color:var(--text);

  font-family:
    Inter,
    sans-serif;

  overflow-x:hidden;

  transition:
    background .35s ease,
    color .35s ease;

}

/* =========================
   HEADER
========================= */

header{

  position:sticky;

  top:0;

  z-index:1000;

  padding:16px;

  backdrop-filter:
    blur(18px);

  background:
    rgba(0,0,0,.15);

  border-bottom:
    1px solid var(--border);

}

/* =========================
   SEARCH
========================= */

header input{

  width:100%;

  padding:16px;

  border:none;

  outline:none;

  border-radius:20px;

  background:
    rgba(255,255,255,.08);

  color:var(--text);

  font-size:16px;

  backdrop-filter:
    blur(10px);

}

/* =========================
   FILTROS
========================= */

.filtros{

  padding:16px;

}

.filtros select{

  width:100%;

  padding:14px;

  border:none;

  border-radius:18px;

  background:var(--card);

  color:var(--text);

  backdrop-filter:
    blur(16px);

}

/* =========================
   CARRITO
========================= */

.cart-bar{

  margin:0 16px 20px;

  padding:16px;

  border-radius:24px;

  background:var(--card);

  border:
    1px solid var(--border);

  backdrop-filter:
    blur(20px);

  box-shadow:
    var(--shadow);

}

/* =========================
   GRID
========================= */

#feed{

  display:grid;

  grid-template-columns:
    repeat(
      auto-fit,
      minmax(290px,1fr)
    );

  gap:18px;

  padding:20px;

  padding-bottom:120px;

}


/* =========================
   RESPONSIVE
========================= */

@media(max-width:768px){

  #feed{

    grid-template-columns:1fr;

    padding:16px;

    gap:18px;

  }

}

/* =========================
   CARD
========================= */

.card{

  --x:50%;
  --y:50%;

  position:relative;

  overflow:hidden;

content-visibility:auto;

contain:layout paint;  

border-radius:24px;

  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,.05),
      rgba(255,255,255,.02)
    );

  border:
    1px solid var(--border);

  backdrop-filter:
    blur(10px);

  box-shadow:
    var(--shadow);

  transition:
    transform .35s ease,
    box-shadow .35s ease,
    border-color .35s ease,
    opacity .5s ease;


}

/* =========================
   HOVER
========================= */

.card:hover{

  transform:
    translateY(-4px);

  border-color:
    rgba(0,255,200,.25);

  box-shadow:
    0 10px 30px rgba(0,0,0,.28);

}

/* =========================
   GLOW
========================= */

.card::before{

  content:"";

  position:absolute;

  inset:-100px;

  background:
    radial-gradient(
      circle,
      rgba(0,255,255,.12) 0%,
      transparent 70%
    );

  opacity:0;

  transition:
    opacity .4s ease;

  pointer-events:none;

}

.card:hover::before{

  opacity:1;

}

/* =========================
   SPOTLIGHT
========================= */

.card::after{

  content:"";

  position:absolute;

  inset:0;

  background:
    radial-gradient(
      circle at var(--x) var(--y),
      rgba(255,255,255,.18),
      transparent 35%
    );

  opacity:0;

  transition:
    opacity .25s ease;

  pointer-events:none;

}

.card:hover::after{

  opacity:1;

}

/* =========================
   CAROUSEL
========================= */

.carousel{

  position:relative;

  width:100%;

aspect-ratio:4/5;
  overflow:hidden;

}

/* =========================
   TRACK
========================= */

.carousel-track{

  display:flex;

  height:100%;

  transition:
    transform .25s ease;

}

/* =========================
   IMAGES
========================= */

.carousel img{

  width:100%;

  height:100%;

  object-fit:cover;

  flex-shrink:0;

  transform:
    scale(1.02);

  transition:
    transform .25s ease,
    filter .35s ease;

  will-change:
    transform;

  cursor:zoom-in;

}


/* =========================
   IMAGE HOVER
========================= */

.card:hover img{

  transform:
    scale(1.12);

  filter:
    brightness(1.04)
    contrast(1.04);

}

/* =========================
   DOTS
========================= */

.dots{

  position:absolute;

  left:50%;
  bottom:14px;

  transform:
    translateX(-50%);

  display:flex;

  gap:8px;

}

.dots span{

  width:10px;
  height:10px;

  border-radius:50%;

  background:
    rgba(255,255,255,.35);

}

.dots span.active{

  background:white;

}

/* =========================
   BADGES
========================= */

.badges{

  position:absolute;

  top:14px;
  left:14px;

  z-index:10;

  display:flex;

  flex-direction:column;

  gap:10px;

}

.badge{

  padding:6px 12px;

  border-radius:999px;

  font-size:10px;

  font-weight:800;

  color:white;

  box-shadow:
    0 5px 20px rgba(0,0,0,.25);

}

.nuevo{

  background:#00c853;

}

.oferta{

  background:#ff1744;

}

.agotado-badge{

  background:#666;

}

/* =========================
   INFO
========================= */

.info{

  padding:18px;

}

.info h3{

  font-size:18px;

  font-weight:800;

  margin-bottom:10px;

}

.info p{

  color:var(--sub);

  margin:8px 0;

}

/* =========================
   PRECIO
========================= */

.info p:nth-child(2){

  font-size:26px;

  font-weight:900;

  color:#00ff95;

  text-shadow:
    0 0 15px rgba(0,255,149,.35);

}

/* =========================
   ACTIONS
========================= */

.actions{

  display:flex;

  gap:12px;

  margin-top:18px;

}

/* =========================
   BUTTONS
========================= */

.actions button{

  flex:1;

  border:none;

  padding:12px;

  border-radius:18px;

  font-weight:700;

  cursor:pointer;

  transition:
    transform .25s ease,
    opacity .25s ease;

}

/* =========================
   BUY
========================= */

.buy{

  background:var(--primary);

  color:black;

  box-shadow:
    0 10px 25px rgba(0,255,149,.2);

}

.buy:hover{

  transform:
    translateY(-3px);

}

/* =========================
   APARTAR
========================= */

.apartar{

  background:
    rgba(255,255,255,.08);

  color:var(--text);

  backdrop-filter:
    blur(10px);

}

.apartar:hover{

  background:
    rgba(255,255,255,.15);

}

/* =========================
   DELETE
========================= */

.del{

  width:52px;

  background:#ff3d3d;

  color:white;

}

/* =========================
   ESTADOS
========================= */

.agotado{

  opacity:.6;

}

.vendido{

  filter:grayscale(.45);

}

/* =========================
   ANIMATIONS
========================= */

@keyframes aparecer{

  from{

    opacity:0;

    transform:
      translateY(40px);

  }

  to{

    opacity:1;

    transform:
      translateY(0);

  }

}

/* =========================
   SCROLL REVEAL
========================= */

.card{

  opacity:0;

  transform:
    translateY(40px);

}

.card.visible{

  opacity:1;

  transform:
    translateY(0);

}

/* =========================
   HOVER PARALLAX
========================= */

.card:hover img{

  transform:
    scale(1.02);

}


/* =========================
   VIEWER
========================= */

.visor{

  position:fixed;

  inset:0;

  display:flex;

  align-items:center;
  justify-content:center;

  background:
    rgba(0,0,0,.92);

  backdrop-filter:
    blur(10px);

  z-index:99999;

  opacity:0;

  visibility:hidden;

  transition:
    opacity .3s ease,
    visibility .3s ease;

}

/* =========================
   ACTIVE
========================= */

.visor.active{

  opacity:1;

  visibility:visible;

}

/* =========================
   VIEWER IMAGE
========================= */

.visor img{

  max-width:95vw;

  max-height:95vh;

  object-fit:contain;

  border-radius:24px;

  transform:
    scale(.9);

  transition:
    transform .3s ease;

  box-shadow:
    0 20px 60px rgba(0,0,0,.5);

}



/* =========================
   VIEWER OPEN
========================= */

.visor.active img{

  transform:
    scale(1);

}



/* =========================
   FAB
========================= */

.fab{

  position:fixed;

  left:24px;
  bottom:24px;

  width:68px;
  height:68px;

  border-radius:50%;

  display:flex;

  align-items:center;
  justify-content:center;

  background:
    var(--primary);

  color:black;

  font-size:38px;

  cursor:pointer;

touch-action:manipulation;

  z-index:1000000;

  box-shadow:
    0 10px 30px rgba(0,255,149,.25);

  transition:
    transform .25s ease,
    box-shadow .25s ease;

}

.fab:hover{

  transform:
    scale(1.08);

}

/* =========================
   DARK BUTTON
========================= */

#themeToggle{

  position:fixed;

  right:24px;
  bottom:24px;

  width:60px;
  height:60px;

  border:none;

  border-radius:50%;

  background:var(--card);

  color:var(--text);

  font-size:24px;

  cursor:pointer;

  z-index:9999;

  backdrop-filter:
    blur(12px);

  border:
    1px solid var(--border);

}

/* =========================
   MODALS
========================= */

.modal,
#nameModal{

  position:fixed;

  inset:0;

  display:none;

  align-items:center;
  justify-content:center;

  background:
    rgba(0,0,0,.55);

  backdrop-filter:
    blur(10px);

  z-index:99999;

  padding:20px;

}

/* =========================
   MODAL BOX
========================= */

.modal-content,
.name-box{

  width:100%;
  max-width:420px;

  padding:30px;

  border-radius:30px;

  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,.08),
      rgba(255,255,255,.03)
    );

  border:
    1px solid var(--border);

  backdrop-filter:
    blur(20px);

  box-shadow:
    var(--shadow);

}

/* =========================
   INPUTS
========================= */

.modal-content input,
.modal-content select,
.name-box input{

  width:100%;

  padding:16px;

  margin-bottom:14px;

  border:none;

  border-radius:18px;

  outline:none;

  background:
    rgba(255,255,255,.08);

  color:var(--text);

  font-size:15px;

}

/* =========================
   MODAL BUTTONS
========================= */

.modal-content button,
.name-box button{

  width:100%;

  border:none;

  padding:15px;

  border-radius:18px;

  cursor:pointer;

  font-weight:700;

  background:
    var(--primary);

  color:black;

  margin-top:8px;

}

/* =========================
   MOBILE OPTIMIZATION
========================= */

@media(max-width:768px){

  .card:hover{

    transform:none;

  }

  .card:hover img{

    transform:
      scale(1.05)
      translateY(var(--parallax,0px));

  }

  .fab{

    width:62px;
    height:62px;

    font-size:34px;

  }

  #themeToggle{

    width:56px;
    height:56px;

  }

}

/* =========================
   PERFORMANCE
========================= */

.card,
.carousel img,
.visor img{

  transform:
    translateZ(0);

  backface-visibility:hidden;

}

/* =========================
   TOUCH FIX
========================= */

button,
.card,
img{

  -webkit-tap-highlight-color:
    transparent;

}

/* =========================
   SKELETON
========================= */

.skeleton{

  height:420px;

  border-radius:32px;

  background:
    linear-gradient(
      90deg,
      rgba(255,255,255,.04),
      rgba(255,255,255,.10),
      rgba(255,255,255,.04)
    );

  background-size:
    200% 100%;

  animation:
    skeleton-loading 1.2s infinite linear;

}

/* =========================
   SKELETON ANIMATION
========================= */

@keyframes skeleton-loading{

  from{
    background-position:
      200% 0;
  }

  to{
    background-position:
      -200% 0;
  }

}
