/* 4ADDICTIC · Oferta de montaje — mismo lenguaje visual que el aviso de "Producto descatalogado" */
:root {
  --fmo-c1: #FF3D2E;
  --fmo-c2: #FF8A00;
  --fmo-price: #FF3D2E;
  --fmo-glow: rgba(255,138,0,.18);
  --fmo-shadow: rgba(255,61,46,.35);
}
/* El módulo inyecta html:root{...} con los colores del BO (gana a :root) */

/* ---------- Tarjeta (inline y dentro del popup) ---------- */
.fmo-card {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  margin: 0 0 20px;
  padding: 26px 28px 26px;
  border: 2px solid transparent;
  border-radius: 18px;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(90deg, var(--fmo-c1), var(--fmo-c2)) border-box;
  box-shadow: 0 10px 34px var(--fmo-glow);
  color: #1d1d1f;
  font-family: inherit;
  line-height: 1.35;
  text-align: left;
  animation: fmo-in .35s ease-out both;
}
.fmo-card *, .fmo-card *::before, .fmo-card *::after { box-sizing: border-box; }

.fmo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--fmo-c1), var(--fmo-c2));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  box-shadow: 0 4px 14px var(--fmo-glow);
}
.fmo-badge svg { width: 14px; height: 14px; flex: 0 0 auto; }

.fmo-title {
  margin: 16px 0 2px;
  padding: 0;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
  color: #1d1d1f;
  text-transform: none;
  letter-spacing: 0;
}
.fmo-sub {
  margin: 0 0 16px;
  font-size: 16px;
  color: #2b2b2e;
}

/* Fila "tu patín + tus botas" */
.fmo-pair {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
}
.fmo-pair-img {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  border: 1px solid #ececf0;
  background: #fff center / contain no-repeat;
  flex: 0 0 auto;
}
.fmo-pair-op {
  font-size: 16px;
  font-weight: 700;
  color: #9a9aa2;
}
.fmo-pair-res {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--fmo-c1), var(--fmo-c2));
  color: #fff;
}
.fmo-pair-res svg { width: 22px; height: 22px; }

/* Producto propuesto */
.fmo-item {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 18px;
  border: 1px solid #ececf0;
  border-radius: 14px;
  background: #f8f8fa;
}
.fmo-thumb {
  width: 120px;
  height: 120px;
  flex: 0 0 auto;
  border-radius: 12px;
  border: 1px solid #ececf0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.fmo-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.fmo-thumb svg { width: 54px; height: 54px; color: var(--fmo-c1); }
.fmo-info { flex: 1 1 auto; min-width: 0; }
.fmo-name {
  display: block;
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 500;
  color: #1d1d1f;
  text-transform: uppercase;
  text-decoration: none;
}
a.fmo-name:hover { color: #1d1d1f; text-decoration: underline; }
.fmo-price {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--fmo-price);
}
.fmo-qty {
  margin-left: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #6b6b73;
}

.fmo-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}
.fmo-btn,
.fmo-btn:focus,
.fmo-btn:hover {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--fmo-c1), var(--fmo-c2));
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  line-height: 1;
  text-transform: none;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 8px 22px var(--fmo-shadow);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.fmo-btn:hover { transform: translateY(-1px); filter: brightness(1.04); box-shadow: 0 10px 26px var(--fmo-shadow); }
.fmo-btn:focus-visible { outline: 3px solid var(--fmo-c2); outline-offset: 3px; }
.fmo-btn svg { width: 20px; height: 20px; transition: transform .15s ease; }
.fmo-btn:hover svg { transform: translateX(3px); }
.fmo-btn[disabled] { opacity: .75; cursor: wait; transform: none; }
.fmo-spin {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: fmo-rot .7s linear infinite;
}

.fmo-no {
  display: inline-block;
  padding: 4px 2px;
  border: 0;
  background: none;
  color: #6b6b73;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.fmo-no:hover { color: #1d1d1f; }

.fmo-msg {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 15px;
  font-weight: 500;
}
.fmo-msg.is-error { color: #b42318; }
.fmo-done {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: 14px;
  background: #f8f8fa;
  border: 1px solid #ececf0;
  font-size: 17px;
  font-weight: 500;
  animation: fmo-in .3s ease-out both;
}
.fmo-done-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--fmo-c1), var(--fmo-c2));
  color: #fff;
}
.fmo-done-ico svg { width: 22px; height: 22px; }

/* Variante compacta (carrito / checkout) */
.fmo-card.fmo-inline { padding: 20px 22px; }
.fmo-inline .fmo-title { margin-top: 12px; font-size: 19px; }
.fmo-inline .fmo-sub { font-size: 15px; margin-bottom: 14px; }
.fmo-inline .fmo-thumb { width: 84px; height: 84px; }
.fmo-inline .fmo-item { padding: 14px; gap: 16px; }
.fmo-inline .fmo-price { font-size: 22px; }
.fmo-inline .fmo-btn { min-height: 48px; font-size: 16px; padding: 0 22px; }

/* Columnas estrechas (resumen lateral del checkout) */
.fmo-narrow .fmo-item { flex-wrap: wrap; }
.fmo-narrow .fmo-actions { width: 100%; align-items: stretch; }
.fmo-narrow .fmo-btn { width: 100%; }

/* ---------- Popup ---------- */
.fmo-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(20,20,24,.45);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .25s ease;
}
.fmo-overlay.is-open { opacity: 1; }
.fmo-modal {
  position: relative;
  width: 100%;
  max-width: 760px;
  max-height: calc(100vh - 40px);
  overflow: auto;
  transform: translateY(18px) scale(.98);
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.fmo-overlay.is-open .fmo-modal { transform: none; }
.fmo-modal:focus { outline: none; }
.fmo-modal .fmo-card { margin: 0; animation: none; box-shadow: 0 24px 60px rgba(0,0,0,.18), 0 10px 34px var(--fmo-glow); }
.fmo-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #f3f3f6;
  color: #3a3a40;
  cursor: pointer;
  transition: background .15s ease;
}
.fmo-close:hover { background: #e7e7ec; }
.fmo-close svg { width: 18px; height: 18px; }
.fmo-modal .fmo-foot { margin-top: 14px; text-align: center; }

body.fmo-lock { overflow: hidden; }

/* ---------- Móvil ---------- */
@media (max-width: 767px) {
  .fmo-card { padding: 20px 18px; border-radius: 16px; }
  .fmo-title { font-size: 19px; }
  .fmo-sub { font-size: 15px; }
  .fmo-item { flex-wrap: wrap; gap: 14px; padding: 14px; }
  .fmo-thumb, .fmo-inline .fmo-thumb { width: 76px; height: 76px; }
  .fmo-info { flex: 1 1 0; }
  .fmo-name { font-size: 14px; }
  .fmo-price { font-size: 22px; }
  .fmo-actions { width: 100%; align-items: stretch; }
  .fmo-btn, .fmo-btn:focus, .fmo-btn:hover { width: 100%; min-height: 56px; }
  .fmo-no { align-self: center; min-height: 44px; }

  /* El popup sube como hoja inferior */
  .fmo-overlay { align-items: flex-end; padding: 0; }
  .fmo-modal { max-width: none; max-height: 92vh; transform: translateY(100%); }
  .fmo-modal .fmo-card {
    border-radius: 20px 20px 0 0;
    border-bottom: 0;
    padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  }
  .fmo-close { top: 12px; right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .fmo-card, .fmo-overlay, .fmo-modal, .fmo-btn, .fmo-done { animation: none !important; transition: none !important; }
}

@keyframes fmo-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fmo-rot { to { transform: rotate(360deg); } }

/* ---------- Blindaje frente a OnePageCheckoutPS ----------
   checkout.css de OPC fuerza tamaño y color en "#checkout .opc-bootstrap-* p, a, span, label…".
   Con dos IDs ganamos sin !important. */
#checkout #fmo-inline .fmo-badge, #fmo-inline.fmo-card .fmo-badge { font-size: 13px; color: #fff; font-weight: 700; line-height: 1.2; }
#checkout #fmo-inline .fmo-title, #fmo-inline.fmo-card .fmo-title { font-size: 19px; color: #1d1d1f; font-weight: 600; }
#checkout #fmo-inline .fmo-sub, #fmo-inline.fmo-card .fmo-sub { font-size: 15px; color: #2b2b2e; line-height: 1.35; }
#checkout #fmo-inline .fmo-name, #fmo-inline.fmo-card .fmo-name { font-size: 15px; color: #1d1d1f; font-weight: 500; }
#checkout #fmo-inline .fmo-price, #fmo-inline.fmo-card .fmo-price { font-size: 22px; color: var(--fmo-price); font-weight: 600; line-height: 1.1; }
#checkout #fmo-inline .fmo-qty, #fmo-inline.fmo-card .fmo-qty { font-size: 13px; color: #6b6b73; }
#checkout #fmo-inline .fmo-btn, #fmo-inline.fmo-card .fmo-btn { font-size: 16px; color: #fff; }
#checkout #fmo-inline .fmo-no, #fmo-inline.fmo-card .fmo-no { font-size: 14px; color: #6b6b73; }
#checkout #fmo-inline .fmo-done, #fmo-inline.fmo-card .fmo-done,
#checkout #fmo-inline .fmo-done span, #fmo-inline.fmo-card .fmo-done span { font-size: 16px; color: #1d1d1f; }
#checkout #fmo-inline .fmo-msg, #fmo-inline.fmo-card .fmo-msg { font-size: 14px; }
#checkout #fmo-inline .fmo-msg.is-error { color: #b42318; }
#fmo-overlay .fmo-title { font-size: 22px; color: #1d1d1f; }
#fmo-overlay .fmo-price { color: var(--fmo-price); }
.fmo-narrow .fmo-info, #checkout #fmo-inline.fmo-narrow .fmo-info { flex: 1 1 0; min-width: 0; }
.fmo-narrow .fmo-thumb, #fmo-inline.fmo-narrow .fmo-thumb { width: 72px; height: 72px; }
