/* Parada promotions scroller - isolated from mercat_highlight_section
   Usage: wrap in `.parada-promotions` with structure:
   .parada-promotions > .pp-scroller-root > .pp-scroller > .pp-track > .pp-card

   Variables (on `.parada-promotions`):
   --pp-inset: horizontal inset (px)
   --pp-gap: gap between cards
   --pp-card-w: preferred card width
   --pp-img-h: image height
*/

.parada-promotions{ --pp-inset: 12px; --pp-gap: 12px; --pp-card-w: calc(100vw - var(--pp-inset) * 2); --pp-img-h: var(--pp-card-w); }
@media(min-width:768px){ .parada-promotions{ --pp-card-w: calc(100% - var(--pp-inset) * 2); --pp-img-h: var(--pp-card-w); } }
.parada-promotions-root{ --pp-inset: 12px; --pp-gap: 12px; --pp-card-w: calc(100vw - var(--pp-inset) * 2); --pp-img-h: var(--pp-card-w); }
@media(min-width:768px){ .parada-promotions-root{ --pp-card-w: calc(100% - var(--pp-inset) * 2); --pp-img-h: var(--pp-card-w); } }

/* Scoped header rules for the promotions partial
  - ensure exact 12px left inset and avoid relying on surrounding .parada-pill-section */
.parada-promotions-root { max-width: var(--parada-highlight-max-width); margin-inline: auto; }
.parada-promotions-header { padding: var(--pp-inset, 12px); }
.parada-promotions-header .promocions-title,
.parada-promotions-header .promocions-sub { margin: 0; text-align: left; }

/* small icon next to promotions subtext */
/* decorative icon removed */

/* If promotions block is placed inside a highlight strip, remove that strip background
  but target only this block id so we don't affect other strips. */
#promocions-block.parada-highlight-strip { background: transparent; }

.pp-scroller-root{ position: relative; }

.pp-scroller{
  width: 100vw;
  margin-left: calc(-1 * (100vw - 100%) / 2);
  margin-right: calc(-1 * (100vw - 100%) / 2);
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--pp-inset);
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.pp-scroller::-webkit-scrollbar{ display: none; }

.parada-promotions .pp-scroller{
  padding-inline-start: var(--pp-inset) !important;
  padding-inline-end: 0 !important;
  scroll-padding-inline: var(--pp-inset) !important;
  box-sizing: border-box !important;
}

.pp-track{
  display:flex;
  gap: var(--pp-gap);
  padding-block: 6px 18px;
  align-items: stretch;
}

.parada-promotions .pp-track::after{
  content: '';
  flex: 0 0 var(--pp-inset);
  margin-left: calc(var(--pp-gap) * -1);
  width: var(--pp-inset);
  height: 1px;
}

.pp-card{
  box-sizing: border-box;
  flex: 0 0 var(--pp-card-w);
  min-width: var(--pp-card-w);
  display:flex;
  flex-direction:column;
  background: var(--card-bg, #fff);
  overflow:hidden;
  border-radius: 16px;
  border: 0.5px solid #b2bab1;
  text-decoration:none;
  color:inherit;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  scroll-snap-align: start;
}

/* allow positioning price at the bottom of the card */
.pp-card{ position: relative; }

/* Ensure no interactive hover effects are applied to promotion cards (override site-wide rules) */
#promocions-block .pp-card:hover,
#promocions-block .pp-card:active,
#promocions-block .pp-card:focus-visible{
  transform: none !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12) !important;
  transition: none !important;
}

.pp-img{ width:100%; height:var(--pp-img-h); background:#ececec; position:relative; overflow:hidden; }
.pp-img.img-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 3px solid rgba(0,0,0,0.12);
  border-top-color: #5B7065;
  animation: pp-spin 0.7s linear infinite;
  pointer-events: none;
}
@keyframes pp-spin { to { transform: rotate(360deg); } }
.pp-img img{ width:100%; height:100%; object-fit:cover; display:block; }

/* Position add-to-cart stepper overlay inside promotion images */
.pp-card .product-action-stepper-wrapper{ position: absolute; right: 5px; left: auto; bottom: 5px; z-index: 999; background: transparent; box-shadow: 0 0 0 0.5px rgba(255,255,255,0.95); border-radius: calc(var(--stepper-height, var(--stepper-height-default)) / 2 + 2px); }
.pp-card .product-action-stepper-wrapper .product-actions{ display: block; }

.pp-meta{ padding: 10px 8px 46px; display:flex; flex-direction:column; gap:6px; align-items:stretch; justify-content:center; flex:1; }
.pp-meta > *{ margin:0; white-space:normal; overflow-wrap:break-word; }

/* Prominent product title inside promotion cards */
.pp-title{
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1.05;
  color: #111; /* standard dark text */
  letter-spacing: -0.2px;
  padding: 0 6px 12px; /* extra bottom padding */
  width: 100%;
  text-align: center;
}
.pp-sub{
  font-size: 1.05rem;
  font-weight: 600;
  color: rgba(0,0,0,0.55);
  width: 100%;
  align-self: stretch;
  padding: 0 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.pp-track .pp-card:first-of-type{ border-top-left-radius: 16px; border-bottom-left-radius: 16px; }
.pp-track .pp-card:last-of-type{ border-top-right-radius: 16px; border-bottom-right-radius: 16px; }

/* Price left, countdown right alignment inside promotion card */
.pp-price{ order: 2; text-align: right; font-weight: 700; font-size: 1.4rem; position: absolute; right: 12px; bottom: 12px; }
.pp-countdown{ text-align: right; font-weight: 400; color: rgba(0,0,0,0.55); }

/* Right-side vertical stack for date + countdown */
.pp-meta-right{ position: absolute; left: 12px; bottom: 12px; order: 1; display:flex; flex-direction:column; align-items:flex-start; gap:2px; text-align: left; }
.pp-expires{ font-size: 0.95rem; color: var(--muted-text, #777); }
.pp-countdown{ font-size: 0.85rem; opacity: 0.85; }

@media(min-width:768px){ .pp-card{ flex:0 0 var(--pp-card-w); } .pp-img{ height:250px; } .pp-track{ gap:3px; } .pp-title{ font-size: 1.6rem; } .pp-sub{ font-size: 1.1rem; } .pp-price{ font-size: 1.6rem; } }

.pp-scroller:focus-visible{ outline: 2px solid rgba(0,128,0,0.12); }

/* Scroll indicator for promotions: dots that turn into a dash for the active card */
.pp-indicator{
  display:flex;
  justify-content:center;
  gap:8px;
  margin-top:10px;
  padding-inline:12px;
}
.pp-indicator span{
  display:inline-block;
  width:6px;
  height:6px;
  background: rgba(0,0,0,0.45);
  border-radius:50%;
  transition: all .18s ease;
}
.pp-indicator span.active{
  width:18px;
  height:6px;
  border-radius:3px;
  background: rgba(0,0,0,0.85);
}

/* Chips for promotions (small variant of the Avui product chips) */
.pp-chips { position: absolute; left: 5px; top: 5px; z-index: 6; display: flex; gap: 6px; }
.pp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; font-size: 12px; color: #fff; font-weight: 700; line-height: 1; background: rgba(0,0,0,0.6); }
.pp-chip i.bi { font-size: 0.95em; line-height: 1; display: inline-block; }
.pp-chip--destacat { background: #E88A8A; color: #111; box-shadow: 0 2px 6px rgba(0,0,0,0.12); font-size: 22px; padding: 12px 24px; }

@media (max-width:420px){ .pp-chip { font-size: 10px; padding: 3px 6px; } .pp-chip--destacat { font-size: 14px; padding: 6px 10px; } }
