/**
 * css/novedades.css
 * Burbuja flotante de novedades (con aro de luz), visor de historias, pantalla de bienvenida al iniciar sesión,
 * logo de empresa (.av.logo), interruptor (.sw) y atajo del logo POS LISTO (.logo-home).
 * Lo usan: js/novedades.js, js/empresa-edit.js, js/ui-kit.js (swHtml), js/admin-params.js
 */

/* ---------- Logo de empresa y atajo del logo POS LISTO ---------- */
.av {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--indigo);
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-style: normal;
  font-weight: 700;
  flex: none;
  overflow: hidden;
}
.av.logo {
  background: #fff;
  border: 1px solid var(--line);
}
.av.logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.av.sm {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 13px;
}
.av.xs {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  font-size: 11px;
}
.co-id {
  display: flex;
  align-items: center;
  gap: 10px;
}
.co-id span {
  display: flex;
  flex-direction: column;
}
.ws-co {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.logo-home {
  cursor: pointer;
  border-radius: 12px;
  transition: transform 0.15s;
}
.logo-home:hover {
  transform: scale(1.03);
}
.logo-home:focus-visible {
  outline: 3px solid var(--mint);
  outline-offset: 4px;
}

/* ---------- Interruptor (switch) ---------- */
.sw {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  min-height: 44px;
}
.sw input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.sw i {
  position: relative;
  flex: none;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: #b9b8d3;
  transition: background 0.2s;
}
.sw i::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px #0004;
  transition: transform 0.2s;
}
.sw input:checked + i {
  background: var(--mint);
}
.sw input:checked + i::after {
  transform: translateX(20px);
}
.sw input:focus-visible + i {
  outline: 3px solid #3a379055;
  outline-offset: 2px;
}
.sw input:disabled + i {
  opacity: 0.45;
}
.sw span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sw small {
  color: var(--mute);
  font-weight: 400;
}

/* ---------- Pantalla de Novedades del superadmin ---------- */
.nv-sec {
  margin-bottom: 16px;
}
.nv-h {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 12px;
}
.nv-h h3 {
  margin: 0 0 4px;
}
.nv-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.nv-th {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
  background: var(--line);
}

/* ---------- Burbuja flotante con aro ---------- */
.news-fab {
  --n1: #7c5cff;
  --n2: #22b48a;
  position: fixed;
  bottom: 22px;
  z-index: 40;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.news-fab.right {
  right: 18px;
}
.news-fab.left {
  left: 18px;
  bottom: 78px;
}
.news-fab[hidden] {
  display: none;
}
.news-fab .ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--line);
}
.news-fab.new .ring {
  background: conic-gradient(var(--n1), var(--n2), var(--n1));
  animation: nfSpin 3s linear infinite;
  box-shadow: 0 0 18px var(--n1);
}
.news-fab .in {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--card);
  color: var(--indigo2);
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 4px 14px #0003;
}
.news-fab .in svg {
  width: 26px;
  height: 26px;
}
.news-fab .in img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@keyframes nfSpin {
  to {
    transform: rotate(360deg);
  }
}
/* En celular la burbuja sube para no tapar los botones de abajo */
@media (max-width: 700px) {
  .news-fab {
    bottom: 84px;
    width: 52px;
    height: 52px;
  }
  .news-fab.left {
    bottom: 140px;
  }
}

/* ---------- Visor de historias ---------- */
.news-ov {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(10, 10, 40, 0.82);
  display: grid;
  place-items: center;
}
.news-card {
  position: relative;
  width: min(420px, 100vw);
  height: min(780px, 100dvh);
  background: var(--card);
  color: var(--ink);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
@media (max-width: 500px) {
  .news-card {
    border-radius: 0;
  }
}
.news-bars {
  position: absolute;
  top: 10px;
  left: 12px;
  right: 56px;
  z-index: 3;
  display: flex;
  gap: 4px;
}
.news-bars i {
  flex: 1;
  height: 3px;
  border-radius: 3px;
  background: #fff6;
  overflow: hidden;
}
.news-bars b {
  display: block;
  height: 100%;
  width: 0;
  background: #fff;
}
.news-bars .done b {
  width: 100%;
}
.news-bars .cur b {
  animation: nbFill linear forwards;
}
@keyframes nbFill {
  to {
    width: 100%;
  }
}
.news-x {
  position: absolute;
  top: 2px;
  right: 6px;
  z-index: 4;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 30px;
  cursor: pointer;
  text-shadow: 0 1px 4px #0008;
}
.news-img {
  width: 100%;
  flex: 1;
  min-height: 0;
  object-fit: cover;
  background: var(--indigo);
}
.news-img.ph {
  background: linear-gradient(135deg, var(--indigo), var(--mint));
}
.news-body {
  padding: 16px 18px 22px;
  position: relative;
  z-index: 3;
}
.news-body h3 {
  margin: 0 0 6px;
  font-size: 20px;
}
.news-body p {
  margin: 0 0 14px;
  color: var(--mute);
  white-space: pre-line;
}
.news-link {
  display: block;
  text-align: center;
  padding: 13px;
  border-radius: 12px;
  background: var(--indigo);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}
.news-link.p-youtube {
  background: #e02424;
}
.news-link.p-facebook {
  background: #1877f2;
}
.news-link.p-instagram {
  background: linear-gradient(45deg, #f09433, #dc2743, #bc1888);
}
.news-nav {
  position: absolute;
  top: 60px;
  bottom: 190px;
  width: 38%;
  border: 0;
  background: transparent;
  cursor: pointer;
  z-index: 2;
}
.news-nav.prev {
  left: 0;
}
.news-nav.next {
  right: 0;
}

/* ---------- Bienvenida al iniciar sesión ---------- */
.wel {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  background: linear-gradient(160deg, #27245c, #3a3790 60%, #16976f);
  color: #fff;
  opacity: 1;
  transition: opacity 0.55s ease;
}
.wel.out {
  opacity: 0;
  pointer-events: none;
}
.wel-in {
  max-width: 520px;
  width: 100%;
  animation: welIn 0.6s ease both;
}
@keyframes welIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}
.wel-logo {
  justify-content: center;
  margin-bottom: 22px;
  font-size: 22px;
}
.wel-imgs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
}
.wel-imgs img {
  max-width: 30%;
  max-height: 140px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 8px 24px #0005;
}
.wel h1 {
  margin: 0 0 8px;
  font-size: clamp(26px, 6vw, 38px);
}
.wel p {
  margin: 0 0 26px;
  font-size: 18px;
  opacity: 0.9;
  white-space: pre-line;
}
.wel-bar {
  height: 4px;
  border-radius: 4px;
  background: #fff3;
  overflow: hidden;
  max-width: 240px;
  margin: 0 auto;
}
.wel-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: #fff;
  animation: nbFill linear forwards;
}

/* ---------- Menú de pedidos (productos y opciones por QR) y lista de QR ---------- */
.sw-mini {
  min-height: 0;
  display: inline-flex;
}
.pd-wrap {
  overflow-x: auto;
  margin: 8px 0 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.pd-tbl {
  width: 100%;
  min-width: 360px;
}
.pd-tbl .c {
  text-align: center;
}
.pd-tbl .pd-cat td {
  background: var(--indbg);
  color: var(--indigo2);
  font-weight: 700;
}
.pd-all {
  display: block;
  font-weight: 400;
  font-size: 11px;
  text-transform: none;
  letter-spacing: 0;
}
.pd-all .link {
  padding: 0;
  font-size: 11px;
}
.qr-intro {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}
.qr-intro p {
  margin: 4px 0 0;
  max-width: 62ch;
}
.qr-list {
  margin-top: 16px;
}
.ql-g {
  margin-top: 14px;
}
.ql-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.ql-t {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
}
.ql-t span {
  flex: 1;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qr-img {
  max-width: 100%;
}
.pd-pm {
  display: none;
}
@media (max-width: 700px) {
  table.pd-tbl {
    min-width: 0;
    table-layout: fixed;
    width: 100%;
  }
  /* La columna de precio se vuelve de ancho cero (el precio se ve bajo el nombre) sin quitar la columna, para que las filas de categoría sigan abarcando todo */
  .pd-tbl .pd-pc {
    width: 0;
    padding: 0;
    border: 0;
    font-size: 0;
    overflow: hidden;
  }
  .pd-pm {
    display: block;
    color: var(--mute);
  }
  .pd-tbl td.c,
  .pd-tbl th.c {
    width: 64px;
    padding-left: 4px;
    padding-right: 4px;
  }
  .pd-tbl td:first-child {
    word-break: break-word;
  }
}
#pform .sw.sw-mini {
  padding: 0;
  border: 0;
  background: transparent;
}
