/* ═══════════════════════════════════════════════════════════
   APV SHOP — WooCommerce Overrides
   ═══════════════════════════════════════════════════════════ */

/* Reset default WooCommerce styles that conflict */
.woocommerce .products ul,
.woocommerce ul.products {
  margin: 0;
  padding: 0;
}

.woocommerce ul.products li.product {
  margin: 0;
  padding: 0;
  float: none;
  width: auto;
}

/* ─── Shop Page ────────────────────────────────────────── */
.shop-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: var(--space-2xl);
  max-width: var(--container-max);
  margin: 0 auto;
  padding: calc(var(--header-height) + var(--topbar-height) + var(--space-2xl)) var(--container-padding) var(--space-4xl);
}

.shop-header {
  grid-column: 1 / -1;
}

.shop-header__banner {
  position: relative;
  height: 200px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-xl);
}

.shop-header__banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-header__banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,0,0,0.6), rgba(0,0,0,0.2));
  display: flex;
  align-items: center;
  padding: 0 var(--space-2xl);
}

.shop-header__banner h1 {
  color: #FFFFFF;
  font-size: var(--fs-h1);
}

/* Toolbar */
.shop-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.shop-toolbar__count {
  font-size: var(--fs-small);
  color: var(--color-text-secondary);
}

.shop-toolbar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.shop-toolbar select {
  padding: 8px 32px 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: var(--fs-small);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.shop-toolbar__view {
  display: flex;
  gap: 4px;
}

.shop-toolbar__view button {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  background: var(--color-bg);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
}

.shop-toolbar__view button.active,
.shop-toolbar__view button:hover {
  background: var(--color-text);
  border-color: var(--color-text);
  color: #FFFFFF;
}

.shop-toolbar__view svg {
  width: 16px;
  height: 16px;
}

/* ─── Sidebar Filters ──────────────────────────────────── */
.shop-sidebar {
  position: sticky;
  top: calc(var(--header-height) + var(--topbar-height) + var(--space-lg));
  max-height: calc(100vh - var(--header-height) - var(--topbar-height) - 2rem);
  overflow-y: auto;
  padding-right: var(--space-md);
}

.filter-group {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--color-border);
}

.filter-group:last-child {
  border-bottom: none;
}

.filter-group__title {
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.filter-group__title svg {
  width: 16px;
  height: 16px;
  transition: transform var(--duration-fast) var(--ease-smooth);
}

.filter-group.collapsed .filter-group__title svg {
  transform: rotate(-90deg);
}

.filter-group.collapsed .filter-group__options {
  display: none;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px 0;
  cursor: pointer;
  font-size: var(--fs-small);
  transition: color var(--duration-fast) var(--ease-smooth);
}

.filter-option:hover {
  color: var(--color-accent);
}

.filter-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  accent-color: var(--color-accent);
  cursor: pointer;
}

.filter-option__count {
  margin-left: auto;
  color: var(--color-text-muted);
  font-size: var(--fs-xs);
}

/* Price Range Slider */
.filter-range {
  padding: var(--space-sm) 0;
}

.filter-range__inputs {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.filter-range__inputs input {
  width: 80px;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  font-size: var(--fs-small);
  text-align: center;
  background: var(--color-bg);
  color: var(--color-text);
}

.filter-range__separator {
  color: var(--color-text-muted);
}

.filter-reset {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--fs-small);
  color: var(--color-accent);
  cursor: pointer;
  padding: var(--space-sm) 0;
}

.filter-reset:hover {
  text-decoration: underline;
}

/* ─── Products Grid (Shop) ─────────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.products-grid.grid-4-cols {
  grid-template-columns: repeat(4, 1fr);
}

/* ─── Pagination ───────────────────────────────────────── */
.woocommerce-pagination,
.shop-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  margin-top: var(--space-3xl);
}

.shop-pagination a,
.shop-pagination span,
.woocommerce-pagination ul li a,
.woocommerce-pagination ul li span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  color: var(--color-text);
  background: var(--color-bg);
  transition: all var(--duration-fast) var(--ease-smooth);
  text-decoration: none;
}

.shop-pagination a:hover,
.woocommerce-pagination ul li a:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.shop-pagination .current,
.woocommerce-pagination ul li span.current {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #FFFFFF;
}

/* ─── Single Product ───────────────────────────────────── */
.single-product-layout {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: calc(var(--header-height) + var(--topbar-height) + var(--space-2xl)) var(--container-padding) var(--space-4xl);
}

.product-main {
  display: grid;
  grid-template-columns: 55% 1fr;
  gap: var(--space-3xl);
  margin-bottom: var(--space-4xl);
}

/* Product Gallery */
.product-gallery {
  position: sticky;
  top: calc(var(--header-height) + var(--topbar-height) + var(--space-lg));
}

.product-gallery__main {
  position: relative;
  aspect-ratio: 1;
  background: var(--color-bg-product);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: crosshair;
  margin-bottom: var(--space-md);
}

.product-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 24px;
  transition: transform var(--duration-normal) var(--ease-smooth);
}

.product-gallery__thumbnails {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
}

.product-gallery__thumb {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  background: var(--color-bg-product);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  padding: 8px;
  transition: border-color var(--duration-fast) var(--ease-smooth);
}

.product-gallery__thumb.active,
.product-gallery__thumb:hover {
  border-color: var(--color-accent);
}

.product-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Product Info */
.product-info__name {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: var(--fw-bold);
  margin-bottom: var(--space-md);
  line-height: var(--lh-tight);
}

.product-info__rating {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.product-info__rating a {
  color: var(--color-text-muted);
  font-size: var(--fs-small);
}
.product-info__rating a:hover {
  color: var(--color-accent);
}

.product-info__price {
  display: flex;
  align-items: baseline;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.product-info__price-current {
  font-size: var(--fs-price);
  font-weight: var(--fw-bold);
  color: var(--color-accent);
  font-variant-numeric: tabular-nums;
}

.product-info__price-old {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  text-decoration: line-through;
}

.product-info__price-badge {
  padding: 4px 10px;
  background: var(--color-accent);
  color: #FFFFFF;
  font-size: var(--fs-badge);
  font-weight: var(--fw-semibold);
  border-radius: var(--radius-xs);
}

.product-info__short-desc {
  font-size: var(--fs-body);
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-xl);
}

.product-info__actions {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  margin-bottom: var(--space-lg);
}

.product-info__add-to-cart {
  flex: 2;
}

.product-info__buy-now {
  flex: 1;
}

.product-info__wishlist-btn {
  width: 52px;
  height: 52px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
  flex-shrink: 0;
}

.product-info__wishlist-btn:hover {
  border-color: var(--color-accent);
}

.product-info__wishlist-btn svg {
  width: 22px;
  height: 22px;
  stroke: var(--color-text);
  fill: none;
}

.product-info__wishlist-btn.active svg {
  fill: var(--color-accent);
  stroke: var(--color-accent);
}

/* Trust badges */
.product-info__trust {
  display: flex;
  gap: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-lg);
}

.product-info__trust-item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.product-info__trust-item svg {
  width: 16px;
  height: 16px;
  stroke: var(--color-success);
  fill: none;
}

/* FOMO notification */
.product-fomo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.8125rem;
  color: var(--color-accent);
  animation: pulse 2s infinite;
  margin-bottom: var(--space-md);
}

/* Stock warning */
.product-stock-warning {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--fs-small);
  color: var(--color-warning);
  font-weight: var(--fw-medium);
  margin-bottom: var(--space-md);
}

/* ─── Cart Page ────────────────────────────────────────── */
.cart-layout {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: calc(var(--header-height) + var(--topbar-height) + var(--space-2xl)) var(--container-padding) var(--space-4xl);
}

.cart-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--space-2xl);
}

.cart-shipping-bar {
  grid-column: 1 / -1;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-md) var(--space-lg);
  text-align: center;
  font-size: var(--fs-small);
}

.cart-table {
  width: 100%;
}

.cart-table th {
  text-align: left;
  padding: var(--space-md) var(--space-sm);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}

.cart-table td {
  padding: var(--space-md) var(--space-sm);
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: middle;
}

.cart-item__image {
  width: 80px;
  height: 80px;
  background: var(--color-bg-product);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.cart-item__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.cart-item__name {
  font-weight: var(--fw-medium);
  font-size: var(--fs-small);
}

.cart-item__variant {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

.cart-item__remove {
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-smooth);
}

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

/* Cart summary */
.cart-summary {
  position: sticky;
  top: calc(var(--header-height) + var(--topbar-height) + var(--space-lg));
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
}

.cart-summary__title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: var(--fw-semibold);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.cart-summary__row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  font-size: var(--fs-small);
}

.cart-summary__total {
  display: flex;
  justify-content: space-between;
  padding: var(--space-md) 0;
  font-size: 1.25rem;
  font-weight: var(--fw-bold);
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-md);
}

.cart-summary__coupon {
  display: flex;
  gap: var(--space-sm);
  margin: var(--space-md) 0;
}

.cart-summary__coupon input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  font-size: var(--fs-small);
  background: var(--color-bg);
  color: var(--color-text);
}

.cart-summary__payment-icons {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin-top: var(--space-md);
  opacity: 0.5;
}

.cart-summary__payment-icons svg {
  height: 20px;
}

/* ─── Responsive ───────────────────────────────────────── */
@media (max-width: 1024px) {
  .shop-layout {
    grid-template-columns: 1fr;
  }

  .shop-sidebar {
    position: static;
    max-height: none;
  }

  .product-main {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .product-gallery {
    position: static;
  }
}

@media (max-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }

  .cart-grid {
    grid-template-columns: 1fr;
  }

  .cart-summary {
    position: static;
  }

  .product-info__trust {
    flex-wrap: wrap;
  }

  .product-info__actions {
    flex-wrap: wrap;
  }

  .product-info__add-to-cart,
  .product-info__buy-now {
    flex: 1 1 45%;
  }

  /* Sticky add to cart on mobile */
  .mobile-sticky-cart {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    padding: 12px var(--container-padding);
    display: flex;
    gap: var(--space-sm);
    z-index: var(--z-sticky);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
  }

  .mobile-sticky-cart .btn { flex: 1; padding: 14px 16px; }
}
