/* Sea Chips — Cart v2 & Checkout v2 components */

/* ——— Free delivery progress ——— */
.free-delivery-bar {
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}

.free-delivery-bar__head {
  font-size: 0.9375rem;
  margin-bottom: 10px;
}

.free-delivery-bar__head strong {
  color: var(--sea-dark);
  font-weight: 700;
}

.free-delivery-bar__track {
  height: 8px;
  background: var(--sea-light);
  border-radius: 999px;
  overflow: hidden;
}

.free-delivery-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sea) 0%, var(--sea-dark) 100%);
  border-radius: 999px;
  transition: width 0.4s var(--ease);
}

.free-delivery-bar--done {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--sea-light);
  border-color: oklch(48% 0.11 165 / 0.25);
}

.free-delivery-bar--done .free-delivery-bar__icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.free-delivery-bar--done .free-delivery-bar__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.free-delivery-bar--done strong {
  font-family: var(--font-display);
  color: var(--sea-dark);
}

.free-delivery-bar--done span {
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ——— Cart v2 item cards ——— */
.cart-v2-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 16px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
  transition: box-shadow 0.25s var(--ease), border-color 0.25s;
}

.cart-v2-item:hover {
  box-shadow: var(--shadow);
  border-color: oklch(48% 0.11 165 / 0.2);
}

.cart-v2-item__photo .product-photo {
  aspect-ratio: 1;
  border-radius: var(--radius);
  min-height: auto;
}

.cart-v2-item__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.cart-v2-item__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.cart-v2-item__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0625rem;
  line-height: 1.3;
}

.cart-v2-item__name a:hover { color: var(--sea); }

.cart-v2-item__meta {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 4px;
}

.cart-v2-item__unit-price {
  font-size: 0.875rem;
  color: var(--muted);
  white-space: nowrap;
}

.cart-v2-item__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.cart-v2-item__line-total {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  font-variant-numeric: tabular-nums;
}

.cart-v2-item__remove {
  font-size: 0.8125rem;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 4px 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.cart-v2-item__remove:hover { color: var(--danger); }

@media (min-width: 600px) {
  .cart-v2-item {
    grid-template-columns: 120px 1fr;
    gap: 20px;
    padding: 24px;
  }
}

/* ——— Promo block ——— */
.promo-block {
  margin-top: 24px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.promo-block__label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 12px;
}

.promo-block__row {
  display: flex;
  gap: 10px;
}

.promo-block__row .form-input {
  flex: 1;
  min-width: 0;
}

.promo-block__row .btn {
  flex-shrink: 0;
  min-width: 110px;
}

.promo-block__row .btn.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

.promo-block__row .btn.is-loading::after {
  content: '';
  width: 16px;
  height: 16px;
  margin-left: 8px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: promoSpin 0.6s linear infinite;
}

@keyframes promoSpin {
  to { transform: rotate(360deg); }
}

.promo-block__status {
  margin-top: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  display: none;
  align-items: center;
  gap: 8px;
}

.promo-block__status.is-visible { display: flex; }
.promo-block__status--success { color: var(--success); }
.promo-block__status--error { color: var(--danger); }
.promo-block__status--applied {
  color: var(--success);
  justify-content: space-between;
}

.promo-block__remove {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: underline;
}

/* ——— Delivery options v2 ——— */
.delivery-options-v2 {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.delivery-option-v2 {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  background: var(--surface);
}

.delivery-option-v2:hover { border-color: oklch(48% 0.11 165 / 0.4); }

.delivery-option-v2:has(input:checked) {
  border-color: var(--sea);
  background: var(--sea-light);
  box-shadow: 0 0 0 3px oklch(48% 0.11 165 / 0.1);
}

.delivery-option-v2 input {
  accent-color: var(--sea);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.delivery-option-v2__info { flex: 1; min-width: 0; }

.delivery-option-v2__info strong {
  display: block;
  font-size: 0.9375rem;
  margin-bottom: 2px;
}

.delivery-option-v2__info span {
  font-size: 0.8125rem;
  color: var(--muted);
}

.delivery-option-v2__price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9375rem;
  white-space: nowrap;
}

.delivery-option-v2__price.is-free { color: var(--success); }

/* ——— Sticky order summary ——— */
.summary-sticky-wrap {
  position: relative;
}

.summary-sticky {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: var(--shadow);
}

.summary-sticky__title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  font-size: 0.9375rem;
  border-bottom: 1px solid oklch(90% 0.012 165 / 0.6);
}

.summary-line:last-child { border-bottom: none; }

.summary-line--muted { color: var(--muted); }

.summary-line--savings em {
  font-style: normal;
  font-size: 0.75rem;
  background: var(--beet-light);
  color: var(--beet);
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
}

.summary-value--green {
  color: var(--success);
  font-weight: 600;
}

.summary-line--total {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 2px solid var(--border);
  border-bottom: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
}

.summary-line--total span:last-child {
  color: var(--sea-dark);
}

.summary-savings-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--sea-light);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--sea-dark);
  font-weight: 600;
}

.summary-savings-badge:empty { display: none; }

@media (min-width: 900px) {
  .summary-sticky {
    position: sticky;
    top: calc(var(--header-h) + 16px);
  }
}

/* ——— Mobile sticky checkout bar ——— */
.mobile-checkout-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 95;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: oklch(100% 0 0 / 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 32px oklch(20% 0.02 200 / 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-checkout-bar__info {
  flex: 1;
  min-width: 0;
}

.mobile-checkout-bar__label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 2px;
}

.mobile-checkout-bar__total {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  font-variant-numeric: tabular-nums;
}

.mobile-checkout-bar .btn {
  flex-shrink: 0;
  min-width: 140px;
  padding-inline: 20px;
}

.page-with-mobile-bar {
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
}

@media (min-width: 900px) {
  .mobile-checkout-bar { display: none; }
  .page-with-mobile-bar { padding-bottom: 48px; }
}

/* ——— Cart v2 layout ——— */
.cart-v2-page { padding: 24px 0 32px; }

.cart-v2-page h1 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  margin-bottom: 20px;
}

.cart-v2-layout {
  display: grid;
  gap: 32px;
}

@media (min-width: 900px) {
  .cart-v2-layout {
    grid-template-columns: 1fr 380px;
    align-items: start;
  }
}

.section-block {
  margin-top: 28px;
}

.section-block__title {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.section-block__hint {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 12px;
}

/* ——— Checkout v2 wizard ——— */
.checkout-v2-page { padding: 24px 0 32px; }

.checkout-v2-page h1 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  margin-bottom: 8px;
}

.checkout-v2-subtitle {
  color: var(--muted);
  margin-bottom: 24px;
}

.checkout-v2-layout {
  display: grid;
  gap: 32px;
}

@media (min-width: 900px) {
  .checkout-v2-layout {
    grid-template-columns: 1fr 380px;
    align-items: start;
  }
}

/* Step indicator */
.checkout-wizard-steps {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.checkout-wizard-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  position: relative;
  transition: all 0.25s var(--ease);
}

.checkout-wizard-step__num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-warm);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  transition: all 0.25s var(--ease);
}

.checkout-wizard-step.active {
  color: var(--sea-dark);
  background: var(--sea-light);
}

.checkout-wizard-step.active .checkout-wizard-step__num {
  background: var(--sea);
  color: white;
}

.checkout-wizard-step.done {
  color: var(--sea-dark);
}

.checkout-wizard-step.done .checkout-wizard-step__num {
  background: var(--sea);
  color: white;
}

@media (min-width: 600px) {
  .checkout-wizard-step { font-size: 0.8125rem; padding: 16px 12px; }
}

/* Wizard panels */
.checkout-panel {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  animation: fadeUp 0.35s var(--ease) both;
}

.checkout-panel.active { display: block; }

.checkout-panel h2 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.checkout-panel__nav {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.checkout-panel__nav .btn-secondary { flex: 0 0 auto; }
.checkout-panel__nav .btn-primary { flex: 1; min-width: 160px; }

/* Payment methods v2 */
.payment-grid {
  display: grid;
  gap: 10px;
}

.payment-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.payment-card:hover { border-color: oklch(48% 0.11 165 / 0.4); }

.payment-card:has(input:checked) {
  border-color: var(--sea);
  background: var(--sea-light);
  box-shadow: 0 0 0 3px oklch(48% 0.11 165 / 0.1);
}

.payment-card input {
  accent-color: var(--sea);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.payment-card__icon {
  width: 40px;
  height: 28px;
  border-radius: 6px;
  background: var(--surface-warm);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid var(--border);
}

.payment-card__icon--card {
  background: linear-gradient(135deg, #1a1f71 0%, #00579f 100%);
  color: white;
  border: none;
  font-size: 0.5rem;
  letter-spacing: -0.02em;
}

.payment-card__icon--sbp {
  background: oklch(55% 0.2 280);
  color: white;
  border: none;
}

.payment-card__icon--apple {
  background: var(--fg);
  color: white;
  border: none;
}

.payment-card__icon--google {
  background: white;
  border: 1px solid var(--border);
}

.payment-card__label {
  flex: 1;
  font-weight: 500;
  font-size: 0.9375rem;
}

.payment-card__badges {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.payment-card__badges span {
  font-size: 0.625rem;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--surface-warm);
  color: var(--muted);
}

/* Card fields */
.card-fields-v2 {
  margin-top: 20px;
  padding: 20px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.card-fields-v2__secure {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.8125rem;
  color: var(--muted);
}

/* Trust row */
.trust-row {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
  color: var(--muted);
}

.trust-item__icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--sea-light);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 1rem;
}

/* Conversion guarantees near pay */
.checkout-guarantees {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.checkout-guarantee {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
  color: var(--muted);
}

.checkout-guarantee svg {
  flex-shrink: 0;
  color: var(--sea);
}

/* Checkout order mini list */
.checkout-mini-items {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.checkout-mini-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  font-size: 0.875rem;
}

.checkout-mini-item__photo {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.checkout-mini-item__photo .product-photo {
  aspect-ratio: 1;
  min-height: auto;
  border-radius: 8px;
}

.checkout-mini-item__info { flex: 1; min-width: 0; }

.checkout-mini-item__name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.checkout-mini-item__qty {
  font-size: 0.75rem;
  color: var(--muted);
}

.checkout-mini-item__price {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Success overlay v2 */
.success-overlay-v2 {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: oklch(100% 0 0 / 0.95);
  display: none;
  place-items: center;
  padding: 24px;
}

.success-overlay-v2.show { display: grid; }

.success-card-v2 {
  text-align: center;
  max-width: 440px;
  animation: fadeUp 0.5s var(--ease) both;
}

.success-card-v2__icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--sea-light);
  color: var(--sea);
  font-size: 2.25rem;
  display: grid;
  place-items: center;
  margin: 0 auto 24px;
}

.success-card-v2 h2 {
  font-family: var(--font-display);
  font-size: 1.625rem;
  margin-bottom: 8px;
}

.success-card-v2 p {
  color: var(--muted);
  margin-bottom: 28px;
}

/* Address fields collapse */
.address-fields {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.address-fields.is-hidden { display: none; }

.pickup-note {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--sea-light);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--sea-dark);
}

.pickup-note.is-hidden { display: none; }

/* ================================================================
   🛒 БЕЙДЖ КОРЗИНЫ (КРАСНЫЙ С БЕЛОЙ ЦИФРОЙ)
   ================================================================ */
.header-actions .icon-btn {
  position: relative;
}

.cart-badge {
  position: absolute;
  top: -8px;
  right: -10px;
  background: #dc2626;
  color: white;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
  transition: transform 0.2s ease;
  line-height: 1;
  pointer-events: none;
}

.cart-badge--hidden {
  transform: scale(0);
}

/* ================================================================
   🛒 КНОПКА-СЧЁТЧИК В КАТАЛОГЕ
   ================================================================ */
.qty-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--sea-light);
  border: 1.5px solid var(--sea);
  border-radius: 40px;
  padding: 4px 6px;
  font-size: 0.9rem;
}

.qty-control .qty-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: var(--sea);
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.qty-control .qty-btn:hover {
  background: var(--sea-dark);
  transform: scale(1.05);
}

.qty-control .qty-btn:active {
  transform: scale(0.9);
}

.qty-control .qty-value {
  min-width: 24px;
  text-align: center;
  font-weight: 600;
  color: var(--sea-dark);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--sea);
  color: var(--sea);
}

.btn-outline:hover {
  background: var(--sea);
  color: white;
}