/* Магазин — прайс и корзина */

.shop-section {
  margin-top: 1rem;
}

.shop-intro {
  color: #d4c8b4;
  max-width: 65ch;
  margin-bottom: 1.5rem;
  line-height: 1.55;
}

.shop-toolbar {
  position: sticky;
  top: var(--header-h);
  z-index: 85;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 0.75rem 0 1rem;
  align-items: center;
  background: rgba(22, 22, 22, 0.97);
  border-bottom: 1px solid rgba(212, 160, 18, 0.25);
  backdrop-filter: blur(8px);
}

.shop-toolbar input,
.shop-toolbar select {
  flex: 1 1 200px;
  padding: 0.75rem 1rem;
  background: var(--charcoal);
  border: 2px solid rgba(212, 160, 18, 0.35);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 1rem;
}

.shop-toolbar input:focus,
.shop-toolbar select:focus {
  outline: none;
  border-color: var(--gold);
}

.shop-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  align-items: start;
}

.price-status {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.price-status--error {
  color: #f5a0a0;
  padding: 1rem;
  border: 1px solid var(--red);
  background: rgba(185, 28, 28, 0.15);
}

.price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.price-grid-empty {
  grid-column: 1 / -1;
  color: var(--text-muted);
  margin: 0;
  padding: 2rem 0;
  text-align: center;
}

.price-section-head {
  grid-column: 1 / -1;
  margin: 0.5rem 0 0;
  padding: 0.75rem 0 0.25rem;
  border-top: 2px solid rgba(212, 160, 18, 0.35);
}

.price-section-head:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.price-section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: none;
  color: var(--gold);
  line-height: 1.35;
}

.price-card {
  background: #2c2c2c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.price-card.is-selected {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(212, 160, 18, 0.35);
}

.price-card__meta {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  min-height: 1.1rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.price-card__country {
  color: var(--text-muted);
}

.price-card__name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.25;
  margin: 0;
  flex: 1;
  text-transform: none;
  letter-spacing: 0.02em;
}

.price-card__warranty {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.price-card__qty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

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

.price-card__price {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--cream);
}

.price-card__btn {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--red);
  background: transparent;
  color: var(--cream);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s;
}

.price-card__btn:hover {
  border-color: var(--gold);
  background: rgba(212, 160, 18, 0.12);
}

.price-card__btn.is-active {
  background: var(--red);
  border-color: var(--red);
}

/* Корзина */
.cart-panel {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  background: var(--charcoal);
  border: 3px solid var(--red);
  padding: 1.25rem;
}

.cart-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.cart-panel h3 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0;
  color: var(--gold);
}

.cart-close {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}

.cart-close:hover {
  color: var(--cream);
}

.cart-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
}

.cart-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0.5rem 0;
}

.cart-item {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cart-item__num {
  font-family: var(--font-display);
  color: var(--red);
  min-width: 1.25rem;
}

.cart-item__body {
  flex: 1;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.cart-item__body strong {
  font-weight: 700;
  line-height: 1.2;
}

.cart-item__body span {
  color: var(--text-muted);
}

.cart-item__remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 0.25rem;
}

.cart-item__remove:hover {
  color: var(--red-bright);
}

.cart-summary {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
  padding-top: 0.5rem;
  border-top: 2px solid rgba(212, 160, 18, 0.3);
}

.cart-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cart-actions .btn {
  width: 100%;
}

.cart-actions .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cart-mobile-bar {
  display: none;
}

@media (max-width: 900px) {
  .shop-layout {
    grid-template-columns: 1fr;
  }

  .shop-intro {
    font-size: 0.9rem;
    margin-bottom: 1rem;
  }

  .shop-toolbar {
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0 0.75rem;
  }

  .shop-toolbar input,
  .shop-toolbar select {
    flex: 1 1 100%;
    padding: 0.6rem 0.75rem;
    font-size: 0.95rem;
  }

  .price-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
  }

  .price-section-head {
    margin: 0.35rem 0 0;
    padding: 0.5rem 0 0.15rem;
  }

  .price-section-title {
    font-size: 0.85rem;
  }

  .price-card {
    padding: 0.65rem 0.7rem 0.75rem;
    gap: 0.35rem;
  }

  .price-card__name {
    font-size: 0.88rem;
    line-height: 1.2;
  }

  .price-card__qty {
    font-size: 0.75rem;
  }

  .price-card__price {
    font-size: 1rem;
  }

  .price-card__footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
  }

  .price-card__btn {
    width: 100%;
    padding: 0.4rem 0.5rem;
    font-size: 0.65rem;
  }

  .cart-close {
    display: block;
  }

  .cart-panel {
    position: fixed;
    inset: auto 0 0;
    top: auto;
    z-index: 90;
    max-height: min(42vh, 320px);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    border-bottom: none;
    overflow: hidden;
    padding: 0.75rem 0.85rem 0.85rem;
    display: flex;
    flex-direction: column;
  }

  .cart-panel.is-open {
    transform: translateY(0);
  }

  .cart-panel.is-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: -1;
  }

  .cart-list {
    max-height: 9rem;
    margin-bottom: 0.65rem;
  }

  .cart-item {
    padding: 0.45rem 0;
  }

  .cart-item__body {
    font-size: 0.78rem;
  }

  .cart-item__body strong {
    font-size: 0.82rem;
  }

  .cart-summary {
    margin-bottom: 0.65rem;
    font-size: 0.9rem;
  }

  .cart-actions .btn {
    padding: 0.55rem 0.75rem;
    font-size: 0.72rem;
  }

  .cart-mobile-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 89;
    background: var(--charcoal);
    border-top: 3px solid var(--gold);
    padding: 0.55rem 0.75rem;
    gap: 0.5rem;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    transition: background 0.25s, border-color 0.25s;
  }

  .cart-mobile-bar.is-highlight {
    border-top-color: var(--red-bright);
    background: #241818;
  }

  .cart-mobile-bar__info {
    color: var(--cream-dim);
    white-space: nowrap;
  }

  .cart-mobile-bar__info strong {
    color: var(--gold);
  }

  .cart-mobile-bar button {
    flex: 0 0 auto;
    min-width: 7.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.72rem;
  }

  main {
    padding-bottom: 3.5rem;
  }
}

@media (max-width: 380px) {
  .price-grid {
    grid-template-columns: 1fr;
  }
}
