/**
 * ph_productflashoffer - Front styles
 *
 * Design notes
 *  - Typography, buttons (.btn .btn-primary) and links are inherited from the
 *    active theme, so the block follows the shop identity without extra work.
 *  - To tune the look, only edit the design tokens (first block).
 *  - Breakpoints: tablet <= 991px, mobile <= 575px.
 */

/* ---------- Design tokens ---------- */
.phfo,
.phfo-hero,
.phfo-page {
  --phfo-accent: #c4314b;          /* ribbon, discount badge, timer chip */
  --phfo-accent-soft: #fbeaed;
  --phfo-ink: #262626;
  --phfo-muted: #6f6f6f;
  --phfo-line: #ebe6e1;
  --phfo-surface: #fff;
  --phfo-soft: #f6f2ee;
  --phfo-star: #c99a3d;
  --phfo-radius: 16px;
  --phfo-radius-lg: 24px;
  --phfo-shadow: 0 18px 40px -22px rgba(0, 0, 0, .32);
  --phfo-gap: 18px;
}

.phfo [hidden] {
  display: none !important;
}

.phfo .sr-only,
.phfo .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.phfo,
.phfo *,
.phfo *::before,
.phfo *::after {
  box-sizing: border-box;
}

/* ---------- Hero (dedicated page) ---------- */
.phfo-hero {
  padding: 28px 16px 8px;
  text-align: center;
  color: var(--phfo-ink);
}

.phfo-hero__kicker {
  display: block;
  margin-bottom: 10px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--phfo-accent);
}

.phfo-hero__title {
  max-width: 860px;
  margin: 0 auto 14px;
  font-size: clamp(1.6rem, 4.6vw, 2.9rem);
  line-height: 1.1;
}

.phfo-hero__title em {
  font-style: italic;
  color: var(--phfo-accent);
}

.phfo-hero__intro {
  max-width: 720px;
  margin: 0 auto;
  color: var(--phfo-muted);
  line-height: 1.6;
}

.phfo-page {
  padding-top: 8px;
}

.phfo-empty {
  padding: 48px 16px;
  text-align: center;
  color: var(--phfo-muted);
}

/* ---------- Sections ---------- */
.phfo-section {
  padding: 28px 0;
}

.phfo-section__head {
  margin-bottom: 26px;
  text-align: center;
}

.phfo-section__title {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.2;
}

/* ---------- Featured offer ---------- */
.phfo-pod {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr) minmax(0, .7fr);
  grid-template-rows: 0.5fr 1.5fr;
  align-items: stretch;
  overflow: hidden;
  background: var(--phfo-surface);
  border: 1px solid var(--phfo-line);
  border-radius: var(--phfo-radius-lg);
  box-shadow: var(--phfo-shadow);
}

/* Desktop */
.phfo-pod__media {
  grid-column: 1;
  grid-row: 1 / 3;
}

.phfo-pod__info {
  grid-column: 2;
  grid-row: 1;
}

.phfo-pod__description {
  grid-column: 2;
  grid-row: 2;
}

.phfo-pod__price {
  grid-column: 3;
  grid-row: 1 / 3;
}

.phfo-pod__media {
  position: relative;
  min-width: 0;
  margin: auto;
  margin-left: 14px;
  margin-right: 14px;
  overflow: hidden;
  border-radius: var(--phfo-radius);
  background: var(--phfo-soft);
  align-self: start;
  aspect-ratio: 1 / 1;
}

.phfo-pod__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.phfo-pod__ribbon {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 8px 16px 8px 12px;
  border-radius: 0 0 var(--phfo-radius) 0;
  background: var(--phfo-accent);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.phfo-pod__chip {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 2;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff;
  color: var(--phfo-accent);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .03em;
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .35);
}

.phfo-countdown {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 26px 10px 12px;
  background: linear-gradient(0deg, rgba(0, 0, 0, .68) 0%, rgba(0, 0, 0, 0) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  pointer-events: none;
}

.phfo-countdown__unit {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}

.phfo-countdown__unit small {
  font-size: .6rem;
  font-weight: 600;
  text-transform: uppercase;
  opacity: .85;
}

.phfo-countdown__sep {
  opacity: .6;
}

.phfo-pod__ended {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 16px;
  background: rgba(0, 0, 0, .62);
  color: #fff;
  font-weight: 700;
  text-align: center;
}

.phfo-pod__info, .phfo-pod__description {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.phfo-pod__info {
  padding: 30px 26px;
}

.phfo-pod__description {
  padding: 0 26px;
  padding-bottom: 20px;
}

.phfo-pod__title {
  margin: 0;
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.phfo-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--phfo-muted);
  margin-top: -15px;
}

.phfo-rating__stars {
  color: var(--phfo-star);
  letter-spacing: 2px;
}

.phfo-pod__desc {
  font-size: .92rem;
  line-height: 1.6;
  color: var(--phfo-muted);
  overflow-wrap: anywhere;
  text-align: justify;
}

.phfo-pod__desc > :last-child {
  margin-bottom: 0;
}

.phfo-pod__desc strong {
  color: var(--phfo-ink);
}

.phfo-pod__benefits {
  font-size: .9rem;
  overflow-wrap: anywhere;
  text-align: justify;
}

.phfo-pod__benefits ul,
.phfo-pod__benefits ol {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.phfo-pod__benefits li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
}

.phfo-pod__benefits li::before {
  content: "\2713";
  flex-shrink: 0;
  font-weight: 700;
  color: var(--phfo-accent);
}

.phfo-pod__benefits > :last-child {
  margin-bottom: 0;
}

.phfo-pod__link {
  align-self: flex-end;
  margin: 0;
  font-weight: 700;
  font-size: .9rem;
  text-decoration: none;
}

.phfo-pod__link:hover,
.phfo-pod__link:focus {
  text-decoration: underline;
}

/* Price panel */
.phfo-pod__price {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: center;
  gap: 6px;
  min-width: 0;
  margin: 24px 24px 24px 0;
  padding: 26px 22px;
  border: 1px solid var(--phfo-line);
  border-radius: var(--phfo-radius);
  text-align: center;
}

.phfo-price__old {
  font-size: .95rem;
  color: var(--phfo-muted);
}

.phfo-price__new {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  font-weight: 700;
  line-height: 1.1;
}

.phfo-price__badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--phfo-accent);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
}

.phfo-price__save {
  margin-bottom: 12px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--phfo-muted);
}

.phfo-pod__price .product-variants-item .form-control-label {
    padding: 0;
    margin-top: 0;
}

.phfo-pod__price .attribute-name {
	display: block;
    font-size: 12px;
    margin-left: 16px;
}

.phfo-pod__cta {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  width: 100%;
  margin-top: 6px;
}

/* Only layout: colours, font and radius come from the theme's .btn-primary */
.phfo-btn {
  display: block;
  width: 100%;
  white-space: normal;
}

.phfo-perks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: .8rem;
  color: var(--phfo-muted);
}

.phfo-perks li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  text-align: left;
}

.phfo-perks__icon {
  display: inline-flex;
  flex-shrink: 0;
  opacity: .75;
}

/* Finished (the countdown reached zero while the page was open) */
.phfo-pod.is-ended .phfo-pod__cta,
.phfo-pod.is-ended .phfo-countdown,
.phfo-pod.is-ended .phfo-pod__chip {
  display: none;
}

.phfo-pod.is-ended .phfo-price__new,
.phfo-pod.is-ended .phfo-price__old {
  opacity: .45;
}

/* ---------- Upcoming carousel ---------- */
.phfo-carousel {
  --phfo-pv: var(--phfo-pv-desktop, 4);
  position: relative;
}

.phfo-carousel__viewport {
  overflow: hidden;
}

.phfo-carousel__track {
  display: flex;
  gap: var(--phfo-gap);
  margin: 0;
  padding: 6px 2px 14px;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.phfo-carousel__track::-webkit-scrollbar {
  display: none;
}

.phfo-carousel__track:focus-visible {
  outline: 2px solid var(--phfo-accent);
  outline-offset: 2px;
  border-radius: var(--phfo-radius);
}

@media (prefers-reduced-motion: no-preference) {
  .phfo-carousel__track {
    scroll-behavior: smooth;
  }
}

.phfo-carousel__item {
  flex: 0 0 calc((100% - (var(--phfo-pv) - 1) * var(--phfo-gap)) / var(--phfo-pv));
  min-width: 0;
  margin: 0;
  scroll-snap-align: start;
}

/* Fewer products than the slide size: centre them */
.phfo-carousel.is-static .phfo-carousel__track {
  justify-content: center;
}

.phfo-carousel.is-static .phfo-carousel__item {
  max-width: 300px;
}

.phfo-carousel__nav {
  position: absolute;
  top: calc(50% - 30px);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--phfo-line);
  border-radius: 50%;
  background: #fff;
  color: var(--phfo-ink);
  cursor: pointer;
  box-shadow: 0 8px 18px -8px rgba(0, 0, 0, .4);
  transition: opacity .2s ease, transform .2s ease;
}

.phfo-carousel__nav--prev {
  left: -6px;
}

.phfo-carousel__nav--next {
  right: -6px;
}

.phfo-carousel__nav:hover:not(:disabled) {
  transform: scale(1.06);
}

.phfo-carousel__nav:disabled {
  opacity: .35;
  cursor: default;
}

.phfo-carousel__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

.phfo-carousel__dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--phfo-line);
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}

.phfo-carousel__dot[aria-current="true"] {
  background: var(--phfo-accent);
  transform: scale(1.25);
}

/* Upcoming card (locked) */
.phfo-up {
  height: 100%;
  overflow: hidden;
  background: var(--phfo-surface);
  border: 1px solid var(--phfo-line);
  border-radius: 18px;
  box-shadow: 0 10px 22px -14px rgba(0, 0, 0, .35);
}

.phfo-up__media {
  position: relative;
  overflow: hidden;
  background: var(--phfo-soft);
  aspect-ratio: 1 / 1;
}

.phfo-up__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: blur(7px);
  transform: scale(1.06);
  opacity: .8;
}

/* Sin difuminado cuando el admin desactiva la opción en Configuración */
.phfo-up__img--sharp {
  filter: none;
  transform: none;
  opacity: 1;
}

.phfo-up__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .55);
}

.phfo-up__lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  color: var(--phfo-ink);
  box-shadow: 0 8px 18px -8px rgba(0, 0, 0, .4);
}

.phfo-up__day {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 2;
  transform: translateX(-50%);
  padding: 5px 26px;
  border-radius: 0 0 10px 10px;
  background: var(--phfo-ink);
  color: #fff;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.phfo-up__body {
  padding: 14px 12px 16px;
  text-align: center;
}

.phfo-up__text {
  font-size: .82rem;
  font-weight: 700;
  color: var(--phfo-accent);
}

/* ---------- Responsive ---------- */

/* Tablet: 768px a 1023px */
@media (min-width: 768px) and (max-width: 1023px) {
  .phfo-pod {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    gap: 0;
	padding: 1em;
  }

  .phfo-pod__media {
    grid-column: 1;
    grid-row: 1;
  }

  .phfo-pod__info {
    grid-column: 1 / 3;
    grid-row: 2;	
    padding: 15px 0 10px 0;
  }

  .phfo-pod__description {
    grid-column: 1 / 3;
    grid-row: 3;
	padding: 0 15px;
	padding-bottom: 0;
  }

  .phfo-pod__price {
    grid-column: 2;
    grid-row: 1;
	margin: 0 5px;
  }
  
  .phfo-pod__link {
	width: 100%;
    text-align: right;
  }
  
  .phfo-carousel {
    --phfo-pv: var(--phfo-pv-tablet, 2);
  }
  
  .phfo-carousel__nav--prev {
    left: 2px;
  }

  .phfo-carousel__nav--next {
    right: 2px;
  }
}


/* Móvil: hasta 767px */
@media (max-width: 767px) {
  .phfo-section {
    padding: 18px 0;
  }
  
  .phfo-pod {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
	padding: 1em 0;
  }

  .phfo-pod__media { grid-row: 1; aspect-ratio: 1 / 1;}
  .phfo-pod__info { grid-row: 2; padding-bottom: 0;}
  .phfo-pod__price { grid-row: 3; margin: 24px; }
  .phfo-pod__description { grid-row: 4; padding-bottom: 0;}

  .phfo-pod__media,
  .phfo-pod__info,
  .phfo-pod__description,
  .phfo-pod__price {
    grid-column: 1;
  }
  .phfo-pod__benefits {text-align: left;}
  .phfo-carousel {
    --phfo-pv: var(--phfo-pv-mobile, 2);
    --phfo-gap: 12px;
  }

  .phfo-carousel__nav {
    width: 36px;
    height: 36px;
  }

  .phfo-up__day {
    padding: 4px 14px;
    font-size: .6rem;
  }

  .phfo-up__text {
    font-size: .75rem;
  }
}
