/* ===========================
   SHOP PAGE
=========================== */

/* ---- Hero ---- */
.shop-hero {
  padding: 128px 0 64px;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.shop-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  color: var(--text-heading);
  line-height: 1.15;
  margin: 10px 0 16px;
}
.shop-hero h1 span { color: var(--accent); }
.shop-hero-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.65;
}

/* ---- Filter bar ---- */
.shop-filter-bar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 64px;
  z-index: 90;
}
.shop-filter-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
  flex-wrap: wrap;
}
.filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.filter-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.83rem;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.shop-sort select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.83rem;
  padding: 7px 32px 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a97bc' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
  outline: none;
  transition: border-color var(--transition);
}
.shop-sort select:focus { border-color: var(--accent); }

/* ---- Main grid ---- */
.shop-main { padding: 40px 0 80px; }
.shop-count {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.shop-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.shop-empty {
  text-align: center;
  padding: 64px 0;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* ---- Product card ---- */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  cursor: default;
}
.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

/* Thumbnail */
.product-thumb {
  position: relative;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.product-thumb-bg {
  position: absolute;
  inset: 0;
}
.product-thumb-icon {
  position: relative;
  z-index: 1;
  width: 72px;
  height: 72px;
  background: rgba(255,255,255,0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.product-thumb-icon svg {
  width: 36px;
  height: 36px;
  stroke: rgba(255,255,255,0.9);
}
.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(6px);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.2);
}

/* Card info */
.product-info {
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.product-name {
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.3;
}
.product-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}
.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}
.product-price {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent);
}
.product-price-note {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
}
.btn-add-cart {
  background: var(--accent);
  color: #fff;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: background var(--transition), transform 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-add-cart:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-add-cart.added {
  background: #22c55e;
}

/* ---- Trust bar ---- */
.trust-bar {
  background: var(--bg-dark);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 40px 0;
}
.trust-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
.trust-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.trust-item svg {
  stroke: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}
.trust-item div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.trust-item strong {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-heading);
}
.trust-item span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ---- Cart overlay ---- */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.cart-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

/* ---- Cart drawer ---- */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 380px;
  max-width: 100vw;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  z-index: 210;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.cart-drawer.open {
  transform: translateX(0);
}
.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cart-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-heading);
}
.cart-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
  display: flex;
}
.cart-close:hover { color: var(--text-heading); background: var(--accent-dim); }

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
}
.cart-empty-msg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}
.cart-empty-msg svg { stroke: var(--text-muted); opacity: 0.4; }
.cart-empty-msg p { font-size: 1rem; font-weight: 600; color: var(--text); }
.cart-empty-msg span { font-size: 0.85rem; }

.cart-items { list-style: none; padding: 0 16px; display: flex; flex-direction: column; gap: 12px; }

/* Cart item */
.cart-item {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 12px;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}
.cart-item-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cart-item-thumb svg { width: 24px; height: 24px; stroke: rgba(255,255,255,0.85); }
.cart-item-info { min-width: 0; }
.cart-item-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item-price {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  margin-top: 2px;
}
.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 8px;
}
.qty-btn {
  width: 28px;
  height: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition), color var(--transition);
  font-family: 'Inter', sans-serif;
}
.qty-btn:hover { border-color: var(--accent); color: var(--accent); }
.qty-btn.remove { font-size: 0.95rem; }
.qty-value {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-heading);
  min-width: 16px;
  text-align: center;
}

.cart-footer {
  padding: 16px 24px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cart-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  color: var(--text);
}
.cart-subtotal strong {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-heading);
}
.cart-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.btn-checkout {
  width: 100%;
  text-align: center;
  padding: 13px;
}

/* ---- Cart FAB ---- */
.cart-fab {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 150;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transition: background var(--transition), transform 0.2s ease, box-shadow 0.2s ease;
}
.cart-fab:hover { background: var(--accent-hover); transform: scale(1.08); box-shadow: 0 6px 28px rgba(0,0,0,0.4); }
.cart-fab-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid var(--bg-card);
}

/* ---- Checkout modal ---- */
.checkout-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 300;
  backdrop-filter: blur(4px);
}
.checkout-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 310;
  width: 600px;
  max-width: calc(100vw - 32px);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
}
.checkout-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: color var(--transition), background var(--transition);
  display: flex;
}
.checkout-close:hover { color: var(--text-heading); background: var(--accent-dim); }
.checkout-inner h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: 8px;
}
.checkout-sub {
  font-size: 0.87rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

/* Order summary in checkout */
.checkout-order-summary {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.co-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text);
}
.co-summary-row span { color: var(--text-muted); }
.co-summary-row strong { color: var(--text-heading); font-weight: 600; }
.co-summary-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

/* Checkout form fields */
.checkout-form-view .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.checkout-form-view .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.checkout-form-view label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.checkout-form-view input,
.checkout-form-view textarea,
.checkout-form-view select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  padding: 10px 14px;
  border-radius: 8px;
  outline: none;
  transition: border-color var(--transition);
  resize: vertical;
}
.checkout-form-view input:focus,
.checkout-form-view textarea:focus,
.checkout-form-view select:focus {
  border-color: var(--accent);
}
.checkout-form-view input::placeholder,
.checkout-form-view textarea::placeholder { color: var(--text-muted); opacity: 0.6; }
.checkout-form-view input.invalid,
.checkout-form-view textarea.invalid {
  border-color: #ef4444;
}

.checkout-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 8px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  font-size: 1rem;
  color: var(--text);
}
.checkout-total-row strong {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent);
}
.btn-submit {
  width: 100%;
  text-align: center;
  padding: 13px;
  margin-top: 8px;
  font-size: 0.97rem;
}
.form-error {
  margin-top: 8px;
  font-size: 0.83rem;
  color: #ef4444;
  text-align: center;
}

/* Success view */
#checkout-success-view {
  text-align: center;
  padding: 16px 0 8px;
}
.success-icon {
  width: 72px;
  height: 72px;
  background: rgba(34,197,94,0.15);
  border: 2px solid #22c55e;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}
.success-icon svg { stroke: #22c55e; }
#checkout-success-view h2 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}
.success-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 28px;
}
.success-actions a,
.success-actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
}
.success-actions .btn-secondary {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  transition: border-color var(--transition), background var(--transition);
}
.success-actions .btn-secondary:hover { border-color: var(--accent); background: var(--accent-dim); }

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .shop-grid { grid-template-columns: repeat(3, 1fr); }
  .trust-inner { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .shop-filter-bar { top: 56px; }
  .shop-filter-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .cart-fab { bottom: 20px; right: 20px; width: 50px; height: 50px; }
  .checkout-form-view .form-row { grid-template-columns: 1fr; }
  .checkout-modal { padding: 28px 20px; }
}
@media (max-width: 500px) {
  .shop-grid { grid-template-columns: 1fr; }
  .trust-inner { grid-template-columns: 1fr; gap: 20px; }
  .cart-drawer { width: 100vw; }
}

/* ---- Product detail modal ---- */
.pd-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  z-index: 400;
  backdrop-filter: blur(4px);
}
.pd-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 410;
  width: 880px;
  max-width: calc(100vw - 32px);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.pd-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: color var(--transition), background var(--transition);
  display: flex;
  z-index: 1;
}
.pd-close:hover { color: var(--text-heading); background: rgba(255,255,255,0.1); }
.pd-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 400px;
}
.pd-gallery {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pd-main-img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pd-main-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}
.pd-main-img .pd-placeholder {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.35;
}
.pd-thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pd-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color var(--transition);
  flex-shrink: 0;
}
.pd-thumb.active { border-color: var(--accent); }
.pd-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-info {
  padding: 32px 32px 32px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-left: 1px solid var(--border);
}
.pd-badge {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 3px 10px;
  border-radius: 999px;
  width: fit-content;
}
.pd-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-heading);
  line-height: 1.25;
  margin: 0;
}
.pd-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
  margin: 0;
}
.pd-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pd-meta-item {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.pd-meta-item strong { color: var(--text); }
.pd-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.pd-price {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--accent);
}
.pd-price-note {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.pd-add-cart {
  width: 100%;
  padding: 13px;
  font-size: 0.97rem;
  text-align: center;
  margin-top: auto;
}
.product-card { cursor: pointer; }
@media (max-width: 700px) {
  .pd-inner { grid-template-columns: 1fr; }
  .pd-info { border-left: none; border-top: 1px solid var(--border); padding: 24px; }
  .pd-gallery { padding: 24px 24px 0; }
}

