/* AHD theme shop styles - minimal, Bootstrap provides base */
.ahd-products-grid .product-card {
  border: 1px solid #eee;
  background: #fff;
  padding: 12px;
  transition: box-shadow .15s ease, transform .12s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.ahd-products-grid .product-card:hover {
  box-shadow: 0 8px 18px rgba(0,0,0,.06);
  transform: translateY(-4px);
}

.ahd-product-image {
  width: 100%;
  padding-bottom: 100%;
  position: relative;
  overflow: hidden;
  margin-bottom: 10px;
}

.ahd-product-image img {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ahd-product-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.3;
  color: #222;
}

.ahd-product-price {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.ahd-product-actions {
  margin-top: auto;
  display:flex;
  gap:8px;
  align-items:center;
}

.ahd-price-old {
  color: #9b9b9b;
  text-decoration: line-through;
  font-size: 13px;
  margin-left:8px;
}

.ahd-single-product .single-product-gallery {
  border: 1px solid #eee;
  padding: 12px;
  background: #fff;
}

.ahd-single-product .summary {
  padding-left: 24px;
}

/* ✅ Mobile Fix for Product Grid */
@media (max-width: 767px) {
  .ahd-products-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* two per row */
    gap: 12px;
  }

  .ahd-products-grid .product-card {
    flex: 1 1 48%;   /* shrink to fit */
    max-width: 48%;  /* ensure no overlap */
    margin: 0 auto;
  }

  .ahd-product-image { 
    padding-bottom: 85%; /* reduce height so it fits better */
  }
}

/* ✅ On very small screens (under 480px) → still keep 2 per row */
@media (max-width: 480px) {
  .ahd-products-grid {
    grid-template-columns: 1fr 1fr; /* force 2 per row */
  }

  .ahd-products-grid .product-card {
    max-width: 100%; /* let grid control sizing */
  }
}

/* --- Single Product Add to Cart --- */
.ahd-single-product form.cart {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.ahd-single-product form.cart .quantity {
  display: flex;
  align-items: center;
  border: 1px solid #ccc;
  border-radius: 4px;
  overflow: hidden;
}

.ahd-single-product form.cart .quantity input.qty {
  width: 60px;
  text-align: center;
  border: none;
  font-size: 16px;
  height: 44px;
  padding: 0;
}

.ahd-single-product form.cart .quantity button {
  background: #f7f7f7;
  border: none;
  width: 44px;
  height: 44px;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.2s;
}
.ahd-single-product form.cart .quantity button:hover {
  background: #e5e5e5;
}

/* Add to cart button */
.ahd-single-product form.cart button.single_add_to_cart_button {
  flex: 1;
  background-color: #2c7a34;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  padding: 14px;
  border: none;
  border-radius: 4px;
  text-transform: uppercase;
  transition: background 0.2s;
}
.ahd-single-product form.cart button.single_add_to_cart_button:hover {
  background-color: #256529;
}

/* --- Product Image + Sale Badge --- */
.ahd-product-img-wrap {
  position: relative;
}
.ahd-product-img-wrap .onsale {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #e53935;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 4px;
  z-index: 2;
}

/* --- Trust Badges --- */
.ahd-product-trust {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ahd-trust-item {
  display: flex;
  align-items: center;
  font-size: 15px;
  font-weight: 500;
  color: #2c2c2c;
  padding: 12px;
  border: 1px solid #eee;
  border-radius: 6px;
  background: #fafafa;
}
.ahd-trust-item i {
  font-size: 18px;
  color: #2c7a34;
  margin-right: 10px;
}

/* --- Related Products Horizontal Row --- */
.related.products {
  margin-top: 40px;
}

.related.products ul.products {
  display: flex;
  flex-wrap: nowrap; /* ✅ forces horizontal row */
  gap: 20px;
  overflow-x: auto; /* ✅ allows scrolling if too many */
  padding-bottom: 10px;
}

.related.products ul.products li.product {
  flex: 0 0 220px; /* ✅ fixed width product cards */
  list-style: none;
  border: 1px solid #eee;
  border-radius: 6px;
  background: #fff;
  padding: 12px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.related.products ul.products li.product img {
  max-width: 158px;
  max-height: 158px;
  margin: 0 auto 10px;
  display: block;
  object-fit: cover;
}

.related.products ul.products li.product:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* ✅ Hide default WooCommerce clear floats */
.related.products ul.products::after {
  display: none;
}
