/* Apply Montserrat font */
* {
  font-family: 'Montserrat', sans-serif;
}

body {
  font-family: 'Montserrat', sans-serif;
}

/* =========================
   SHOP BANNER (UNCHANGED)
========================= */
.shop {
  background: 
    linear-gradient(135deg, rgba(31, 41, 51, 0.95) 0%, rgba(59, 78, 255, 0.85) 100%),
    url('https://staging.shadiaelamin.com/wp-content/themes/shadiaelamin/images/DSC04450-Edit.webp') 
    center / cover no-repeat;

  padding: 120px 20px 80px;
  position: relative;
  overflow: hidden;
}


.shop::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.shop .shop-text {
  position: relative;
  z-index: 1;
}

.shop h1 {
  font-size: 48px;
  margin-bottom: 10px;
}

.shop p {
  font-size: 22px;
  margin-bottom: 20px;
}

.shop button {
  padding: 12px 25px;
  margin: 5px;
  background: #6b0f0f;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 15px;
  transition: 0.3s;
}

.shop button:hover {
  background: #6b0f0f;
  transform: scale(1.05);
}

/* =========================
   FILTER + PRODUCTS LAYOUT
========================= */
.shop-filter-section {
  padding: 50px 0;
}

.shop-filter-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 30px;
  align-items: start;
}

/* =========================
   FILTER SIDEBAR
========================= */
.filter-sidebar {
  background: #fff;
  border: 1px solid #eaeaea;
  padding: 20px;
  height: fit-content;
}

.filter-sidebar h3 {
  font-size: 20px;
  margin-bottom: 15px;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

.filter-group {
  margin-bottom: 25px;
}

.filter-group h4 {
  font-size: 15px;
  margin-bottom: 10px;
}

.filter-group label {
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
  cursor: pointer;
}

.filter-group input {
  margin-right: 8px;
}

.clear-filter {
  width: 100%;
  padding: 10px;
  background: #000;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 14px;
}

/* =========================
   PRODUCTS GRID - WOOCOMMERCE OVERRIDES
========================= */
.products-wrapper {
  flex: 1;
  width: 100%;
}

/* WooCommerce Wrapper */
.woocommerce-wrapper {
  width: 100%;
  display: block;
  clear: both;
}

/* Shop Loop Header - Result Count & Ordering */
.woocommerce .woocommerce-result-count,
.woocommerce .woocommerce-ordering {
  display: inline-block;
  vertical-align: middle;
  margin-bottom: 20px;
}

.woocommerce .woocommerce-ordering {
  float: right;
}

.woocommerce .woocommerce-result-count {
  float: left;
}

/* Clear floats before products list */
.woocommerce-wrapper::after {
  content: "";
  display: table;
  clear: both;
  width: 100%;
}

/* =========================
   WOOCOMMERCE PRODUCTS GRID - 3 COLUMNS FIX
========================= */

/* Override WooCommerce default floats and widths */
.woocommerce ul.products,
.woocommerce-page ul.products {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 25px !important;
  list-style: none !important;
  margin: 30px 0 0 0 !important;
  padding: 0 !important;
  width: 100% !important;
  clear: both !important;
  grid-auto-flow: row !important;
  /* Override WooCommerce nth-child clearing */
  grid-auto-rows: auto !important;
}

/* Override WooCommerce default product item styles */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  float: none !important;
  clear: none !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  /* Override WooCommerce nth-child(3n+1) clearing */
  grid-column: auto !important;
  /* Override Bootstrap column classes if present */
  position: relative !important;
}

/* Override WooCommerce nth-child selectors that clear floats */
.woocommerce ul.products li.product:nth-child(3n+1),
.woocommerce ul.products li.product:nth-child(3n),
.woocommerce ul.products li.product:nth-child(odd),
.woocommerce ul.products li.product:nth-child(even),
.woocommerce-page ul.products li.product:nth-child(3n+1),
.woocommerce-page ul.products li.product:nth-child(3n) {
  clear: none !important;
  float: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  grid-column: auto !important;
}

/* Ensure first product starts at column 1 */
.woocommerce ul.products li.product:first-child {
  grid-column: 1 !important;
  clear: none !important;
  float: none !important;
}

/* Override Bootstrap column classes if theme uses Bootstrap */
.woocommerce ul.products li.product[class*="col-"],
.woocommerce-page ul.products li.product[class*="col-"] {
  width: 100% !important;
  flex: 0 0 100% !important;
  max-width: 100% !important;
  float: none !important;
}

/* Product Card Styles */
.product-card {
  background: #fff;
  border: 1px solid #eee;
  padding: 15px;
  text-align: center;
  transition: 0.3s;
  position: relative;
  border-radius: 8px;
  width: 100%;
  display: block;
  height: 100%;
  box-sizing: border-box;
  flex-shrink: 0; /* Prevent cards from shrinking in scroll containers */
}

/* Fixed width for product cards in scroll containers */
.bs-scroll .product-card,
.ts-scroll .product-card {
  min-width: 300px;
  max-width: 300px;
  width: 300px;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.product-card .sale-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background: #4caf50;
  color: #fff;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  z-index: 2;
}

.product-card .product-image {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 15px;
  width: 100%;
  height: 300px; /* Fixed standard height */
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f8f8;
}

.product-card .product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-card .product-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.25);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transition: 0.3s;
}

.product-card:hover .product-overlay {
  opacity: 1;
}

.product-card .product-overlay button,
.product-card .product-overlay .quick-view-btn {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  max-width: 38px !important;
  max-height: 38px !important;
  border-radius: 50% !important;
  border: 2px solid rgba(255, 255, 255, 0.9) !important;
  background: rgba(255, 255, 255, 0.95) !important;
  color: #333 !important;
  cursor: pointer;
  font-size: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
  backdrop-filter: blur(10px);
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1 !important;
}

.product-card .product-overlay button:hover,
.product-card .product-overlay .quick-view-btn:hover {
  background: #6b0f0f !important;
  border-color: #6b0f0f !important;
  color: #fff !important;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(107, 15, 15, 0.4) !important;
}

.product-card .product-overlay button i,
.product-card .product-overlay .quick-view-btn i {
  font-size: 12px !important;
  line-height: 1 !important;
  width: auto !important;
  height: auto !important;
}

.product-card .product-overlay .cart-btn {
  background: #7a1c1c;
  color: #fff;
}

.product-card h3 {
  font-size: 17px;
  margin-bottom: 8px;
  font-weight: 500;
}

.product-card h3 a {
  text-decoration: none;
  color: #333;
}

.product-card .price {
  font-size: 16px;
  color: #6b0f0f;
  margin-bottom: 10px;
  font-weight: 600;
}

.product-card .price del {
  color: #999;
  margin-right: 8px;
}

.product-card .add-cart {
  display: inline-block;
  padding: 10px 18px;
  background: #6b0f0f;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  border-radius: 4px;
  transition: 0.3s;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}

.product-card .add-cart:hover {
  background: #5a0a0a;
}

/* =========================
   PAGINATION
========================= */
.pagination {
  grid-column: 1 / -1;
  margin-top: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination button {
  padding: 8px 14px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  transition: 0.3s;
}

.pagination button:hover {
  background: #000;
  color: #fff;
}

.pagination button.active {
  background: #000;
  color: #fff;
  border-color: #000;
}

.pagination button.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* WooCommerce Pagination */
.woocommerce nav.woocommerce-pagination {
  grid-column: 1 / -1;
  margin-top: 40px;
  text-align: center;
}

/* =========================
   RESPONSIVE - BOOTSTRAP COMPATIBLE
========================= */

/* Tablet - 2 columns */
@media (max-width: 992px) {
  .shop-filter-layout {
    grid-template-columns: 1fr;
  }

  .woocommerce ul.products,
  .woocommerce-page ul.products {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px !important;
  }
  
  .filter-sidebar {
    order: 2;
  }
  
  .products-wrapper {
    order: 1;
  }
  
  /* Override nth-child for 2 columns */
  .woocommerce ul.products li.product:nth-child(2n+1),
  .woocommerce-page ul.products li.product:nth-child(2n+1) {
    clear: none !important;
    float: none !important;
    grid-column: auto !important;
  }
}

/* Mobile - 1 column */
@media (max-width: 576px) {
  .woocommerce ul.products,
  .woocommerce-page ul.products {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  .shop h1 {
    font-size: 34px;
  }

  .shop p {
    font-size: 18px;
  }
  
  /* Override all nth-child for single column */
  .woocommerce ul.products li.product:nth-child(n),
  .woocommerce-page ul.products li.product:nth-child(n) {
    clear: none !important;
    float: none !important;
    grid-column: 1 !important;
  }
}

/* Bootstrap specific overrides */
@media (min-width: 576px) and (max-width: 767.98px) {
  .woocommerce ul.products,
  .woocommerce-page ul.products {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .woocommerce ul.products,
  .woocommerce-page ul.products {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (min-width: 992px) {
  .woocommerce ul.products,
  .woocommerce-page ul.products {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* Additional WooCommerce message/notice styling */
.woocommerce .woocommerce-breadcrumb,
.woocommerce .woocommerce-info,
.woocommerce .woocommerce-message {
  margin-bottom: 20px;
  width: 100%;
  clear: both;
}
