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

/* Remove default padding for shop pages */
body.post-type-archive-product .site-main,
body.tax-product_cat .site-main,
body.tax-product_tag .site-main {
  padding: 0 !important;
  max-width: none !important;
}

/* Override WooCommerce default wrapper constraints */
body.post-type-archive-product .woocommerce,
body.tax-product_cat .woocommerce,
body.tax-product_tag .woocommerce {
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ===== PAGE LAYOUT ===== */
.shop-page-wrapper {
  display: flex;
  gap: 2rem;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

/* ===== MAIN CONTENT ===== */
.shop-main {
  flex: 1;
  min-width: 0;
}

/* Breadcrumb */
.shop-main .woocommerce-breadcrumb {
  font-size: 0.875rem;
  color: var(--gb-text);
  margin-bottom: 1.5rem;
  padding: 0;
}

.shop-main .woocommerce-breadcrumb a {
  color: var(--gb-navy);
}

.shop-main .woocommerce-breadcrumb a:hover {
  color: var(--gb-gold);
}

/* ===== SHOP SECTIONS ===== */
.shop-main .lm-banner {
  margin-bottom: 2.5rem;
}

.shop-section {
  margin-bottom: 3rem;
}

.shop-section .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--gb-navy);
}

.shop-section .section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gb-navy);
  margin: 0;
}

.shop-section .section-footer {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

/* ===== CATEGORY/ARCHIVE VIEW ===== */
.shop-header {
  margin-bottom: 2rem;
}

.shop-header .shop-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gb-navy);
  margin-bottom: 0.5rem;
}

.shop-header .term-description {
  color: var(--gb-text);
  line-height: 1.7;
}

/* Result count and ordering */
.shop-main .woocommerce-result-count {
  float: left;
  font-size: 0.9rem;
  color: var(--gb-text);
  margin: 0 0 1rem;
  line-height: 2.5;
}

.shop-main .woocommerce-ordering {
  float: right;
  margin-bottom: 1rem;
}

.shop-main .woocommerce-ordering select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--gb-border);
  border-radius: 4px;
  font-size: 0.9rem;
}

/* Products grid */
.shop-main ul.products {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
  clear: both;
}

/* Remove WooCommerce float clearing pseudo-elements */
.shop-main ul.products::before,
.shop-main ul.products::after,
.shop-section .woocommerce ul.products::before,
.shop-section .woocommerce ul.products::after {
  display: none !important;
  content: none !important;
}

/* Override WooCommerce float/width grid system */
.shop-main ul.products li.product,
.shop-section .woocommerce ul.products li.product {
  float: none !important;
  width: auto !important;
  margin: 0 !important;
  background: var(--gb-white);
  border: 1px solid var(--gb-border);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.shop-main ul.products li.product:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.shop-main ul.products li.product a.woocommerce-LoopProduct-link {
  display: block;
  text-decoration: none;
}

.shop-main ul.products li.product img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  margin-bottom: 0.75rem;
  border-radius: 4px;
  background: #f9f9f9;
}

.shop-main ul.products li.product .woocommerce-loop-product__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gb-navy);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.shop-main ul.products li.product .price {
  font-size: 1rem;
  font-weight: 700;
}

/* Price amount: gold */
.shop-main ul.products li.product .price .woocommerce-Price-amount {
  color: var(--gb-gold);
}

/* "from" prefix: small, dark, normal weight */
.shop-main ul.products li.product .gbpm-from-price-prefix {
  color: var(--gb-text);
  font-size: 0.85rem;
  font-weight: 400;
}

.shop-main ul.products li.product .price del {
  color: #999;
  font-weight: 400;
  font-size: 0.875rem;
}

.shop-main ul.products li.product .price ins {
  text-decoration: none;
  color: var(--gb-gold);
}

/* Hide add to cart buttons */
.shop-main ul.products li.product .button,
.shop-main ul.products li.product .add_to_cart_button,
.shop-main ul.products li.product .added_to_cart {
  display: none !important;
}

/* Pagination — kept in DOM so the infinite-scroll script can read the
   "next" URL, but hidden visually because shop archives load on scroll. */
.shop-main .woocommerce-pagination {
  display: none;
}

/* Infinite scroll loader / end message */
.products-loader {
  text-align: center;
  padding: 3rem 1rem 1rem;
}

.products-loader p {
  color: #888;
  font-size: 0.9rem;
  margin-top: 1rem;
}

.products-loader .loader-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e0e0e0;
  border-top-color: var(--gb-navy);
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* No products found */
.shop-main .woocommerce-info {
  padding: 1.5rem;
  background: #f5f5f5;
  border-radius: 8px;
  text-align: center;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .shop-main ul.products {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .shop-page-wrapper {
    flex-direction: column;
    padding: 1.5rem;
  }

  .shop-main ul.products {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .shop-page-wrapper {
    padding: 1rem;
  }

  .shop-main ul.products {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .shop-section .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .shop-section .section-header h2 {
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  .shop-main ul.products {
    grid-template-columns: 1fr;
  }

  .shop-main .woocommerce-result-count,
  .shop-main .woocommerce-ordering {
    float: none;
    text-align: center;
    margin-bottom: 1rem;
  }
}
