/**
 * Premium pack / quantity dropdown on PDP buy-box.
 * Zooflip navy/teal — restrained, structured hint, no promo clutter.
 */

/* Secondary upgrade — sits below ATC, above perks / photo promo. */
.product-detail__pack {
  margin: 0.35rem 0 1rem;
  padding: 1rem 0 0;
  border-top: 1px solid rgba(26, 46, 74, 0.08);
}

.product-detail__pack-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.product-detail__pack-label {
  display: block;
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-navy, #1a2e4a);
}

.product-detail__pack-sub {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted, #64748b);
}

/* Radio Tiles container */
.pack-tiles {
  display: grid;
  gap: 0.6rem;
  margin: 0 0 0.5rem;
}

.pack-tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.95rem;
  border: 1.5px solid rgba(26, 46, 74, 0.14);
  border-radius: 10px;
  background-color: #ffffff;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.15s ease;
  user-select: none;
}

.pack-tile:hover {
  border-color: rgba(26, 46, 74, 0.32);
  background-color: #fafbfc;
}

.pack-tile.is-active {
  border-color: var(--color-teal-dark, #0f766e);
  background-color: #f0fdfa;
  box-shadow: 0 0 0 1px var(--color-teal-dark, #0f766e), 0 3px 10px rgba(15, 118, 110, 0.08);
}

.pack-tile__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.pack-tile__row-top,
.pack-tile__row-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.pack-tile__title {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--color-navy, #1a2e4a);
  line-height: 1.25;
}

.pack-tile__badge {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.2;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.pack-tile__badge--set {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.pack-tile__badge--mix {
  background: #f5f3ff;
  color: #5b21b6;
  border: 1px solid #ddd6fe;
}

.pack-tile__price {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--color-navy, #1a2e4a);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.pack-tile.is-active .pack-tile__price {
  color: var(--color-teal-dark, #0f766e);
}

.pack-tile__unit {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-muted, #64748b);
}

.pack-tile__meta {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted, #64748b);
}

.pack-tile__savings-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  line-height: 1.2;
}

.pack-tile__savings-pill .icon {
  font-size: 0.85rem;
  vertical-align: middle;
}

.pack-tile__thumb {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 1px solid rgba(26, 46, 74, 0.1);
  background: #fafbfc;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pack-tile__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Mikro-stat: zapas wg zakresów wag — spójny z kafelkami, bez alert look */
.pack-feeding-box {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-top: 0.55rem;
  padding: 0.55rem 0.75rem 0.55rem 0.7rem;
  background: #fafbfc;
  border: 1px solid rgba(26, 46, 74, 0.1);
  border-left: 3px solid var(--color-teal, #52bcb4);
  border-radius: 8px;
  line-height: 1.35;
}

.pack-feeding-box[hidden] {
  display: none;
}

.pack-feeding-box--standalone {
  margin: 0.75rem 0;
}

.pack-feeding-box--table {
  align-items: stretch;
}

.pack-feeding-box__icon {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin-top: 0.15rem;
  color: var(--color-teal-ink, #14635c);
}

.pack-feeding-box__icon svg {
  display: block;
}

.pack-feeding-box__label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted, #64748b);
}

.pack-feeding-details {
  flex: 1 1 auto;
  min-width: 0;
}

.pack-feeding-details__summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.45rem;
  cursor: pointer;
  list-style: none;
  font-size: 0.8125rem;
  color: var(--color-navy, #1a2e4a);
  border-radius: 4px;
  outline: none;
  transition: color 0.15s ease;
}

.pack-feeding-details__summary:hover .pack-feeding-details__summary-text {
  color: var(--color-teal-ink, #14635c);
}

.pack-feeding-details__summary:focus-visible {
  box-shadow: 0 0 0 2px rgba(82, 188, 180, 0.35);
}

.pack-feeding-details__summary::-webkit-details-marker {
  display: none;
}

.pack-feeding-details__summary::after {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  margin-left: auto;
  border-right: 1.5px solid var(--color-teal-ink, #14635c);
  border-bottom: 1.5px solid var(--color-teal-ink, #14635c);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
  align-self: center;
  opacity: 0.75;
}

.pack-feeding-details[open] > .pack-feeding-details__summary::after {
  transform: rotate(-135deg);
  margin-top: 0.15rem;
}

.pack-feeding-details__summary-text {
  font-weight: 600;
  color: var(--color-navy, #1a2e4a);
}

.pack-feeding-details__sample {
  flex: 1 1 100%;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--color-text-muted, #64748b);
  letter-spacing: 0.01em;
}

.pack-feeding-details__sample[hidden] {
  display: none;
}

.pack-feeding-details__body {
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(26, 46, 74, 0.08);
}

.pack-feeding-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  color: var(--color-navy, #1a2e4a);
}

.pack-feeding-table thead th {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-text-muted, #64748b);
  text-align: left;
  padding: 0.2rem 0.35rem 0.35rem 0;
  border-bottom: 1px solid rgba(26, 46, 74, 0.1);
  white-space: nowrap;
}

.pack-feeding-table tbody th,
.pack-feeding-table tbody td {
  padding: 0.32rem 0.35rem 0.32rem 0;
  font-weight: 500;
  vertical-align: baseline;
  border-bottom: 1px solid rgba(26, 46, 74, 0.06);
}

.pack-feeding-table tbody tr:last-child th,
.pack-feeding-table tbody tr:last-child td {
  border-bottom: none;
}

.pack-feeding-table tbody th {
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.pack-feeding-table tbody td:nth-child(3) {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.pack-feeding-table tbody td:nth-child(4) {
  font-weight: 600;
  color: var(--color-teal-ink, #14635c);
  white-space: nowrap;
}

.pack-feeding-note {
  margin: 0.4rem 0 0;
  font-size: 0.6875rem;
  line-height: 1.35;
  color: var(--color-text-muted, #64748b);
}

.product-detail__pack-row {
  display: flex;
  align-items: stretch;
  gap: 0.65rem;
}

.product-detail__pack-control {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.product-detail__pack-select {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 0.65rem 2.35rem 0.65rem 0.9rem;
  border: 1px solid rgba(26, 46, 74, 0.14);
  border-radius: 8px;
  background-color: #fafbfc;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%231a2e4a' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.95rem center;
  background-size: 12px 8px;
  color: var(--color-navy);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease;
}

.product-detail__pack-select:hover {
  border-color: rgba(26, 46, 74, 0.28);
  background-color: #fff;
}

.product-detail__pack-select:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--color-teal-dark, #0f6b6b) 55%, rgba(26, 46, 74, 0.35));
  background-color: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-teal-dark, #0f6b6b) 18%, transparent);
}

.product-detail__pack.is-pack-selected .product-detail__pack-select {
  border-color: color-mix(in srgb, var(--color-teal-dark, #0f6b6b) 40%, rgba(26, 46, 74, 0.2));
  background-color: #fff;
}

.product-detail__pack-aside {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0;
  border: 1px solid rgba(26, 46, 74, 0.1);
  border-radius: 8px;
  background: #fafbfc;
  overflow: hidden;
}

.product-detail__pack-aside[hidden] {
  display: none;
}

.product-detail__pack-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-detail__pack-hint {
  display: grid;
  gap: 0.2rem;
  margin: 0.55rem 0 0;
  min-height: 0;
}

.product-detail__pack-hint[hidden] {
  display: none;
}

.product-detail__pack-save {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--color-teal-dark, #0f6b6b);
}

.product-detail__pack-hint.is-save .product-detail__pack-save {
  color: var(--color-teal-dark, #0f6b6b);
}

.product-detail__pack-soft {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--color-text-muted, #5a6472);
}

.product-detail__pack-save[hidden],
.product-detail__pack-soft[hidden] {
  display: none;
}

/* Quantity selector stays visible in pack mode — qty = liczba wybranych zestawów. */

@media (max-width: 640px) {
  .product-detail__pack {
    margin: 0.25rem 0 0.85rem;
    padding-top: 0.85rem;
  }

  .product-detail__pack-select {
    font-size: 0.875rem;
    padding-right: 2.1rem;
  }

  /* Keep mobile buy-box compact — thumb adds little value under the fold. */
  .product-detail__pack-aside {
    display: none !important;
  }

  .product-detail__pack-save {
    font-size: 0.8125rem;
  }

  .product-detail__pack-soft {
    font-size: 0.75rem;
  }

  .pack-feeding-box {
    margin-top: 0.45rem;
    padding: 0.45rem 0.65rem 0.45rem 0.6rem;
    gap: 0.45rem;
  }

  .pack-feeding-box__label {
    font-size: 0.625rem;
  }

  .pack-feeding-details__summary {
    font-size: 0.75rem;
  }

  .pack-feeding-table {
    font-size: 0.6875rem;
  }

  .pack-feeding-table thead th:nth-child(2),
  .pack-feeding-table tbody td:nth-child(2) {
    display: none;
  }

  .pack-feeding-table thead th,
  .pack-feeding-table tbody th,
  .pack-feeding-table tbody td {
    padding: 0.28rem 0.25rem 0.28rem 0;
  }
}
