/* ===== Catálogo de la tienda: probador, índice y animaciones ===== */

/* ---------- probador (a la izquierda de la revista) ---------- */
.cp-fit { position: absolute; left: -292px; top: 70px; width: 250px; padding: 16px 14px 18px; border-radius: 30px; z-index: 3;
  background: linear-gradient(170deg, #fff8ef, #ffe4cc); border: 6px solid #2b2b36; box-shadow: 0 14px 0 rgba(0,0,0,.25);
  display: flex; flex-direction: column; align-items: center; gap: 10px; color: #6a3d1a; }
.cp-fit-title { font: 700 32px var(--font); letter-spacing: 1px; }
.cp-stage { position: relative; width: 210px; height: 270px; border-radius: 22px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 18%, #fff 0 22%, #ffd9ef 48%, #b9a2ff 100%); box-shadow: inset 0 0 0 4px rgba(255,255,255,.6); }
.cp-lights i { position: absolute; top: -40px; width: 70px; height: 340px; background: linear-gradient(rgba(255,255,255,.75), transparent 75%);
  transform-origin: top center; animation: cpSweep 4s ease-in-out infinite; mix-blend-mode: soft-light; }
.cp-lights i:nth-child(1) { left: 10px; transform: rotate(18deg); }
.cp-lights i:nth-child(2) { left: 70px; animation-delay: -1.3s; }
.cp-lights i:nth-child(3) { left: 130px; transform: rotate(-18deg); animation-delay: -2.6s; }
@keyframes cpSweep { 50% { opacity: .35; } }
.cp-floor { position: absolute; left: 30px; right: 30px; bottom: 14px; height: 26px; border-radius: 50%; background: radial-gradient(rgba(80,40,120,.35), transparent 70%); }
.cp-bear { position: absolute; left: 10px; right: 10px; top: 6px; bottom: 6px; z-index: 1; }
.cp-bear svg { width: 100%; height: 100%; overflow: visible; animation: cpIdle 2.6s ease-in-out infinite; }
.cp-bear.pop svg { animation: cpPop .45s cubic-bezier(.3, 1.6, .5, 1), cpIdle 2.6s .45s ease-in-out infinite; }
@keyframes cpIdle { 50% { transform: translateY(-6px); } }
@keyframes cpPop { 0% { transform: scale(.85); } 60% { transform: scale(1.08) rotate(3deg); } 100% { transform: none; } }
.cp-turn { display: flex; align-items: center; gap: 10px; font: 600 20px var(--font); }
.cp-turn button { width: 48px; height: 48px; border-radius: 50%; border: 4px solid #2b2b36; background: linear-gradient(#ffe48a, #ffb92e);
  font: 700 26px/1 var(--font); color: #5a3300; cursor: pointer; box-shadow: 0 4px 0 rgba(0,0,0,.25); transition: transform .12s; }
.cp-turn button:hover { transform: rotate(-20deg) scale(1.08); }
.cp-turn button[data-turn="1"]:hover { transform: rotate(20deg) scale(1.08); }
.cp-tried { width: 100%; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-height: 150px; overflow-y: auto; }
.cp-hint { margin: 2px 0; font: 500 17px/1.25 var(--font); text-align: center; opacity: .85; }
.cp-chip { display: flex; align-items: center; gap: 4px; padding: 4px 8px 4px 6px; border-radius: 14px; border: 3px solid #f0b37a; background: #fff;
  font: 600 15px var(--font); color: #6a3d1a; cursor: pointer; animation: cpChip .3s ease-out; }
.cp-chip span { font-size: 18px; }
.cp-chip b { font-size: 12px; color: #c25a10; margin-left: 2px; }
.cp-chip.own { border-color: #7ccf6a; background: #efffea; }
.cp-chip:hover { border-color: #e2463b; }
@keyframes cpChip { from { transform: scale(.5); opacity: 0; } }
.cp-total { font: 700 22px var(--font); text-align: center; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; }
.cp-total:empty { display: none; }
.cp-total small { width: 100%; font: 600 16px var(--font); color: #d0342c; }
.cp-total.short b { color: #d0342c; }
.cp-clear { padding: 6px 18px; border-radius: 16px; border: 3px solid #c9a07a; background: #fff; font: 600 18px var(--font); color: #7a4a22; cursor: pointer; }
.cp-clear:hover { background: #ffe9e6; border-color: #e2463b; }

/* ---------- monedas en la esquina ---------- */
.cp-wallet { position: absolute; left: 24px; top: -58px; padding: 6px 18px; border-radius: 20px 20px 0 0; background: #2b2b36;
  font: 700 26px var(--font); color: #ffd85a; display: flex; align-items: center; gap: 8px; }

/* ---------- pestañas de índice ---------- */
.cp-tabs { position: absolute; left: 230px; right: 70px; top: -62px; height: 62px; display: flex; gap: 6px; align-items: flex-end; z-index: -1; }
.cp-tab { position: relative; flex: 1; min-width: 0; height: 50px; border: 5px solid #2b2b36; border-bottom: 0; border-radius: 18px 18px 0 0; cursor: pointer;
  background: hsl(var(--h) 85% 72%); display: flex; align-items: center; justify-content: center; padding: 0; transition: height .15s, filter .15s; }
.cp-tab span { font-size: 26px; line-height: 1; }
.cp-tab b { position: absolute; bottom: 62px; left: 50%; transform: translateX(-50%) scale(.6); padding: 6px 12px; border-radius: 12px; white-space: nowrap;
  background: #2b2b36; color: #fff; font: 600 18px var(--font); opacity: 0; pointer-events: none; transition: .15s; }
.cp-tab:hover { height: 60px; filter: brightness(1.08); }
.cp-tab:hover b { opacity: 1; transform: translateX(-50%) scale(1); }
.cp-tab.on { height: 62px; background: #fdfaf3; }
.cp-tab.on span { animation: cpWiggle 1.6s ease-in-out infinite; }
@keyframes cpWiggle { 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }

/* ---------- tarjetas de prendas ---------- */
#catalog .cat-item { position: relative; transition: transform .16s, box-shadow .16s, border-color .16s; animation: cpIn .45s cubic-bezier(.3, 1.4, .5, 1) backwards; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes cpIn { from { opacity: 0; transform: translateY(26px) scale(.9); } }
#catalog .cat-item:hover { transform: translateY(-6px) rotate(-.6deg); box-shadow: 0 12px 22px rgba(120,70,20,.22); border-color: #f2a43a; }
#catalog .cat-item::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; overflow: hidden;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.75) 50%, transparent 65%) -200% 0 / 250% 100% no-repeat; }
#catalog .cat-item:hover::after { animation: cpShine .8s ease-out; }
@keyframes cpShine { to { background-position: 200% 0; } }
#catalog .cat-item.cp-wear .cat-item-art { cursor: pointer; }
#catalog .cat-item.cp-trying { border-color: #b98cff; box-shadow: 0 0 0 4px rgba(185,140,255,.45), 0 10px 20px rgba(100,60,160,.2); }
.cp-ribbon, .cp-badge { position: absolute; z-index: 2; pointer-events: none; font: 700 15px var(--font); color: #fff; padding: 3px 10px; display: none; }
.cp-ribbon { top: 10px; right: -6px; background: #3fae3b; border-radius: 8px 0 0 8px; box-shadow: 0 3px 0 rgba(0,0,0,.2); }
.cp-ribbon::after { content: ''; position: absolute; right: 0; bottom: -6px; border: 3px solid #1f6e1c; border-color: #1f6e1c transparent transparent #1f6e1c; }
.cp-badge { top: 10px; left: 8px; background: #8b5cf6; border-radius: 10px; }
#catalog .cat-item.cp-owned .cp-ribbon, #catalog .cat-item.cp-trying .cp-badge { display: block; }
#catalog .cat-price.cp-short { color: #c9362c; }
#catalog .cat-price.cp-short::after { content: '🔒'; font-size: .6em; }

/* ---------- páginas con muchas prendas: se puede bajar ---------- */
#catalog .page.right { overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #e2a35a transparent; padding-bottom: 70px; touch-action: pan-y; }
#catalog .page.right::-webkit-scrollbar { width: 14px; }
#catalog .page.right::-webkit-scrollbar-thumb { background: #e2a35a; border-radius: 10px; border: 3px solid #fdfaf3; }
#catalog .page.right .featured { flex: none; }
.cp-more { position: absolute; right: 40px; bottom: 26px; z-index: 6; padding: 8px 18px; border-radius: 22px; border: 4px solid #2b2b36; background: linear-gradient(#ffe48a, #ffb92e);
  font: 700 22px var(--font); color: #5a3300; cursor: pointer; box-shadow: 0 5px 0 rgba(0,0,0,.25); animation: cpBounce 1.2s ease-in-out infinite; }
.cp-more[hidden] { display: none; }
@keyframes cpBounce { 50% { transform: translateY(6px); } }

/* ---------- confeti al comprar ---------- */
.cp-confetti { position: absolute; inset: 0; pointer-events: none; z-index: 20; overflow: visible; }
.cp-confetti i { position: absolute; top: 55%; width: 14px; height: 20px; border-radius: 3px; animation: cpBoom 1.6s cubic-bezier(.2, .7, .4, 1) forwards; }
@keyframes cpBoom {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  45% { transform: translate(calc(var(--dx) * .7), var(--dy)) rotate(var(--r)); opacity: 1; }
  100% { transform: translate(var(--dx), calc(var(--dy) + 600px)) rotate(calc(var(--r) * 2)); opacity: 0; }
}
.cp-yay { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); font: 700 80px var(--font); color: #fff;
  text-shadow: 0 6px 0 #c25a10, 0 0 30px rgba(255,200,60,.9); animation: cpYay 1.6s ease-out forwards; white-space: nowrap; }
@keyframes cpYay { 0% { transform: translate(-50%, -50%) scale(.3); opacity: 0; } 20% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; } 70% { opacity: 1; } 100% { transform: translate(-50%, -80%) scale(1); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  #catalog .cat-item, .cp-bear svg, .cp-tab.on span, .cp-lights i { animation: none !important; }
}
