/* Products Page – light brand palette (load customer-brand.css in HTML) */
body.page-customer-app {
  background-color: var(--ci-bg);
}

body.page-products {
  background-color: var(--ci-page-bg, #f9fafb);
}

.sidebar {
  width: 265px;
}

/* Hide scrollbars on products page */
body.page-products,
body.page-products html {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body.page-products::-webkit-scrollbar,
body.page-products html::-webkit-scrollbar {
  display: none;
}

.main-scroll {
  overflow-y: auto;
  height: 100vh;
  padding-bottom: 80px;
  background: var(--ci-page-bg, #f9fafb);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.main-scroll::-webkit-scrollbar {
  display: none;
}

.products-page-header h1 {
  color: var(--ci-brand);
  font-weight: 700;
}

.products-page-header .products-subtitle {
  color: var(--ci-text-muted);
}

.products-cart-hint {
  color: var(--ci-brand);
}

/* Hide scrollbar in product detail modal */
.modal-scrollable {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.modal-scrollable::-webkit-scrollbar {
  display: none;
}

/* Product cards — marketplace grid (mockup layout) */
#productGrid .product-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 0.25rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ci-text-muted);
  background: #f3f4f6;
  border: 1px solid var(--ci-border);
}

#productGrid .product-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

#productGrid .product-card:hover {
  transform: translateY(-2px);
  border-color: #d1d5db;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

#productGrid .product-card:focus-visible {
  outline: 2px solid var(--ci-brand);
  outline-offset: 3px;
}

#productGrid .product-card-img-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #ececec;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1rem 1.75rem;
}

#productGrid .product-card-img-wrap::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 1rem;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.14) 0%, transparent 72%);
  pointer-events: none;
}

#productGrid .product-card-img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  transition: transform 0.25s ease;
}

#productGrid .product-card:hover .product-card-img {
  transform: scale(1.03);
}

#productGrid .product-card-body {
  padding: 0.9rem 1rem 1rem;
  gap: 0.55rem;
}

#productGrid .product-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.15rem;
}

#productGrid .product-card-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7280;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  max-width: 70%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#productGrid .product-card-sku {
  flex-shrink: 0;
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9ca3af;
}

#productGrid .product-card-title {
  margin: 0;
  color: #111827;
  font-size: 0.8125rem;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#productGrid .product-card-rating {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 1rem;
}

#productGrid .product-card-stars {
  display: inline-flex;
  align-items: center;
  gap: 0.05rem;
  line-height: 1;
}

#productGrid .product-card-star {
  color: #d1d5db;
  font-size: 0.75rem;
}

#productGrid .product-card-star--full,
#productGrid .product-card-star--half {
  color: #f59e0b;
}

#productGrid .product-card-rating-value {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #6b7280;
}

#productGrid .product-card-desc {
  margin: 0;
  color: #6b7280;
  font-size: 0.6875rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#productGrid .product-card-sizes {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.1rem;
}

#productGrid .product-card-sizes-label {
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9ca3af;
}

#productGrid .product-card-size-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

#productGrid .product-card-size-btn {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 9999px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

#productGrid .product-card-size-btn:hover {
  border-color: var(--ci-brand);
  color: var(--ci-brand);
}

#productGrid .product-card-size-btn.is-selected {
  border-color: var(--ci-brand);
  background: var(--ci-brand-light);
  color: var(--ci-brand);
}

#productGrid .product-card-footer {
  margin-top: auto;
  padding-top: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

#productGrid .product-card-price {
  color: #111827;
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.1;
}

#productGrid .product-card-cta {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: 6px;
  padding: 0.65rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #fff;
  background: var(--ci-brand);
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

#productGrid .product-card-cta:hover {
  background: var(--ci-brand-hover);
}

#productGrid .product-qty {
  margin-top: 0;
  display: flex;
  align-items: stretch;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--ci-border);
  background: #fff;
}

#productGrid .product-qty-btn {
  flex: 1;
  padding: 0.4rem 0;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  color: var(--ci-brand);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

#productGrid .product-qty-btn:hover {
  background: var(--ci-brand-light);
}

#productGrid .product-qty span {
  display: flex;
  min-width: 2.25rem;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8125rem;
  color: var(--ci-text);
  border-left: 1px solid var(--ci-border);
  border-right: 1px solid var(--ci-border);
  background: var(--ci-surface);
}

#productGrid .product-in-cart-badge {
  position: absolute;
  left: 0.65rem;
  top: 0.65rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 9999px;
  padding: 0.2rem 0.45rem;
  font-size: 0.625rem;
  font-weight: 700;
  background: var(--ci-brand);
  color: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(165, 36, 34, 0.25);
}

.products-empty {
  color: var(--ci-text-muted);
}

/* Modal accents */
#productDetailModal .modal-price {
  color: var(--ci-brand);
}

#productDetailModal .modal-buy-now {
  background: var(--ci-brand);
  color: #fff;
}

#productDetailModal .modal-buy-now:hover {
  background: var(--ci-brand-hover);
}

#productDetailModal .modal-add-to-cart {
  background: var(--ci-brand-dark);
  color: #fff;
}

#productDetailModal .modal-add-to-cart:hover {
  background: var(--ci-brand);
}

#productDetailModal .size-btn.is-selected,
#productDetailModal .thumbnail-btn.is-selected {
  border-color: var(--ci-brand) !important;
  background: var(--ci-brand-light);
}

/* Add-to-cart picker modal */
.add-to-cart-pick-panel {
  border-color: var(--ci-border-soft) !important;
  background: #fff !important;
  color: var(--ci-text) !important;
}

.add-to-cart-pick-option:focus-within,
.add-to-cart-pick-option:has(:checked) {
  border-color: var(--ci-brand-ring) !important;
  background: var(--ci-brand-light) !important;
}

#addToCartPickConfirm {
  background: var(--ci-brand) !important;
  color: #fff !important;
}

#addToCartPickConfirm:hover {
  background: var(--ci-brand-hover) !important;
}

#addToCartPickConfirm:focus-visible,
#addToCartPickCancel:focus-visible,
#addToCartPickClose:focus-visible {
  outline: 2px solid var(--ci-brand);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  #productGrid .product-card,
  #productGrid .product-card-img {
    transition: none !important;
  }

  #productGrid .product-card:hover {
    transform: none !important;
  }
}
