/* =========================================================
   PrintBull — Shop pages (cart, checkout, orders)
   home.css ustiga qo'shimcha
   ========================================================= */

/* ─── Umumiy sahifa wrapper ────────────────────────────── */
.shop-page {
  padding: 64px 0 96px;
  min-height: calc(100vh - var(--nav-h) - 200px);
}
.page-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
}

/* ─── Cart layout (chap items + o'ng summary) ─────────── */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  align-items: start;
}
@media (max-width: 900px) {
  .cart-layout { grid-template-columns: 1fr; }
}

/* ─── Cart items ───────────────────────────────────────── */
.cart-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cart-row {
  display: grid;
  grid-template-columns: 100px 1fr auto auto auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--gray-2);
  border-radius: var(--radius-lg);
}
.cart-row__img {
  width: 100px; aspect-ratio: 1;
  background: var(--gray-3);
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
}
.cart-row__img img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.cart-row__info {
  min-width: 0;
}
.cart-row__name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--ink);
}
.cart-row__meta {
  display: block;
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 4px;
}
.cart-row__price {
  font-size: 14px;
  color: var(--gray);
}
.cart-row__qty {
  display: inline-flex;
  align-items: center;
  background: var(--gray-3);
  border-radius: 999px;
  padding: 4px;
}
.qty-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 600;
  color: var(--ink);
  transition: background .15s ease;
}
.qty-btn:hover { background: var(--white); }
.qty-input {
  width: 40px;
  text-align: center;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  -moz-appearance: textfield;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-input:focus { outline: none; }

.cart-row__total {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  min-width: 110px;
  text-align: right;
}
.cart-row__remove {
  width: 36px; height: 36px;
  border-radius: 50%;
  color: var(--gray);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s ease, color .15s ease;
}
.cart-row__remove:hover {
  background: var(--pb-red-soft);
  color: var(--pb-red);
}
.cart-row__remove svg { width: 18px; height: 18px; }

@media (max-width: 600px) {
  .cart-row {
    grid-template-columns: 80px 1fr auto;
    grid-template-rows: auto auto;
  }
  .cart-row__img { width: 80px; }
  .cart-row__info { grid-column: 2 / span 2; }
  .cart-row__qty { grid-column: 1 / span 2; grid-row: 2; justify-self: start; }
  .cart-row__total { grid-column: 3; grid-row: 2; }
  .cart-row__remove { position: absolute; top: 12px; right: 12px; }
  .cart-row { position: relative; }
}

/* ─── Cart summary (right side card) ───────────────────── */
.cart-summary, .checkout-summary {
  background: var(--white);
  border: 1px solid var(--gray-2);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: sticky; top: calc(var(--nav-h) + 16px);
}
.cart-summary h3, .checkout-summary h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
  color: var(--ink-2);
}
.summary-row--total {
  border-top: 1px solid var(--gray-2);
  margin-top: 12px;
  padding-top: 16px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}
.summary-total { color: var(--pb-red); font-size: 22px; }
.summary-divider {
  height: 1px;
  background: var(--gray-2);
  margin: 16px 0;
}
.cart-summary .btn {
  margin-top: 16px;
}
.btn--block { width: 100%; display: flex; }

/* ─── Checkout layout ──────────────────────────────────── */
.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 32px;
  align-items: start;
}
@media (max-width: 900px) {
  .checkout-layout { grid-template-columns: 1fr; }
}
.checkout-form {
  background: var(--white);
  border: 1px solid var(--gray-2);
  border-radius: var(--radius-lg);
  padding: 32px;
}
.form-section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
}
.checkout-form .field { margin-bottom: 18px; }
.checkout-form .field label {
  display: block;
  font-size: 13px; font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.checkout-form .field input,
.checkout-form .field textarea {
  width: 100%;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--gray-2);
  border-radius: var(--radius-md);
  transition: border-color .15s ease, box-shadow .15s ease;
  resize: vertical;
}
.checkout-form .field input:focus,
.checkout-form .field textarea:focus {
  outline: none;
  border-color: var(--pb-red);
  box-shadow: 0 0 0 3px var(--pb-red-soft);
}
.payment-info {
  background: var(--gray-3);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
  margin: 8px 0 16px;
}
.payment-info strong { color: var(--ink); }

/* ─── Checkout summary items ───────────────────────────── */
.checkout-items {
  display: flex; flex-direction: column;
  gap: 16px;
  max-height: 360px;
  overflow-y: auto;
  margin-bottom: 8px;
}
.checkout-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: center;
}
.checkout-item img {
  width: 56px; height: 56px;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--gray-3);
}
.checkout-item__info { min-width: 0; }
.checkout-item__info h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}
.checkout-item__meta {
  font-size: 12px;
  color: var(--gray);
}
.checkout-item__price {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

/* ─── Order success banner ─────────────────────────────── */
.success-banner {
  text-align: center;
  padding: 48px 24px;
  background: var(--white);
  border: 1px solid var(--gray-2);
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
}
.success-icon {
  width: 80px; height: 80px;
  background: var(--success-soft);
  color: var(--success);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.success-icon svg { width: 40px; height: 40px; }
.success-banner h1 {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  margin-bottom: 8px;
}
.success-banner p { color: var(--ink-2); margin-bottom: 4px; }
.success-sub { color: var(--gray); font-size: 14px; }
.success-actions {
  display: flex; gap: 12px; justify-content: center;
  margin-top: 32px;
  flex-wrap: wrap;
}
.success-actions .btn { width: auto; }

/* ─── Order detail (success page va orders list) ───────── */
.order-detail {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;
  align-items: start;
}
@media (max-width: 900px) {
  .order-detail { grid-template-columns: 1fr; }
}
.order-detail__main, .order-detail__side {
  background: var(--white);
  border: 1px solid var(--gray-2);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.order-detail__main h3, .order-detail__side h3 {
  font-size: 18px; font-weight: 700; margin-bottom: 20px;
}
.info-block {
  display: flex; flex-direction: column;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-3);
}
.info-block:last-child { border-bottom: none; }
.info-label { font-size: 12px; color: var(--gray); text-transform: uppercase; letter-spacing: 0.06em; }
.info-value { font-size: 14px; color: var(--ink); font-weight: 500; }

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: 12px; font-weight: 600;
  border-radius: 999px;
  text-transform: capitalize;
}
.status-badge--pending   { background: var(--warning-soft); color: var(--warning); }
.status-badge--paid      { background: var(--info-soft);    color: var(--info); }
.status-badge--shipped   { background: var(--info-soft);    color: var(--info); }
.status-badge--delivered { background: var(--success-soft); color: var(--success); }
.status-badge--cancelled { background: var(--error-soft);   color: var(--error); }

/* ─── Orders list page ─────────────────────────────────── */
.orders-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}
.order-card {
  display: block;
  background: var(--white);
  border: 1px solid var(--gray-2);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.order-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.order-card__head {
  display: flex; justify-content: space-between; align-items: start;
  margin-bottom: 16px;
}
.order-card__number {
  display: block;
  font-size: 16px; font-weight: 700;
  color: var(--ink);
}
.order-card__date {
  font-size: 12px;
  color: var(--gray);
}
.order-card__body {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.order-card__thumbs {
  display: flex; gap: 6px;
}
.order-card__thumbs img {
  width: 44px; height: 44px;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--gray-3);
  border: 1px solid var(--gray-2);
}
.order-card__meta {
  text-align: right;
}
.order-card__meta span {
  display: block;
  font-size: 12px; color: var(--gray);
}
.order-card__meta strong {
  font-size: 16px; font-weight: 700;
  color: var(--pb-red);
}

/* ─── Empty state ──────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-2);
  max-width: 540px;
  margin: 0 auto;
}
.empty-state svg {
  width: 72px; height: 72px;
  color: var(--gray-2);
  margin-bottom: 24px;
}
.empty-state h2 {
  font-size: 22px; font-weight: 700;
  margin-bottom: 8px;
}
.empty-state p {
  font-size: 15px;
  color: var(--gray);
  margin-bottom: 24px;
}
.empty-state .btn { width: auto; display: inline-flex; }

/* ─── Alert (forma xato) ───────────────────────────────── */
.alert {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
  line-height: 1.4;
}
.alert.is-shown { display: block; }
.alert--err { background: var(--pb-red-soft); color: var(--pb-red-dark); }

.btn-spin {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: var(--surface);
  border-radius: 50%;
  animation: spin .65s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Cart icon badge (navbar) ─────────────────────────── */
.nav__cart { position: relative; }
.nav__cart-badge {
  position: absolute;
  top: 0; right: 0;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  background: var(--pb-red);
  color: var(--white);
  border-radius: 999px;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--white);
  pointer-events: none;
}

/* ═════════════════════════════════════════════════════════
   ADD-TO-CART MODAL — products sahifa uchun
   ═════════════════════════════════════════════════════════ */
.add-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  display: none;
  align-items: center; justify-content: center;
  z-index: 200;
  padding: 16px;
  animation: fadeIn .2s ease;
}
.add-modal.is-open { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.add-modal__card {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 460px;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  animation: slideUp .25s cubic-bezier(.2,.8,.2,1);
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.add-modal__head {
  display: flex; gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--gray-2);
}
.add-modal__img {
  width: 80px; height: 80px;
  object-fit: cover;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  background: var(--gray-3);
}
.add-modal__info { flex: 1; min-width: 0; }
.add-modal__name {
  font-size: 16px; font-weight: 700;
  margin-bottom: 4px;
  color: var(--ink);
}
.add-modal__price {
  font-size: 18px; font-weight: 700;
  color: var(--pb-red);
}
.add-modal__close {
  position: absolute; top: 12px; right: 12px;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--gray-3);
  color: var(--ink);
}
.add-modal__close:hover { background: var(--gray-2); }
.add-modal__close svg { width: 18px; height: 18px; }

.size-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}
.size-chip {
  padding: 12px;
  background: var(--white);
  border: 1.5px solid var(--gray-2);
  border-radius: var(--radius-md);
  font-size: 14px; font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all .15s ease;
  text-align: center;
}
.size-chip:hover { border-color: var(--ink); }
.size-chip.is-active {
  background: var(--ink); color: var(--white); border-color: var(--ink);
}

.modal-section-label {
  display: block;
  font-size: 13px; font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 10px;
}

.qty-control {
  display: inline-flex;
  align-items: center;
  background: var(--gray-3);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 24px;
}
.qty-control .qty-input { font-size: 16px; }

.add-modal__actions {
  position: relative;
}
.add-modal .alert { margin-bottom: 12px; }
