/* RTG 2.0 — bandeja de selección en la página de producto */

/* El aviso flotante antiguo (que se encolaba arriba) deja de salir: su información vive en la bandeja. */
html.rtg-dock-on .rtg-wholesale-popup-container { display: none !important; }
html.rtg-dock-on .site-footer { padding-bottom: 130px; }

/* Tallas ya agregadas: cantidad sobre la pastilla */
.single-product-wrap .rtg-size-pill { position: relative; }
.single-product-wrap .rtg-size-pill[data-incart]::after {
  content: '×' attr(data-incart);
  position: absolute; top: -9px; right: -7px;
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  display: grid; place-items: center;
  background: var(--gold); color: var(--black);
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 12px; letter-spacing: .5px;
  box-shadow: 0 0 0 3px var(--black);
  animation: rtgd-pop .5s var(--ease);
}
.single-product-wrap .rtg-size-pill[data-incart]:not(.active) { border-color: rgba(201,168,76,.5); }
@keyframes rtgd-pop { from { transform: scale(.4); opacity: 0; } }

/* ═════════ Bandeja ═════════ */
.rtgd {
  position: fixed; left: 50%; bottom: 16px; z-index: 350;
  width: min(840px, 94vw);
  transform: translate(-50%, 150%);
  background: rgba(13,13,13,.92);
  -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid rgba(201,168,76,.45);
  border-radius: 22px;
  box-shadow: 0 26px 80px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.03) inset;
}
.rtgd.is-on { transform: translate(-50%, 0); }

.rtgd-prog { height: 5px; margin-top: 9px; border-radius: 5px; background: #222; overflow: hidden; }
.rtgd-fill { display: block; height: 100%; width: 0; border-radius: 5px; background: linear-gradient(90deg, #C9A84C, #EDCF72); transition: width .9s var(--ease); }

/* Cápsula: tras unos segundos el aviso se pliega y deja solo lo esencial */
.rtgd { transition: transform .8s var(--ease), width .7s var(--ease); }
.rtgd-fold, .rtgd-foldend { max-height: 160px; overflow: hidden; transition: max-height .6s var(--ease), opacity .35s ease, margin .5s var(--ease); }
.rtgd.is-mini { width: min(318px, 92vw); }
.rtgd.is-mini .rtgd-fold, .rtgd.is-mini .rtgd-foldend { max-height: 0; opacity: 0; margin: 0; pointer-events: none; }
.rtgd.is-mini .rtgd-toggle { display: none; }
.rtgd.is-mini .rtgd-main { padding: 9px 10px; gap: 12px; }
.rtgd.is-mini .rtgd-thumb { width: 42px; height: 42px; border-radius: 13px; }
.rtgd.is-mini .rtgd-thumb img { border-radius: 12px; }
.rtgd.is-mini .rtgd-title { font-size: 12px; letter-spacing: 2px; color: var(--white); }
.rtgd.is-mini .rtgd-title b { display: block; font-size: 10px; letter-spacing: 3px; }
body .rtgd.is-mini .rtgd-go { padding: 10px 14px; font-size: 12px; }
.rtgd.is-mini .rtgd-main { cursor: pointer; }

.rtgd-main { display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 12px; cursor: pointer; }
.rtgd-thumb { position: relative; flex: none; width: 58px; height: 58px; border-radius: 16px; background: #151515; border: 1px solid #333; }
.rtgd-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 15px; display: block; }
.rtgd-badge {
  position: absolute; right: -8px; bottom: -8px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px;
  display: grid; place-items: center; background: var(--gold); color: var(--black);
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 13px; box-shadow: 0 0 0 3px #0d0d0d;
}
.rtgd-mid { flex: 1; min-width: 0; }
.rtgd-title { font-family: 'Barlow Condensed', sans-serif; font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); }
.rtgd-title b { color: var(--gold); font-weight: 600; }
.rtgd-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-top: 7px; padding-bottom: 1px; }
.rtgd-chips::-webkit-scrollbar { display: none; }
.rtgd-chip {
  flex: none; padding: 5px 12px; border-radius: 999px; border: 1px solid #3a3a3a; background: rgba(255,255,255,.03);
  font-family: 'Barlow Condensed', sans-serif; font-weight: 600; font-size: 15px; letter-spacing: 1px; color: var(--white);
  transition: background .4s ease, border-color .4s ease, color .4s ease;
}
.rtgd-chip i { font-style: normal; color: var(--gold); margin-left: 2px; }
.rtgd-chip.is-new { background: var(--gold); border-color: var(--gold); color: var(--black); animation: rtgd-pop .6s var(--ease); }
.rtgd-chip.is-new i { color: var(--black); }
.rtgd-wh { margin-top: 7px; font-size: 12.5px; color: #b3afa8; line-height: 1.35; }
.rtgd-wh[hidden] { display: none; }
.rtgd-wh b { color: var(--gold-light); font-weight: 600; }

.rtgd-end { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

.rtgd-totallbl { font-family: 'Barlow Condensed', sans-serif; font-size: 10px; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); line-height: 1; }
.rtgd-total { font-family: 'Bebas Neue', sans-serif; font-size: 26px; line-height: 1; letter-spacing: 1px; color: var(--gold-light); }
body .rtgd-go { margin: 0; padding: 11px 20px; white-space: nowrap; }
.rtgd-toggle {
  flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid #333; background: transparent; color: var(--muted);
  display: grid; place-items: center; cursor: pointer; transition: transform .5s var(--ease), border-color .25s ease, color .25s ease;
}
.rtgd-toggle:hover { border-color: var(--gold); color: var(--gold); }
.rtgd.is-open .rtgd-toggle { transform: rotate(180deg); }

/* detalle por talla */
.rtgd-sheet { max-height: 0; overflow: hidden; transition: max-height .6s var(--ease); }
.rtgd.is-open .rtgd-sheet { max-height: min(46vh, 380px); overflow-y: auto; border-top: 1px solid #202020; }
.rtgd-line { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid #1b1b1b; transition: opacity .25s ease; }
.rtgd-line.is-busy { opacity: .4; pointer-events: none; }
.rtgd-line-name { flex: 1; display: flex; align-items: baseline; gap: 10px; font-family: 'Barlow Condensed', sans-serif; }
.rtgd-line-name span { font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); }
.rtgd-line-name b { font-size: 22px; font-weight: 700; letter-spacing: 1px; }
.rtgd-qty { display: inline-flex; align-items: center; border: 1px solid #333; border-radius: 999px; }
.rtgd-qty button { width: 36px; height: 36px; background: transparent; border: 0; color: var(--white); font-size: 18px; cursor: pointer; transition: color .2s ease; }
.rtgd-qty button:hover:not(:disabled) { color: var(--gold); }
.rtgd-qty button:disabled { opacity: .3; cursor: not-allowed; }
.rtgd-qty span { min-width: 26px; text-align: center; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 16px; }
.rtgd-line-price { min-width: 84px; text-align: right; font-family: 'Bebas Neue', sans-serif; font-size: 20px; letter-spacing: 1px; color: var(--gold-light); }
.rtgd-rm { width: 30px; height: 30px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; transition: color .2s ease; }
.rtgd-rm:hover { color: var(--red); }

/* "+1 · Talla 7": se enciende un instante y se va; no tapa nada ni pide cerrarse */
.rtgd-flash {
  position: absolute; left: 50%; top: -46px; transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  padding: 9px 18px; border-radius: 999px; background: linear-gradient(180deg, #EDCF72, #C9A84C); color: var(--black);
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 15px; letter-spacing: 1.5px; text-transform: uppercase; white-space: nowrap;
  box-shadow: 0 14px 40px rgba(201,168,76,.35);
}
.rtgd-flash.is-show { animation: rtgd-flash 2s var(--ease) both; }
@keyframes rtgd-flash {
  0%   { opacity: 0; transform: translate(-50%, 14px) scale(.9); }
  14%  { opacity: 1; transform: translate(-50%, 0) scale(1); }
  78%  { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -10px) scale(.98); }
}

/* celular: barra inferior a todo el ancho */
@media (max-width: 640px) {
  .rtgd { bottom: calc(10px + env(safe-area-inset-bottom, 0px)); width: calc(100vw - 20px); border-radius: 20px; }
  .rtgd-main { gap: 10px; padding: 10px; }
  .rtgd-thumb { width: 48px; height: 48px; border-radius: 14px; }
  .rtgd-title { font-size: 11px; letter-spacing: 2px; }
  .rtgd-foldend { display: none; }
  body .rtgd-go { padding: 12px 16px; font-size: 13px; }
  .rtgd-toggle { display: none; }
  .rtgd-line { padding: 10px 12px; gap: 8px; }
  .rtgd-line-price { min-width: 0; font-size: 17px; }
  .rtgd-line-name span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .rtgd, .rtgd-fill, .rtgd-sheet { transition: none; }
  .rtgd-flash.is-show, .rtgd-chip.is-new, .single-product-wrap .rtg-size-pill[data-incart]::after { animation: none; }
  .rtgd-flash.is-show { opacity: 1; transform: translate(-50%, 0); }
}

/* ═════════ Lupa de zoom (solo ratón) ═════════ */
.rtgz-lens {
  position: absolute; z-index: 5; width: 200px; height: 200px; border-radius: 50%;
  pointer-events: none; opacity: 0; transform: scale(.85);
  background-color: #111; background-repeat: no-repeat;
  border: 2px solid var(--gold);
  box-shadow: 0 18px 50px rgba(0,0,0,.65), 0 0 0 6px rgba(10,10,10,.55), inset 0 0 18px rgba(0,0,0,.35);
  transition: opacity .25s ease, transform .35s var(--ease);
}
.rtgz-lens.is-on { opacity: 1; transform: scale(1); }
.product-gallery #rtg-main-image { cursor: zoom-in; }
@media (prefers-reduced-motion: reduce) { .rtgz-lens { transition: none; } }

/* Botón "Ampliar foto" sobre la imagen principal (visible en celular y escritorio) */
.rtgz-open {
  position: absolute; right: 14px; top: 14px; z-index: 6; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; color: var(--gold-light);
  background: rgba(10,10,10,.72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(201,168,76,.5);
  transition: transform .4s var(--ease), background .25s ease, color .25s ease;
}
@media (hover: hover) { .rtgz-open:hover { transform: scale(1.1); background: var(--gold); color: var(--black); } }
.rtgz-open:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }
