@import '../components/health-score-modal.css';

/* ProductDetailView — allineato a search-page / index (dark #0B1120, card #111827, teal #00d2ff) */

.view--product {
  --ss-teal: #00d2ff;
  --ss-orange: #f97316;
  --ss-dark: #0b1120;
  --ss-card: #111827;
  --ss-success: #10b981;
  --ss-accent: #1e293b;
  box-sizing: border-box;
  width: 100%;
  min-height: 100%;
  background: var(--ss-dark);
  color: #cbd5e1;
  padding-bottom: var(--space-8);
}

[data-theme="light"] .view--product {
  background: var(--color-bg);
  color: var(--color-text);
  --ss-teal: #0d9488;
  --ss-dark: var(--color-bg);
  --ss-card: var(--color-surface);
  --ss-accent: var(--color-surface-2);
}

.view--product .product-detail__empty {
  margin-inline: auto;
}

.product-detail {
  box-sizing: border-box;
  max-width: 80rem;
  margin-inline: auto;
  width: 100%;
  padding: 1.25rem 1rem 2rem;
}

@media (min-width: 640px) {
  .product-detail {
    padding-inline: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .product-detail {
    padding-inline: 2rem;
  }
}

/* Breadcrumb */
.product-detail__breadcrumb {
  margin-bottom: 1.25rem;
}

.product-detail__breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.75rem;
  color: #64748b;
}

.product-detail__breadcrumb-list li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.product-detail__breadcrumb-list li:not(:last-child)::after {
  content: '';
  display: inline-block;
  width: 0.28rem;
  height: 0.28rem;
  border-right: 1px solid #475569;
  border-bottom: 1px solid #475569;
  transform: rotate(-45deg);
  margin-left: 0.15rem;
  opacity: 0.7;
}

.product-detail__crumb-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.product-detail__crumb-link:hover {
  color: #f1f5f9;
}

[data-theme="light"] .product-detail__crumb-link:hover {
  color: var(--color-text);
}

.product-detail__breadcrumb-current {
  color: var(--ss-teal);
  font-weight: 600;
}

.product-detail__grid {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: 1fr;
  align-items: start;
}

@media (min-width: 1024px) {
  .product-detail__grid {
    grid-template-columns: minmax(280px, 400px) minmax(0, 1fr);
    gap: 2.5rem;
  }
}

@media (min-width: 1280px) {
  .product-detail__grid {
    grid-template-columns: minmax(300px, 450px) minmax(0, 1fr);
  }
}

.product-detail__media-col {
  width: 100%;
}

@media (min-width: 1024px) {
  .product-detail__media-col {
    position: sticky;
    /* Sotto fascia + navbar (`.site-header` intero è sticky in site-navbar-app) */
    top: 9.25rem;
    align-self: start;
  }
}

.product-detail__figure {
  position: relative;
  inline-size: 100%;
  max-inline-size: 22rem;
  margin-inline: auto;
  aspect-ratio: 1 / 1;
  background-color: #fff;
  border-radius: 1.5rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(0, 0, 0, 0.2);
}

@media (min-width: 1024px) {
  .product-detail__figure {
    margin-inline: 0;
    max-inline-size: none;
  }
}

.product-detail__figure--fallback {
  min-block-size: 25rem;
}

.product-detail__img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.product-detail__hero-store-badge {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 3;
  padding: 0.28rem 0.4rem;
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.94);
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.14),
    0 0 0 1px rgba(0, 0, 0, 0.06);
  line-height: 0;
  pointer-events: none;
}

.product-detail__hero-store-badge .supermarket-logo__img,
.product-detail__hero-store-badge .supermarket-logo__avatar {
  display: block;
  width: 56px !important;
  height: 56px !important;
}

@media (max-width: 639px) {
  .product-detail__hero-store-badge {
    top: 0.45rem;
    right: 0.45rem;
    padding: 0.22rem 0.32rem;
    border-radius: 0.58rem;
  }

  .product-detail__hero-store-badge .supermarket-logo__img,
  .product-detail__hero-store-badge .supermarket-logo__avatar {
    width: 48px !important;
    height: 48px !important;
  }
}

[data-theme="light"] .product-detail__hero-store-badge {
  background: rgba(255, 255, 255, 0.97);
  box-shadow:
    0 2px 12px rgba(15, 23, 42, 0.1),
    0 0 0 1px rgba(15, 23, 42, 0.06);
}

.product-detail__gallery-dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.85rem;
}

.product-detail__gallery-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 9999px;
  background: #475569;
}

.product-detail__gallery-dot--active {
  background: var(--ss-teal);
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.35);
}

.product-detail__main {
  min-width: 0;
}

.product-detail__header {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

.product-detail__figure .health-score-trigger.product-detail__health-trigger {
  position: absolute;
  bottom: 0.5rem;
  left: 0.5rem;
  top: auto;
  right: auto;
  z-index: 4;
  width: 2.35rem;
  height: 2.35rem;
}

@media (max-width: 639px) {
  .product-detail__figure .health-score-trigger.product-detail__health-trigger {
    bottom: 0.42rem;
    left: 0.42rem;
    width: 2.05rem;
    height: 2.05rem;
  }
}

.product-detail__title {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #f8fafc;
}

[data-theme="light"] .product-detail__title {
  color: var(--color-text);
}

.product-detail__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.product-detail__tag {
  padding: 0.25rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: #94a3b8;
  background: color-mix(in srgb, var(--ss-accent) 65%, transparent);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.5rem;
}

[data-theme="light"] .product-detail__tag {
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  border-color: var(--color-border);
}

.product-detail__prices {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.product-detail__section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-bottom: 0.25rem;
}

.product-detail__section-title {
  margin: 0;
  font-size: clamp(1.15rem, 2.5vw, 1.5rem);
  font-weight: 700;
  color: #f8fafc;
}

[data-theme="light"] .product-detail__section-title {
  color: var(--color-text);
}

.product-detail__section-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
}

.product-detail__section-title-row .product-detail__section-title {
  margin: 0;
}

.product-detail__section-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 9999px;
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  cursor: help;
  flex-shrink: 0;
  font-size: 0.95rem;
  line-height: 1;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

.product-detail__section-help:hover,
.product-detail__section-help:focus-visible {
  background: rgba(0, 210, 255, 0.18);
  color: var(--ss-teal);
}

[data-theme="light"] .product-detail__section-help {
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

[data-theme="light"] .product-detail__section-help:hover,
[data-theme="light"] .product-detail__section-help:focus-visible {
  background: var(--color-primary-subtle);
  color: var(--color-primary);
  border-color: rgba(13, 122, 115, 0.35);
}

.product-detail__section-help-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  width: max-content;
  max-width: min(320px, calc(100vw - 2rem));
  padding: 0.65rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
  color: #e2e8f0;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.65rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease,
    visibility 0.15s;
  z-index: 40;
}

.product-detail__section-help:hover .product-detail__section-help-tip,
.product-detail__section-help:focus-visible .product-detail__section-help-tip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

[data-theme="light"] .product-detail__section-help-tip {
  color: var(--color-text);
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: var(--shadow-lg);
}

.product-detail__pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 600;
  border-radius: 0.375rem;
}

.product-detail__pill--muted {
  color: #94a3b8;
  background: color-mix(in srgb, var(--ss-card) 90%, transparent);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .product-detail__pill--muted {
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  border-color: var(--color-border);
}

.product-detail__format-collapsed {
  margin: 0;
  font-size: var(--text-sm);
  color: #94a3b8;
}

.product-detail__format-warning {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--ss-orange);
  padding: 0.65rem 0.85rem;
  border-radius: 0.65rem;
  background: rgba(249, 115, 22, 0.12);
  border: 1px solid rgba(249, 115, 22, 0.25);
}

/* Intestazione colonne (solo desktop) */
.product-detail__offer-grid-head {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1.25rem 0.6rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

@media (min-width: 768px) {
  .product-detail__offer-grid-head {
    display: grid;
    grid-template-columns:
      minmax(0, 1.6fr) minmax(0, 0.85fr) minmax(0, 0.65fr) minmax(0, 0.85fr) minmax(0, auto);
  }

  .product-detail__offer-grid-head--with-format {
    grid-template-columns:
      minmax(0, 1.45fr) minmax(0, 0.65fr) minmax(0, 0.85fr) minmax(0, 0.6fr) minmax(0, 0.85fr) minmax(0, auto);
  }
}

.product-detail__offer-grid-head-price {
  text-align: right;
}

.product-detail__offer-grid-head-center {
  text-align: center;
}

.product-detail__offer-grid-head-action {
  text-align: right;
}

.product-detail__offer-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.product-detail__offer-empty {
  margin: 0;
  padding: 1.25rem;
  border-radius: 1rem;
  background: color-mix(in srgb, var(--ss-card) 80%, transparent);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: var(--text-sm);
}

/* Card offerta esatta */
.product-detail__offer-card {
  display: grid;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  background: color-mix(in srgb, var(--ss-card) 88%, transparent);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

[data-theme="light"] .product-detail__offer-card {
  border-color: var(--color-border);
}

.product-detail__offer-card:hover {
  border-color: rgba(0, 210, 255, 0.22);
}

.product-detail__offer-card:focus-visible {
  outline: 2px solid var(--ss-teal);
  outline-offset: 2px;
}

.product-detail__offer-card--best {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.12);
}

.product-detail__offer-card--best:hover {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.55);
}

.product-detail__offer-card--highlighted {
  outline: 2px solid var(--ss-teal);
  outline-offset: 0;
  box-shadow: 0 0 0 3px rgba(0, 210, 255, 0.15);
}

.product-detail__offer-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.product-detail__offer-store {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.product-detail__offer-logo-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 2px;
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.product-detail__offer-logo-wrap .supermarket-logo__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0.35rem;
}

.product-detail__offer-store-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.product-detail__store-name {
  font-weight: 700;
  color: #f8fafc;
  font-size: 0.95rem;
}

[data-theme="light"] .product-detail__store-name {
  color: var(--color-text);
}

.product-detail__best-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.12rem 0.45rem;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--ss-success);
  background: rgba(16, 185, 129, 0.18);
  border-radius: 9999px;
}

.product-detail__offer-price {
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  color: #f8fafc;
  font-size: 1.35rem;
  line-height: 1;
}

.product-detail__offer-price--best {
  color: var(--ss-success);
}

[data-theme="light"] .product-detail__offer-price {
  color: var(--color-text);
}

[data-theme="light"] .product-detail__offer-price--best {
  color: var(--color-success);
}

.product-detail__offer-price--mobile {
  flex-shrink: 0;
}

.product-detail__offer-price--desktop {
  display: none;
}

@media (min-width: 768px) {
  .product-detail__offer-price--mobile {
    display: none;
  }

  .product-detail__offer-price--desktop {
    display: block;
    text-align: right;
    font-size: 1.5rem;
  }

  /* Supermercato | Prezzo | Offerta | Aggiornato | Azione */
  .product-detail__offer-card:not(.product-detail__offer-card--with-format) {
    grid-template-columns:
      minmax(0, 1.6fr) minmax(0, 0.85fr) minmax(0, 0.65fr) minmax(0, 0.85fr) minmax(0, auto);
    align-items: center;
    padding: 1rem 1.25rem;
    gap: 0.75rem;
  }

  .product-detail__offer-card:not(.product-detail__offer-card--with-format) .product-detail__offer-card-top {
    grid-column: 1;
  }

  .product-detail__offer-card:not(.product-detail__offer-card--with-format) .product-detail__offer-price--desktop {
    grid-column: 2;
  }

  .product-detail__offer-card:not(.product-detail__offer-card--with-format) .product-detail__offer-offer {
    grid-column: 3;
  }

  .product-detail__offer-card:not(.product-detail__offer-card--with-format) .product-detail__offer-date {
    grid-column: 4;
  }

  .product-detail__offer-card:not(.product-detail__offer-card--with-format) .product-detail__offer-action {
    grid-column: 5;
    justify-self: end;
  }

  /* + Formato */
  .product-detail__offer-card--with-format {
    grid-template-columns:
      minmax(0, 1.45fr) minmax(0, 0.65fr) minmax(0, 0.85fr) minmax(0, 0.6fr) minmax(0, 0.85fr) minmax(0, auto);
    align-items: center;
    padding: 1rem 1.25rem;
    gap: 0.75rem;
  }

  .product-detail__offer-card--with-format .product-detail__offer-card-top {
    grid-column: 1;
  }

  .product-detail__offer-card--with-format .product-detail__offer-format {
    grid-column: 2;
  }

  .product-detail__offer-card--with-format .product-detail__offer-price--desktop {
    grid-column: 3;
  }

  .product-detail__offer-card--with-format .product-detail__offer-offer {
    grid-column: 4;
  }

  .product-detail__offer-card--with-format .product-detail__offer-date {
    grid-column: 5;
  }

  .product-detail__offer-card--with-format .product-detail__offer-action {
    grid-column: 6;
    justify-self: end;
  }
}

.product-detail__offer-field {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.82rem;
}

@media (min-width: 768px) {
  .product-detail__offer-field {
    text-align: center;
  }

  .product-detail__offer-action .product-detail__offer-field {
    text-align: inherit;
  }
}

.product-detail__offer-field-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.product-detail__offer-field-value {
  color: #cbd5e1;
}

.product-detail__offer-date-value {
  font-size: 0.8rem;
  color: #94a3b8;
}

[data-theme="light"] .product-detail__offer-field-value {
  color: var(--color-text-muted);
}

[data-theme="light"] .product-detail__offer-date-value {
  color: var(--color-text-muted);
}

[data-theme="light"] .product-detail__offer-grid-head {
  border-bottom-color: var(--color-border);
}

.product-detail__offer-pill {
  display: inline-flex;
  width: fit-content;
  padding: 0.15rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 0.35rem;
}

.product-detail__offer-pill--yes {
  color: var(--ss-success);
  background: rgba(16, 185, 129, 0.2);
}

.product-detail__offer-pill--no {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.12);
}

.product-detail__offer-pill--muted-yes {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .product-detail__offer-pill--muted-yes {
  color: var(--color-text-muted);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
}

[data-theme="light"] .product-detail__offer-pill--no {
  color: var(--color-text-muted);
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
}

.product-detail__offer-action {
  display: flex;
  justify-content: stretch;
}

@media (min-width: 768px) {
  .product-detail__offer-action {
    justify-content: flex-end;
  }
}

/* Pulsanti carrello scheda prodotto */
.product-detail-table__col-action {
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.product-detail-table__cart-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  gap: 0.35rem;
  width: 100%;
  min-width: 6.5rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease;
}

.product-detail-table__cart-btn--primary {
  background: var(--ss-teal);
  color: var(--ss-dark);
  box-shadow: 0 0 18px rgba(0, 210, 255, 0.22);
}

.product-detail-table__cart-btn--primary:hover {
  filter: brightness(1.06);
}

.product-detail-table__cart-btn--outline {
  background: color-mix(in srgb, var(--ss-accent) 70%, transparent);
  color: var(--ss-teal);
  border: 1px solid rgba(0, 210, 255, 0.25);
}

.product-detail-table__cart-btn--outline:hover {
  background: var(--ss-teal);
  color: var(--ss-dark);
  border-color: transparent;
}

.product-detail-table__cart-btn--icon {
  min-width: 2.75rem;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  background: color-mix(in srgb, var(--ss-accent) 70%, transparent);
  color: var(--ss-teal);
  border: 1px solid rgba(0, 210, 255, 0.25);
  font-size: 1rem;
}

.product-detail-table__cart-btn--icon:hover {
  background: var(--ss-teal);
  color: var(--ss-dark);
}

[data-theme="light"] .product-detail-table__cart-btn--primary {
  color: #fff;
}

.product-detail-table__cart-btn:focus-visible {
  outline: 2px solid var(--ss-teal);
  outline-offset: 2px;
}

/* Sezione formato diverso */
.price-alt-formats {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.price-alt-formats__title {
  margin: 0;
}

.price-alt-formats__list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.price-alt-formats__card {
  display: grid;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  background: color-mix(in srgb, var(--ss-card) 92%, transparent);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: border-color 0.15s ease;
}

.price-alt-formats__card:hover {
  border-color: rgba(0, 210, 255, 0.2);
}

.price-alt-formats__card:focus-visible {
  outline: 2px solid var(--ss-teal);
  outline-offset: 2px;
}

.price-alt-formats__card--highlighted {
  outline: 2px solid var(--ss-teal);
  outline-offset: 0;
  box-shadow: 0 0 0 3px rgba(0, 210, 255, 0.12);
}

.price-alt-formats__card--best {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.12);
}

.price-alt-formats__card--best:hover {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.55);
}

.price-alt-formats__store-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.price-alt-formats__price--best {
  color: var(--ss-success);
}

[data-theme='light'] .price-alt-formats__price--best {
  color: var(--color-success);
}

.price-alt-formats__card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.price-alt-formats__store {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.price-alt-formats__store-name {
  font-weight: 600;
  color: #f1f5f9;
}

[data-theme="light"] .price-alt-formats__store-name {
  color: var(--color-text);
}

.price-alt-formats__price {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: #f8fafc;
  font-size: 1.2rem;
}

[data-theme="light"] .price-alt-formats__price {
  color: var(--color-text);
}

[data-theme="light"] .price-alt-formats__card {
  border-color: var(--color-border);
}

.price-alt-formats__price--desktop {
  display: none;
}

.price-alt-formats__price--mobile {
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .price-alt-formats__price--mobile {
    display: none;
  }

  .price-alt-formats__price--desktop {
    display: block;
    text-align: right;
    font-size: 1.25rem;
  }

  .price-alt-formats__card {
    grid-template-columns:
      minmax(0, 1.6fr) minmax(0, 0.85fr) minmax(0, 0.65fr) minmax(0, 0.85fr) minmax(0, auto);
    align-items: center;
    padding: 0.9rem 1.2rem;
  }

  .price-alt-formats__card-top {
    grid-column: 1;
  }

  .price-alt-formats__price--desktop {
    grid-column: 2;
  }

  .price-alt-formats__offer {
    grid-column: 3;
  }

  .price-alt-formats__date {
    grid-column: 4;
  }

  .price-alt-formats__card .product-detail__offer-action {
    grid-column: 5;
    justify-self: end;
  }
}

/* Pannello carrello in fondo */
.product-detail__cart-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: 1.75rem;
  padding: var(--space-5);
  border-radius: 1rem;
  background: color-mix(in srgb, var(--ss-card) 90%, transparent);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

@media (max-width: 767px) {
  .product-detail__cart-panel {
    position: sticky;
    inset-block-end: 0;
    z-index: 50;
    margin-inline: -1rem;
    padding-inline: 1rem;
    padding-block: var(--space-4);
    border-radius: 0;
    border-inline: none;
    border-block-end: none;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.35);
  }
}

.product-detail__stepper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.product-detail__stepper-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: #94a3b8;
}

.product-detail__step-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-inline-size: 2.75rem;
  min-block-size: 2.75rem;
  padding: var(--space-2);
  font-size: var(--text-lg);
  line-height: 1;
  color: #e2e8f0;
  background: color-mix(in srgb, var(--ss-accent) 80%, transparent);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition:
    background-color var(--transition-interactive),
    border-color var(--transition-interactive);
}

.product-detail__step-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.product-detail__step-btn:focus-visible {
  outline: 2px solid var(--ss-teal);
  outline-offset: var(--space-1);
}

.product-detail__qty-input {
  inline-size: 4rem;
  min-block-size: 2.75rem;
  padding-block: var(--space-2);
  padding-inline: var(--space-2);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: #f8fafc;
  background: color-mix(in srgb, var(--ss-accent) 80%, transparent);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
}

.product-detail__qty-input:focus-visible {
  outline: 2px solid var(--ss-teal);
  outline-offset: var(--space-1);
}

.product-detail__cta {
  inline-size: 100%;
  min-block-size: 3rem;
  padding-block: var(--space-3);
  padding-inline: var(--space-4);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--ss-dark);
  background: var(--ss-teal);
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: filter 0.15s ease;
  box-shadow: 0 0 18px rgba(0, 210, 255, 0.2);
}

[data-theme="light"] .product-detail__cta {
  color: #fff;
}

.product-detail__cta:hover {
  filter: brightness(1.05);
}

.product-detail__cta:focus-visible {
  outline: 2px solid var(--ss-teal);
  outline-offset: var(--space-2);
}
