/* Общие стили для избранного/корзины/оформления заказа — все публичные страницы */

.ga-header-widgets { display: flex; align-items: center; gap: 8px; margin-right: 8px; }
.ga-icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border, #333); background: transparent; color: var(--muted, #ccc);
  display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 17px;
}
.ga-icon-btn:hover { border-color: var(--red, #d32f2f); color: #fff; }
.ga-badge {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 9px; background: var(--red, #d32f2f); color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}

.ga-panel-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 998; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.ga-panel-overlay.open { opacity: 1; pointer-events: auto; }

.ga-panel {
  position: fixed; top: 0; right: 0; height: 100%; width: min(380px, 92vw); background: #161616; color: #eee;
  border-left: 1px solid #333; z-index: 999; transform: translateX(100%); transition: transform .25s;
  display: flex; flex-direction: column;
}
.ga-panel.open { transform: translateX(0); }
.ga-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid #2a2a2a; }
.ga-panel-head h3 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.ga-panel-close { background: none; border: none; color: #999; font-size: 22px; cursor: pointer; line-height: 1; }
.ga-panel-close:hover { color: #fff; }
.ga-panel-body { flex: 1; overflow-y: auto; padding: 12px 18px; }
.ga-panel-foot { padding: 14px 18px; border-top: 1px solid #2a2a2a; }

.ga-empty { color: #888; font-size: 14px; padding: 24px 0; text-align: center; }

.ga-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #262626; align-items: flex-start; }
.ga-item img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; flex-shrink: 0; background: #222; }
.ga-item-noimg { width: 56px; height: 56px; border-radius: 6px; background: #222; display: flex; align-items: center; justify-content: center; color: #555; flex-shrink: 0; }
.ga-item-info { flex: 1; min-width: 0; }
.ga-item-info a { color: #eee; text-decoration: none; font-size: 14px; display: block; }
.ga-item-info a:hover { color: var(--red, #d32f2f); }
.ga-item-price { color: #999; font-size: 13px; margin-top: 2px; }
.ga-item-remove { background: none; border: none; color: #777; cursor: pointer; font-size: 16px; }
.ga-item-remove:hover { color: var(--red, #d32f2f); }

.ga-qty-stepper { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.ga-qty-stepper button { width: 24px; height: 24px; border-radius: 4px; border: 1px solid #333; background: #1e1e1e; color: #eee; cursor: pointer; }
.ga-qty-stepper span { min-width: 18px; text-align: center; font-size: 13px; }

.ga-cart-total { font-size: 15px; margin-bottom: 10px; }
.ga-checkout-btn {
  width: 100%; padding: 12px; border: none; border-radius: 6px; background: var(--red, #d32f2f); color: #fff;
  font-weight: 700; cursor: pointer; font-size: 14px;
}
.ga-checkout-btn:hover { opacity: 0.9; }

.ga-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.65); z-index: 1000; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.ga-modal-overlay.open { opacity: 1; pointer-events: auto; }
.ga-modal { background: #161616; color: #eee; width: min(460px, 94vw); max-height: 90vh; overflow-y: auto; border-radius: 10px; border: 1px solid #2a2a2a; }
.ga-checkout-form { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px 20px; }
.ga-checkout-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: #aaa; }
.ga-checkout-form input, .ga-checkout-form textarea {
  background: #1e1e1e; border: 1px solid #333; border-radius: 6px; padding: 9px 10px; color: #eee; font-size: 14px; font-family: inherit;
}
.ga-form-group-label { font-size: 12px; color: #888; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: -4px; }
.ga-radio-row { display: flex; gap: 16px; font-size: 13px; color: #ccc; flex-wrap: wrap; }
.ga-radio-row label { display: flex; align-items: center; gap: 6px; flex-direction: row; }
.ga-delivery-calc { display: flex; gap: 8px; margin: 8px 0; }
.ga-delivery-calc input { flex: 1; }
.ga-delivery-calc button, #gaCalcDeliveryBtn { padding: 8px 12px; border-radius: 6px; border: 1px solid #333; background: #1e1e1e; color: #eee; cursor: pointer; font-size: 13px; }
.ga-delivery-result { font-size: 13px; color: #999; }
.ga-checkout-total { font-size: 15px; font-weight: 600; }
.ga-consent {
  display: flex; flex-direction: row !important; align-items: flex-start; gap: 8px;
  font-size: 12px; line-height: 1.5; color: #999;
}
.ga-consent input[type="checkbox"] { flex-shrink: 0; margin-top: 2px; width: 15px; height: 15px; accent-color: var(--red, #d32f2f); }
.ga-consent a { color: var(--red, #d32f2f); text-decoration: underline; }
.ga-checkout-msg { font-size: 13px; min-height: 18px; }
.ga-checkout-msg.error { color: #ff6b6b; }
.ga-checkout-msg.success { color: #6bd47a; }

/* Кнопки избранного/корзины на карточках товара */
.ga-card-actions { display: flex; gap: 6px; }
.ga-fav-btn, .ga-cart-btn {
  width: 32px; height: 32px; border-radius: 6px; border: 1px solid #333; background: #1e1e1e; color: #bbb;
  display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 15px; flex-shrink: 0;
}
.ga-fav-btn:hover, .ga-cart-btn:hover { border-color: var(--red, #d32f2f); color: #fff; }
.ga-fav-btn.active { color: var(--red, #d32f2f); border-color: var(--red, #d32f2f); }

/* ─── Сортировка, фильтры, «Показать ещё» (public/js/listing-tools.js) ─── */
.lt-bar { margin-bottom: 18px; }
.lt-bar[hidden], .lt-more[hidden], .lt-empty[hidden], .lt-panel[hidden], .lt-badge[hidden] { display: none !important; }
.lt-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.lt-sort { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted, #888); }
.lt-sort select, .lt-price input {
  background: var(--bg3, #1a1a1a); border: 1px solid var(--border, #2a2a2a); color: #eee;
  padding: 9px 10px; font-size: 14px; border-radius: 4px; font-family: inherit; min-height: 40px;
}
.lt-sort select:focus, .lt-price input:focus { outline: none; border-color: var(--red, #D0A549); }
.lt-filters-btn {
  display: inline-flex; align-items: center; gap: 6px; background: transparent; color: #ddd;
  border: 1px solid var(--border, #2a2a2a); padding: 9px 14px; font-size: 14px; border-radius: 4px; cursor: pointer; min-height: 40px;
}
.lt-filters-btn:hover { border-color: var(--red, #D0A549); color: #fff; }
.lt-badge {
  background: var(--red, #D0A549); color: #111; border-radius: 10px; font-size: 11px; font-weight: 700;
  min-width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px;
}
.lt-count { font-size: 13px; color: var(--dim, #777); margin-left: auto; }
.lt-panel {
  display: flex; flex-wrap: wrap; gap: 18px 36px; margin-top: 12px; padding: 16px 18px;
  background: var(--bg2, #141414); border: 1px solid var(--border, #2a2a2a); border-radius: 6px;
}
.lt-group { min-width: 160px; }
.lt-group-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted, #888); margin-bottom: 8px; }
.lt-check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #ddd; padding: 5px 0; cursor: pointer; }
.lt-check input { accent-color: var(--red, #D0A549); width: 17px; height: 17px; cursor: pointer; }
.lt-price { display: flex; align-items: center; gap: 8px; }
.lt-price input { width: 100px; }
.lt-price span { color: var(--muted, #888); }
.lt-hint { font-size: 11px; color: var(--dim, #777); margin-top: 6px; max-width: 230px; }
.lt-actions { display: flex; align-items: flex-end; margin-left: auto; }
.lt-reset, .lt-reset-inline {
  background: transparent; border: none; color: var(--red, #D0A549); cursor: pointer; font-size: 14px; padding: 6px 0; text-decoration: underline;
}
.lt-empty { text-align: center; padding: 40px 20px; color: var(--muted, #888); }
.lt-empty i { font-size: 40px; color: #2a2a2a; display: block; margin-bottom: 10px; }
.lt-more { text-align: center; margin: 24px 0 8px; }
.lt-more-btn {
  background: transparent; color: #fff; border: 1px solid var(--red, #D0A549); padding: 12px 28px; font-size: 14px;
  letter-spacing: 0.5px; cursor: pointer; border-radius: 4px; min-height: 44px;
}
.lt-more-btn:hover { background: var(--red, #D0A549); color: #111; }
@media (max-width: 600px) {
  .lt-row { gap: 10px; }
  .lt-sort { flex: 1 1 100%; }
  .lt-sort select { flex: 1; }
  .lt-filters-btn { flex: 1; justify-content: center; }
  .lt-count { margin-left: 0; flex: 1 1 100%; }
  .lt-panel { flex-direction: column; gap: 16px; padding: 14px; }
  .lt-actions { margin-left: 0; }
  .lt-more-btn { width: 100%; }
}

/* ─── Фото товаров на всех экранах: квадрат, картинка целиком (без обрезки), как в мобильной версии ─── */
.part-img { height: auto; aspect-ratio: 1 / 1; }
.part-img img { object-fit: contain; padding: 8px; box-sizing: border-box; }
.product-gallery img { object-fit: contain; }

/* ─── Мобильный каталог: две колонки, компактные карточки, картинка целиком ─── */
@media (max-width: 768px) {
  .parts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .part-card { min-width: 0; }
  .part-img { height: auto; aspect-ratio: 1 / 1; }
  .part-img img { object-fit: contain; padding: 6px; box-sizing: border-box; }
  .part-img .no-photo { font-size: 36px; }
  .part-body { padding: 10px 10px 6px; }
  .part-name {
    font-size: 13px; line-height: 1.3; overflow: hidden;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  }
  .part-car { font-size: 11px; word-break: break-word; }
  .part-footer { padding: 8px 10px; gap: 4px 6px; }
  .part-price { font-size: 17px; }
  .part-card .badge { font-size: 10px; padding: 2px 6px; letter-spacing: 0.3px; }
  .part-card .ga-card-actions { padding: 0 10px 10px !important; }
  .cat-tile { padding: 14px 10px; }
  .cat-tile-name { font-size: 13px; }
  .product-gallery img { object-fit: contain; }
}
