/* =========================================================
   PROMOS DE NEGOCIOS EN EL CARRUSEL DEL HOME
   Usa las variables de marca (--color-marca, --color-marca-soft…)
   que index.php ya inyecta en :root.
========================================================= */

/* ── Slide ── */
.qp-hero-card--promo {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.qp-hero-card--promo:focus-visible {
  outline: 3px solid var(--color-marca);
  outline-offset: 2px;
}
.qp-hero-card--promo .qp-hero-card-bg {
  transition: transform .5s ease;
}
@media (hover: hover) {
  .qp-hero-card--promo:hover .qp-hero-card-bg { transform: scale(1.03); }
}

/* Oscurece arriba y abajo para que el texto se lea sobre cualquier foto */
.qp-hpromo-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,0) 28%),
    linear-gradient(0deg, rgba(0,0,0,.82) 0%, rgba(0,0,0,.45) 38%, rgba(0,0,0,0) 62%);
}

/* Fila superior: negocio + etiqueta de la promo */
.qp-hpromo-top {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.qp-hpromo-store {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 62%;
  padding: 4px 11px 4px 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .28);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .22);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.qp-hpromo-store img,
.qp-hpromo-store-initial {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}
.qp-hpromo-store-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-marca-light);
  color: var(--color-marca);
  font-size: 12px;
  font-weight: 800;
}
.qp-hpromo-store-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qp-hpromo-tag {
  flex-shrink: 0;
  padding: 7px 11px;
  border-radius: 10px;
  background: var(--color-marca);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.2px;
  box-shadow: 0 4px 14px rgba(0,0,0,.22);
}

/* Bloque inferior */
.qp-hpromo-bottom {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.qp-hpromo-when {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
}
.qp-hpromo-when i { font-size: 10.5px; }

.qp-hpromo-title {
  margin: 8px 0 2px;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.3px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.25);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.qp-hpromo-sub {
  margin: 0;
  font-size: 13px;
  opacity: .92;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.qp-hpromo-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 2px;
}
.qp-hpromo-price strong { font-size: 20px; font-weight: 800; }
.qp-hpromo-price s { font-size: 13px; opacity: .75; }

.qp-hpromo-gift {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
}
.qp-hpromo-gift i { color: #ffd27a; }

.qp-hpromo-foot {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.qp-hpromo-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 999px;
  background: #fff;
  color: #1c1c1e;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
.qp-hpromo-cta i { font-size: 11px; color: var(--color-marca); }

.qp-hpromo-pag {
  font-size: 11px;
  font-weight: 700;
  opacity: .8;
}

/* ── Hoja inferior de la promo (reglas) ── */
.qp-promo-sheet {
  max-height: 88vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* La hoja va encima de la barra inferior y del aviso de "Pedido en curso",
   así se ven completos los últimos productos de la lista */
#qpPromoSheetBackdrop { z-index: 10040 !important; }
#qpPromoSheet {
  z-index: 10041 !important;
  padding-bottom: calc(20px + env(safe-area-inset-bottom)) !important;
}

.qp-psheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.qp-psheet-head .qp-hpromo-store {
  max-width: 80%;
  background: #f4f4f5;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-color: transparent;
  color: #1c1c1e;
  text-shadow: none;
  box-shadow: none;
}

.qp-psheet-hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  background-color: #f4f4f5;
  background-size: cover;
  background-position: center;
  margin-bottom: 14px;
}

.qp-psheet-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.qp-psheet-tag {
  flex-shrink: 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--color-marca);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.4px;
}
.qp-psheet-info-txt { min-width: 0; }
.qp-psheet-title {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.2;
  color: #1c1c1e;
}
.qp-psheet-when {
  margin-top: 3px;
  font-size: 13px;
  color: #6b6b70;
}
.qp-psheet-when i { font-size: 11px; margin-right: 3px; }

.qp-psheet-how {
  margin: 14px 0 6px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--color-marca-soft);
  color: #1c1c1e;
  font-size: 14px;
  line-height: 1.45;
}
.qp-psheet-cond {
  margin: 0;
  font-size: 12px;
  color: #6b6b70;
}

.qp-psheet-list-title {
  margin: 18px 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: #6b6b70;
}

.qp-psheet-list {
  display: grid;
  gap: 8px;
}

.qp-psheet-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px;
  border: 1px solid #ececee;
  border-radius: 14px;
  background: #fff;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.qp-psheet-item:active { background: #fafafa; }
@media (hover: hover) {
  .qp-psheet-item:hover { border-color: var(--color-marca-border); }
}
.qp-psheet-item img {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: #f4f4f5;
}
.qp-psheet-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.qp-psheet-item-name {
  font-size: 14px;
  font-weight: 700;
  color: #1c1c1e;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qp-psheet-item-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-marca);
}
.qp-psheet-item-add {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-marca-light);
  color: var(--color-marca);
  font-size: 14px;
}

.qp-psheet-note {
  margin: 16px 0 4px;
  text-align: center;
  font-size: 12px;
  color: #6b6b70;
}
.qp-psheet-note i { margin-right: 4px; }

@media (prefers-reduced-motion: reduce) {
  .qp-hero-card--promo .qp-hero-card-bg { transition: none; }
}

/* =========================================================
   CARRUSEL MÁS BAJO (productos y promos)
========================================================= */
.qp-hero-carousel .qp-hero-card {
  height: 196px;
  min-height: 0;
  aspect-ratio: auto;
}

/* Promos: todo más compacto para que quepa en 196px */
.qp-hpromo-top {
  top: 10px;
  left: 10px;
  right: 10px;
}
.qp-hpromo-bottom {
  left: 12px;
  right: 12px;
  bottom: 12px;
}
.qp-hpromo-title {
  margin: 6px 0 1px;
  font-size: 18px;
  -webkit-line-clamp: 1;
}
.qp-hpromo-price strong { font-size: 18px; }
.qp-hpromo-gift { margin-top: 2px; }
.qp-hpromo-foot { margin-top: 8px; }
.qp-hpromo-cta {
  padding: 8px 13px;
  font-size: 12.5px;
}

/* ── Progreso de la promo en la hoja ── */
.qp-psheet-progreso {
  margin: 10px 0 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 13px;
  font-weight: 700;
}
.qp-psheet-progreso.is-done {
  background: #e8f8ee;
  border-color: #b7e4c7;
  color: #1e7b3a;
}
.qp-psheet-progreso-txt i { margin-right: 4px; }
.qp-psheet-progreso-bar {
  height: 6px;
  margin-top: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .08);
  overflow: hidden;
}
.qp-psheet-progreso-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--color-marca);
  transition: width .35s ease;
}
.qp-psheet-progreso.is-done .qp-psheet-progreso-bar span { background: #1e7b3a; }

/* ── Producto que ya está en el carrito ── */
.qp-psheet-item.is-in-cart { border-color: #b7e4c7; background: #f6fcf8; }
.qp-psheet-item-incart:empty { display: none; }
.qp-psheet-item-incart {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #1e7b3a;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.qp-psheet-item.is-in-cart .qp-psheet-item-add { display: none; }

/* ── Hoja de la promo separada por categorías ── */
.qp-psheet-cat-hint {
  margin: -4px 0 10px;
  font-size: 12.5px;
  color: #6b6b70;
}
.qp-psheet-cat + .qp-psheet-cat { margin-top: 16px; }
.qp-psheet-cat-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 800;
  color: #1c1c1e;
}
.qp-psheet-cat-title span {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-marca-light);
  color: var(--color-marca);
  font-size: 11px;
  font-weight: 800;
}