/* ═══════════════════════════════════════════════════
   FriendlyPOS — styles.css
   Tipografía: DM Sans | Acento: #ff6d33
   ═══════════════════════════════════════════════════ */

:root {
  --orange: #ff6d33;
  --orange-dk: #e0561e;
  --orange-bg: #fff5f1;
  --orange-border: #ffd4c2;
  --purple: #6c47ff;
  --purple-bg: #f0ecff;
  --purple-border: #c9baff;
  --green: #16a34a;
  --green-bg: #f0fdf4;
  --txt: #111827;
  --txt-2: #6b7280;
  --txt-3: #9ca3af;
  --border: #e5e7eb;
  --border-hover: #d1d5db;
  --bg: #f9fafb;
  --white: #ffffff;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --footer-h: 88px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--txt);
  padding-bottom: var(--footer-h);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
input[type="radio"] { display: none; }

/* ─── LAYOUT PRINCIPAL ──────────────────────────── */
.page-wrapper {
  display: grid;
  grid-template-columns: 400px 1fr;
  max-width: 1200px;
  margin: 32px auto;
  gap: 32px;
  padding: 0 24px;
  align-items: start;
}

/* ─── SHOWCASE IZQUIERDO ─────────────────────────── */
.showcase {
  position: sticky;
  top: 24px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.showcase-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--orange-bg);
  color: var(--orange-dk);
  border: 1px solid var(--orange-border);
  width: fit-content;
}

.showcase-badge.is-preventa {
  background: var(--purple-bg);
  color: var(--purple);
  border-color: var(--purple-border);
}

.showcase-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--txt);
  line-height: 1.25;
}

.showcase-sub {
  font-size: 13px;
  color: var(--txt-2);
  margin-top: -8px;
  line-height: 1.5;
}

.showcase-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.price-old {
  font-size: 13px;
  color: var(--txt-3);
  text-decoration: line-through;
}

.price-main {
  font-size: 26px;
  font-weight: 600;
  color: var(--orange);
}

.price-iva {
  font-size: 12px;
  color: var(--txt-3);
}

/* Imagen principal */
.main-img-wrap {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 12px;
}

.main-img-wrap img {
  max-height: 176px;
  width: auto;
  object-fit: contain;
  transition: opacity 0.2s ease;
  cursor: zoom-in;
}

/* ─── ZOOM LIGHTBOX ──────────────────────────────── */
.zoom-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.zoom-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.zoom-overlay img {
  max-width: min(90vw, 600px);
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  transform: scale(0.92);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 32px 80px rgba(0,0,0,0.5);
}

.zoom-overlay.open img {
  transform: scale(1);
}

.zoom-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  backdrop-filter: blur(8px);
}

.zoom-close:hover { background: rgba(255,255,255,0.22); }

/* Thumbnails */
.thumb-row {
  display: flex;
  gap: 8px;
}

.thumb-btn {
  width: 58px;
  height: 58px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
  padding: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s;
}

.thumb-btn:hover { border-color: var(--border-hover); }

.thumb-btn.active { border-color: var(--orange); }

.thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.thumb-btn::after {
  content: '🔍';
  position: absolute;
  font-size: 11px;
  bottom: 2px;
  right: 2px;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}

.thumb-btn {
  position: relative;
}

.thumb-btn:hover::after { opacity: 0.7; }

/* Características */
.feat-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.feat-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  color: var(--txt-2);
  line-height: 1.45;
}

.feat-list li::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--orange);
  flex-shrink: 0;
  margin-top: 5px;
}

/* Garantías */
.guarantee-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.guarantee-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--txt-2);
  font-weight: 500;
}

.guarantee-pill svg { color: var(--orange); flex-shrink: 0; }

/* ─── CONFIGURADOR DERECHO ───────────────────────── */
.configurator {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.config-header { margin-bottom: 4px; }

.config-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--orange);
  border: 1px solid var(--orange-border);
  background: var(--orange-bg);
  border-radius: 4px;
  padding: 2px 8px;
  display: inline-block;
  margin-bottom: 6px;
}

.config-h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--txt);
}

/* Secciones */
.config-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sec-heading { margin-bottom: 2px; }

.sec-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--txt);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sec-desc {
  font-size: 12px;
  color: var(--txt-3);
  margin-top: 2px;
}

.sec-tag-inline {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--txt-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
}

.free-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--green);
  border: 1px solid #bbf7d0;
  background: var(--green-bg);
  border-radius: 4px;
  padding: 1px 6px;
}

/* ─── TARJETA CON IMAGEN (prod-card) ─────────────── */
.prod-card {
  display: grid;
  grid-template-columns: 64px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--bg);
}

.prod-card:hover { border-color: var(--border-hover); background: var(--white); }

.prod-card.selected {
  border-color: var(--orange);
  background: var(--orange-bg);
}

.prod-img-col {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  background: var(--white);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  padding: 4px;
}

.prod-img-col img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.prod-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.prod-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--txt);
}

.prod-desc {
  font-size: 11.5px;
  color: var(--txt-2);
  line-height: 1.35;
}

.prod-tag {
  display: inline-block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 2px 7px;
  border-radius: 4px;
  width: fit-content;
}

.prod-tag.orange {
  background: var(--orange-bg);
  color: var(--orange-dk);
  border: 1px solid var(--orange-border);
}

.prod-tag.purple {
  background: var(--purple-bg);
  color: var(--purple);
  border: 1px solid var(--purple-border);
}

.prod-pricing {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  flex-shrink: 0;
}

.card-old {
  font-size: 11px;
  color: var(--txt-3);
  text-decoration: line-through;
}

.card-price {
  font-size: 15px;
  font-weight: 600;
  color: var(--txt);
}

.card-iva {
  font-size: 10px;
  color: var(--txt-3);
}

/* Radio dot custom */
.radio-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--border-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s;
}

.radio-dot.active,
.prod-card.selected .radio-dot {
  border-color: var(--orange);
  background: var(--orange);
}

.radio-dot.sm { width: 15px; height: 15px; }

.radio-inner {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
  transition: background 0.15s;
}

.radio-dot.active .radio-inner,
.prod-card.selected .radio-dot .radio-inner {
  background: var(--white);
}

/* ─── TARJETA CON CONTADOR ────────────────────────── */
.counter-card {
  display: grid;
  grid-template-columns: 64px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  transition: border-color 0.15s;
}

.counter-card.active { border-color: var(--orange); background: var(--orange-bg); }

.counter-ctrl {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.cnt-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--txt-2);
  font-size: 17px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s;
  font-family: inherit;
}

.cnt-btn:hover { border-color: var(--orange); color: var(--orange); }

.cnt-val {
  font-size: 15px;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
  color: var(--txt);
}

/* ─── TARJETA DE TEXTO (firma / rollos) ────────────── */
.text-card {
  display: grid;
  grid-template-columns: 34px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--bg);
}

.text-card:hover { border-color: var(--border-hover); background: var(--white); }

.text-card.selected {
  border-color: var(--orange);
  background: var(--orange-bg);
}

.text-card-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--txt-2);
  flex-shrink: 0;
}

.text-card.selected .text-card-icon {
  border-color: var(--orange-border);
  color: var(--orange);
  background: var(--orange-bg);
}

.text-card-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.text-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--txt);
}

.text-card-sub {
  font-size: 11px;
  color: var(--txt-3);
}

.text-card-price {
  font-size: 13px;
  font-weight: 600;
  color: var(--txt);
  flex-shrink: 0;
  white-space: nowrap;
}

/* ─── CHIP DE INTERNET ───────────────────────────── */
.chip-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.chip-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: var(--bg);
  transition: border-color 0.15s, background 0.15s;
}

.chip-opt:hover { border-color: var(--border-hover); background: var(--white); }

.chip-opt.selected {
  border-color: var(--orange);
  background: var(--orange-bg);
}

.chip-opt.selected .radio-dot { border-color: var(--orange); background: var(--orange); }
.chip-opt.selected .radio-dot .radio-inner { background: var(--white); }

.chip-body { flex: 1; }

.chip-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--txt);
}

.chip-sub {
  display: block;
  font-size: 11px;
  color: var(--txt-3);
}

.chip-free-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  flex-shrink: 0;
}

/* ─── FOOTER FIJO ───────────────────────────────── */
.sticky-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--footer-h);
  background: var(--white);
  border-top: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
}

.footer-inner {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.footer-product {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 150px;
}

.footer-prod-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--txt);
}

.footer-prod-qty {
  font-size: 11px;
  color: var(--txt-3);
}

.footer-total { flex: 1; }

.footer-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--txt-3);
  margin-bottom: 2px;
}

.footer-amount-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.footer-amount {
  font-size: 26px;
  font-weight: 600;
  color: var(--orange);
}

.footer-iva {
  font-size: 12px;
  color: var(--txt-3);
}

.footer-cuotas {
  display: block;
  font-size: 10.5px;
  color: var(--txt-3);
  margin-top: 1px;
}

.pay-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--orange);
  color: var(--white);
  border: none;
  border-radius: 24px;
  padding: 13px 28px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
  flex-shrink: 0;
}

.pay-btn:hover { background: var(--orange-dk); }
.pay-btn:active { transform: scale(0.98); }

/* ─── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 900px) {
  .page-wrapper {
    grid-template-columns: 1fr;
    padding: 16px;
    margin: 16px auto;
    gap: 16px;
  }

  .showcase { position: static; }

  .prod-card,
  .counter-card {
    grid-template-columns: 52px 1fr auto auto;
    gap: 10px;
  }

  .prod-img-col { width: 52px; height: 52px; }

  .footer-product { display: none; }

  .footer-inner { gap: 16px; }
}

@media (max-width: 560px) {
  .chip-grid { grid-template-columns: 1fr; }
  .guarantee-row { grid-template-columns: 1fr 1fr; }
  .footer-amount { font-size: 22px; }
  .pay-btn { padding: 12px 20px; font-size: 13px; }
  .text-card { grid-template-columns: 34px 1fr auto; }
  .text-card .radio-dot { display: none; }
  .text-card.selected::after {
    content: '';
    position: absolute;
  }
}