/* =============================================================
   PocoFloro RP — Tienda, checkout y componentes de compra
   Dirección "Garúa": superficies neutras, malva como acento.
   Depende de css/styles.css (tokens, botones, cabecera)
   ============================================================= */

/* ---------- 1. CABECERA DE SUBPÁGINA ---------- */
.page-head{
  position:relative;
  padding-top:calc(var(--header-h) + clamp(3rem,7vw,5.5rem));
  padding-bottom:clamp(2rem,4vw,3.5rem);
  border-bottom:1px solid var(--line);
  overflow:hidden;
}
/* la garúa: velo POR ENCIMA, nunca resplandor por detrás */
.page-head::after{
  content:"";position:absolute;inset:0;
  background:var(--veil);pointer-events:none;
}
.page-head__inner{position:relative;z-index:1;display:grid;gap:1rem;justify-items:start}
.page-head__title{
  font-family:var(--font-display);
  font-size:clamp(2.2rem,5.5vw,4rem);font-weight:700;line-height:1.04;
  letter-spacing:-.015em;color:var(--text);
}
.page-head__title em{font-style:normal;color:var(--pf-300)}
.page-head__lead{font-family:var(--font-body);color:var(--text-soft);max-width:62ch}

.crumbs{
  display:flex;align-items:center;gap:.5rem;
  font-family:var(--font-mono);font-size:.74rem;letter-spacing:.06em;
  color:var(--muted);
}
.crumbs a{color:var(--muted);transition:color var(--fast)}
@media (hover:hover) and (pointer:fine){
  .crumbs a:hover{color:var(--pf-300)}
}
.crumbs span{color:var(--faint)}

/* ---------- 2. AVISO Y CONFIANZA ---------- */
.notice{
  display:flex;align-items:flex-start;gap:.8rem;
  padding:.9rem 1.15rem;border-radius:var(--radius);
  background:var(--bg-850);
  border:1px solid var(--line);
  font-size:.9rem;color:var(--text-soft);
}
.notice svg{width:20px;height:20px;flex:none;color:var(--pf-300);margin-top:.15rem}
.notice b{color:var(--text)}

.notice--warn{background:var(--bg-850);border-color:rgba(199,154,87,.35)}
.notice--warn svg{color:var(--ambar)}

.notice--danger{background:var(--bg-850);border-color:rgba(166,84,80,.35)}
.notice--danger svg{color:var(--granate)}

.notice--ok{background:var(--bg-850);border-color:rgba(124,145,116,.35)}
.notice--ok svg{color:var(--musgo)}

.trust{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.8rem;
  margin-top:1.6rem;
}
.trust__item{
  display:flex;align-items:center;gap:.8rem;
  padding:.95rem 1.1rem;border-radius:var(--radius);
  background:var(--bg-850);border:1px solid var(--line);
}
.trust__item svg{width:22px;height:22px;color:var(--pf-300);flex:none}
.trust__item b{display:block;font-family:var(--font-display);font-size:.92rem;color:var(--text)}
.trust__item span{font-size:.78rem;color:var(--muted)}

/* ---------- 3. FILTROS ---------- */
.shop-bar{
  display:flex;flex-wrap:wrap;align-items:center;gap:.8rem;
  margin-bottom:2rem;
}
.filters{display:flex;flex-wrap:wrap;gap:.45rem}
.filter{
  padding:.5rem 1.1rem;border-radius:99px;
  border:1px solid var(--line);background:var(--bg-850);
  font-family:var(--font-mono);font-size:.74rem;font-weight:500;
  letter-spacing:.1em;text-transform:uppercase;color:var(--muted);
  transition:color var(--fast),background-color var(--fast),border-color var(--fast),transform var(--fast);
}
.filter:active{transform:scale(.97)}
.filter.is-active{
  color:var(--text);background:var(--pf-600);border-color:var(--pf-600);
}
.shop-bar__count{
  margin-left:auto;
  font-family:var(--font-mono);font-size:.76rem;font-variant-numeric:tabular-nums;
  letter-spacing:.06em;color:var(--muted);
}

/* ---------- 4. TARJETA DE PRODUCTO ---------- */
.shop-grid{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(290px,1fr));
  gap:1.1rem;align-items:stretch;
}
.product{
  position:relative;display:flex;flex-direction:column;gap:.85rem;
  padding:1.6rem 1.5rem 1.5rem;
  border-radius:var(--radius-lg);
  background:var(--bg-850);
  border:1px solid var(--line);
  box-shadow:var(--shadow-card);
  overflow:hidden;
  transition:transform var(--fast),border-color var(--fast),background-color var(--fast);
}

/* el destacado se distingue por borde y superficie, no por luz */
.product--featured{
  background:var(--bg-800);
  border-color:var(--pf-600);
}

.product__top{display:flex;align-items:flex-start;justify-content:space-between;gap:.8rem}
.product__cat{
  font-family:var(--font-mono);font-size:.68rem;font-weight:500;
  letter-spacing:.1em;text-transform:uppercase;
  color:var(--pf-300);
}
.product__badge{
  padding:.3rem .7rem;border-radius:99px;
  background:var(--pf-600);color:var(--text);
  font-family:var(--font-mono);font-size:.64rem;font-weight:500;
  letter-spacing:.1em;text-transform:uppercase;
  white-space:nowrap;
}
.product__name{font-family:var(--font-display);font-size:1.35rem;font-weight:700;line-height:1.14;color:var(--text)}
.product__tagline{font-size:.88rem;color:var(--muted);margin-top:-.35rem}

.price{display:flex;align-items:baseline;gap:.6rem;flex-wrap:wrap;margin-top:.2rem}
.price__now{
  font-family:var(--font-mono);font-variant-numeric:tabular-nums;
  font-size:1.9rem;font-weight:600;line-height:1;letter-spacing:-.02em;
  color:var(--text);
}
.price__old{
  font-family:var(--font-mono);font-variant-numeric:tabular-nums;
  font-size:.95rem;color:var(--faint);text-decoration:line-through;
}
.price__per{font-family:var(--font-mono);font-size:.72rem;letter-spacing:.06em;color:var(--muted)}
.price__save{
  padding:.18rem .55rem;border-radius:99px;
  font-family:var(--font-mono);font-size:.66rem;font-weight:500;
  letter-spacing:.1em;text-transform:uppercase;font-variant-numeric:tabular-nums;
  background:var(--bg-800);color:var(--musgo);border:1px solid rgba(124,145,116,.32);
}

.product .ticks{margin:.3rem 0 .2rem}
.product .ticks li{font-size:.86rem}
.product__foot{
  margin-top:auto;display:flex;gap:.6rem;align-items:center;
  padding-top:.9rem;border-top:1px solid var(--line);
}
.product__foot .btn{flex:1}
.product__sold{
  font-family:var(--font-mono);font-size:.7rem;font-variant-numeric:tabular-nums;
  letter-spacing:.06em;color:var(--muted);white-space:nowrap;
}

/* ---------- 5. SELECTOR DE CANTIDAD ---------- */
.stepper{
  display:inline-flex;align-items:center;
  border-radius:var(--radius);border:1px solid var(--line-strong);
  background:var(--bg-800);overflow:hidden;
}
.stepper button{
  width:34px;height:38px;display:grid;place-items:center;
  color:var(--text-soft);font-size:1.1rem;line-height:1;
  transition:background-color var(--fast),color var(--fast),transform var(--fast);
}
.stepper button:active:not(:disabled){transform:scale(.97)}
.stepper button:disabled{opacity:.3;cursor:not-allowed}
.stepper input{
  width:38px;height:38px;text-align:center;border:0;background:transparent;
  font-family:var(--font-mono);font-variant-numeric:tabular-nums;
  font-weight:600;color:var(--text);
  -moz-appearance:textfield;appearance:textfield;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}

/* ---------- 6. BOTÓN Y CAJÓN DEL CARRITO ---------- */
.cart-btn{
  position:relative;display:inline-flex;align-items:center;gap:.5rem;
  padding:.55rem .9rem;border-radius:var(--radius);
  border:1px solid var(--line-strong);background:var(--glass);
  font-size:.86rem;font-weight:600;color:var(--text);
  transition:background-color var(--fast),border-color var(--fast),transform var(--fast);
}
.cart-btn:active{transform:scale(.97)}
.cart-btn svg{width:19px;height:19px}
.cart-btn__n{
  position:absolute;top:-7px;right:-7px;min-width:20px;height:20px;padding:0 5px;
  display:grid;place-items:center;border-radius:99px;
  background:var(--pf-600);color:var(--text);
  font-family:var(--font-mono);font-variant-numeric:tabular-nums;
  font-size:.66rem;font-weight:600;
  box-shadow:0 0 0 2px var(--bg-900);
}
.cart-btn__n[hidden]{display:none}

.drawer{position:fixed;inset:0;z-index:140;display:none}
.drawer.is-open{display:block}
.drawer__backdrop{
  position:absolute;inset:0;background:rgba(18,19,23,.74);backdrop-filter:blur(6px);
  animation:drawerFade var(--mid) both;
}
.drawer__panel{
  position:absolute;right:0;top:0;bottom:0;width:min(430px,100%);
  display:flex;flex-direction:column;
  background:var(--bg-900);
  border-left:1px solid var(--line-strong);
  box-shadow:-24px 0 60px -40px rgba(0,0,0,.85);
  animation:drawerIn var(--slow) both;
}
@keyframes drawerFade{from{opacity:0}}
@keyframes drawerIn{from{transform:translateX(100%)}}
.drawer__head{
  display:flex;align-items:center;gap:.8rem;
  padding:1.3rem 1.4rem;border-bottom:1px solid var(--line);
}
.drawer__head h2{font-family:var(--font-display);font-size:1.15rem;font-weight:700;color:var(--text)}
.drawer__close{
  margin-left:auto;width:36px;height:36px;border-radius:var(--radius-sm);
  display:grid;place-items:center;color:var(--muted);
  transition:color var(--fast),background-color var(--fast),transform var(--fast);
}
.drawer__close:active{transform:scale(.97)}
.drawer__close svg{width:20px;height:20px}
.drawer__body{flex:1;overflow-y:auto;padding:1.1rem 1.4rem;display:grid;gap:.8rem;align-content:start}
.drawer__foot{padding:1.2rem 1.4rem;border-top:1px solid var(--line);display:grid;gap:.9rem}

.cart-line{
  display:grid;grid-template-columns:1fr auto;gap:.4rem .8rem;
  padding:.9rem 1rem;border-radius:var(--radius);
  background:var(--bg-850);border:1px solid var(--line);
}
.cart-line__name{font-family:var(--font-display);font-size:.96rem;color:var(--text)}
.cart-line__meta{
  font-family:var(--font-mono);font-size:.72rem;font-variant-numeric:tabular-nums;
  letter-spacing:.05em;color:var(--muted);
}
.cart-line__price{
  font-family:var(--font-mono);font-variant-numeric:tabular-nums;
  font-weight:600;color:var(--text);text-align:right;
}
.cart-line__acts{grid-column:1/-1;display:flex;align-items:center;gap:.6rem;margin-top:.3rem}
.cart-line__del{
  margin-left:auto;font-family:var(--font-mono);font-size:.7rem;
  letter-spacing:.1em;text-transform:uppercase;color:var(--muted);
  transition:color var(--fast);
}
@media (hover:hover) and (pointer:fine){
  .cart-line__del:hover{color:var(--granate)}
}

.cart-empty{display:grid;gap:.8rem;justify-items:center;text-align:center;padding:3rem 1rem;color:var(--muted)}
.cart-empty svg{width:52px;height:52px;color:var(--faint)}

.totals{display:grid;gap:.5rem;font-size:.9rem}
.totals div{display:flex;justify-content:space-between;gap:1rem;color:var(--muted)}
.totals b{font-family:var(--font-mono);font-variant-numeric:tabular-nums}
.totals .totals__grand{
  padding-top:.6rem;border-top:1px solid var(--line);
  font-size:1.02rem;color:var(--text);
}
.totals .totals__grand b{
  font-family:var(--font-mono);font-variant-numeric:tabular-nums;
  font-size:1.2rem;font-weight:600;color:var(--text);
}
.totals__off{color:var(--musgo)}

/* ---------- 7. FORMULARIOS ---------- */
.field{display:grid;gap:.42rem}
.field label{font-size:.82rem;font-weight:600;color:var(--text-soft)}
.field label .req{color:var(--pf-300)}
.field input,.field textarea,.field select{
  width:100%;padding:.8rem 1rem;border-radius:var(--radius);
  background:var(--bg-800);border:1px solid var(--line);
  color:var(--text);font-family:var(--font-body);font-size:.94rem;
  transition:border-color var(--fast),background-color var(--fast);
}
.field input::placeholder,.field textarea::placeholder{color:var(--faint)}
.field input:focus,.field textarea:focus,.field select:focus{
  outline:none;border-color:var(--pf-400);background:var(--bg-750);
}
.field input:focus-visible,.field textarea:focus-visible,.field select:focus-visible{
  outline:2px solid var(--pf-300);outline-offset:2px;
}
.field__hint{font-size:.76rem;color:var(--muted)}
.field.is-bad input,.field.is-bad textarea,.field.is-bad select{border-color:var(--granate)}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:.9rem}

.inline-form{display:flex;gap:.5rem}
.inline-form input{flex:1}

/* ---------- 8. CHECKOUT ---------- */
.checkout{
  display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);
  gap:clamp(1.4rem,3vw,2.4rem);align-items:start;
}
.panel-box{
  padding:clamp(1.4rem,2.6vw,2rem);border-radius:var(--radius-lg);
  background:var(--bg-850);
  border:1px solid var(--line);box-shadow:var(--shadow-card);
}
.panel-box+.panel-box{margin-top:1.1rem}
.panel-box__title{
  display:flex;align-items:center;gap:.7rem;
  font-family:var(--font-display);font-size:1.1rem;font-weight:700;color:var(--text);
  margin-bottom:1.2rem;
}
.panel-box__title i{
  width:26px;height:26px;border-radius:var(--radius-sm);display:grid;place-items:center;flex:none;
  background:var(--bg-750);border:1px solid var(--pf-600);color:var(--pf-200);
  font-family:var(--font-mono);font-variant-numeric:tabular-nums;
  font-size:.76rem;font-style:normal;font-weight:600;
}

/* Pasos de "cómo se completa" en el checkout */
.steps-list{margin:0;padding:0;list-style:none;counter-reset:paso;display:grid;gap:.75rem}
.steps-list li{
  counter-increment:paso;position:relative;padding-left:2.4rem;
  font-size:.92rem;color:var(--text-soft);line-height:1.55;
}
.steps-list li::before{
  content:counter(paso);position:absolute;left:0;top:-.1rem;
  width:1.65rem;height:1.65rem;border-radius:50%;display:grid;place-items:center;
  background:var(--bg-800);border:1px solid var(--line-strong);
  font-family:var(--font-mono);font-variant-numeric:tabular-nums;
  font-size:.76rem;color:var(--pf-200);
}
.steps-list b{color:var(--text)}

/* Confirmación del pedido */
.conf-head{display:flex;align-items:center;gap:1rem}
.conf-check{width:44px;height:44px;flex:none;color:var(--musgo)}
.conf-texto{
  width:100%;resize:vertical;padding:1rem 1.1rem;border-radius:var(--radius);
  background:var(--bg-950);border:1px solid var(--line);color:var(--text-soft);
  font-family:var(--font-mono);font-variant-numeric:tabular-nums;
  font-size:.82rem;line-height:1.6;white-space:pre;
}
.conf-texto:focus-visible{outline:2px solid var(--pf-300);outline-offset:2px}
.conf-acts{display:flex;flex-wrap:wrap;gap:.7rem;margin-top:1.1rem}
@media (max-width:560px){
  .conf-acts>*{width:100%;text-align:center}
}

.summary{position:sticky;top:calc(var(--header-h) + 1.2rem)}
.summary__lines{display:grid;gap:.7rem;margin-bottom:1.1rem}
.summary__line{display:flex;justify-content:space-between;gap:1rem;font-size:.9rem}
.summary__line span{color:var(--muted)}
.summary__line b{
  font-family:var(--font-mono);font-variant-numeric:tabular-nums;
  font-weight:600;color:var(--text-soft);white-space:nowrap;
}

.steps-bar{display:flex;align-items:center;gap:.5rem;margin-bottom:1.6rem;flex-wrap:wrap}
.steps-bar__i{
  display:flex;align-items:center;gap:.5rem;
  font-family:var(--font-mono);font-size:.7rem;font-weight:500;
  letter-spacing:.1em;text-transform:uppercase;color:var(--muted);
}
.steps-bar__i b{
  width:24px;height:24px;border-radius:50%;display:grid;place-items:center;
  background:var(--bg-800);border:1px solid var(--line);
  font-family:var(--font-mono);font-variant-numeric:tabular-nums;
  font-size:.7rem;color:var(--muted);
}
.steps-bar__i.is-done b{background:var(--pf-600);border-color:var(--pf-600);color:var(--text)}
.steps-bar__i.is-done{color:var(--text)}
.steps-bar__sep{flex:1;height:1px;min-width:16px;background:var(--line)}

/* ---------- 11. AVISOS FLOTANTES ---------- */
.toasts{
  position:fixed;left:50%;bottom:1.4rem;translate:-50% 0;z-index:200;
  display:grid;gap:.5rem;justify-items:center;width:min(430px,calc(100vw - 2rem));
}
.toast{
  width:100%;padding:.85rem 1.15rem;border-radius:var(--radius);
  background:var(--bg-800);
  border:1px solid var(--line-strong);
  box-shadow:var(--shadow-card);
  font-size:.9rem;color:var(--text);
  animation:toastIn var(--slow) both;
}
@keyframes toastIn{from{opacity:0;transform:translateY(12px)}}
.toast.is-out{opacity:0;transform:translateY(8px);transition:opacity var(--mid),transform var(--mid)}
.toast--error{border-color:rgba(166,84,80,.5)}
.toast--info{border-color:rgba(199,154,87,.5)}
.toast--ok{border-color:rgba(124,145,116,.5)}

/* ---------- 12. CARGANDO ---------- */
.skeleton{
  border-radius:var(--radius-lg);min-height:290px;
  background:var(--bg-800);
  border:1px solid var(--line);
}

/* ---------- 13. FOCO VISIBLE ---------- */
.filter:focus-visible,
.cart-btn:focus-visible,
.cart-line__del:focus-visible,
.drawer__close:focus-visible,
.stepper button:focus-visible,
.crumbs a:focus-visible{
  outline:2px solid var(--pf-300);outline-offset:2px;
}

/* ---------- 14. HOVER CON MOVIMIENTO ---------- */
@media (hover:hover) and (pointer:fine){
  .filter:hover{color:var(--text);background:var(--bg-800);border-color:var(--line-strong)}
  .filter.is-active:hover{color:var(--text);background:var(--pf-600);border-color:var(--pf-500)}
  .product:hover{transform:translateY(-3px);border-color:var(--line-strong);background:var(--bg-800)}
  .product--featured:hover{border-color:var(--pf-500)}
  .cart-btn:hover{background:var(--glass-2);border-color:var(--pf-600)}
  .stepper button:hover:not(:disabled){background:var(--bg-750);color:var(--text)}
  .drawer__close:hover{color:var(--text);background:var(--glass-2)}
}

/* ---------- 15. RESPONSIVE ---------- */
@media (max-width:900px){
  .checkout{grid-template-columns:1fr}
  .summary{position:static}
  .trust{grid-template-columns:1fr}
}
@media (max-width:640px){
  .grid-2{grid-template-columns:1fr}
  .shop-grid{grid-template-columns:1fr}
  .shop-bar__count{width:100%;margin-left:0}
  .filters{width:100%;overflow-x:auto;flex-wrap:nowrap;padding-bottom:.4rem}
  .filter{white-space:nowrap}
  .drawer__panel{width:100%}
  .product__foot{flex-wrap:wrap}
}

@media (prefers-reduced-motion:reduce){
  .drawer__panel,.drawer__backdrop,.toast{animation:none}
  .product,.filter,.cart-btn,.stepper button,.drawer__close,.crumbs a,.toast.is-out{transition:none}
  .product:hover{transform:none}
  .filter:active,.cart-btn:active,.stepper button:active:not(:disabled),.drawer__close:active{transform:none}
}
