/* eb-sp-gallery eb-sp-card */

.eb-sp-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: center;
}
.eb-sp-wrap > * {
  min-width: 0;
}

@media (min-width: 992px) {
  .eb-sp-wrap {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  }
}

.eb-sp-gallery {
  background: #fff;
  border: 0;
  border-radius: 12px;
  padding: 12px;
  position: relative; /* required for trigger/zoom positioning */
}

@media (min-width: 992px) {
  .eb-sp-gallery {
  position: sticky;
    top: 24px;
  }
}

/* Ensure the main image fills the width; natural aspect on mobile */
.eb-sp-gallery .woocommerce-product-gallery__image {
  width: 100%;
}

.eb-sp-gallery .woocommerce-product-gallery__image img.wp-post-image {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 12px;
}

/* Ensure trigger positions correctly */
.woocommerce-product-gallery {
  position: relative;
  max-width: 100%;
}
/* Do not constrain the Flexslider track; allow width set by Woo (percent based) */
/* .woocommerce-product-gallery__wrapper { max-width: 100%; } */
.woocommerce-product-gallery__image,
.woocommerce-product-gallery__image a,
.woocommerce-product-gallery__image img.wp-post-image {
  max-width: 100%;
}
.woocommerce-product-gallery__image a {
  display: block;
}

/* Critical: Do not constrain the zoom overlay image generated by Woo (elevateZoom).
   If max-width:100% leaks here, zoom will match the main image size and appear as if it's not zooming. */
.woocommerce-product-gallery__image .zoomImg {
  max-width: none !important;
  max-height: none !important;
  width: auto !important;
  height: auto !important;
}

/* Default Woo-style zoom/lightbox trigger */
.woocommerce-product-gallery__trigger {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 0;
  z-index: 5;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.woocommerce-product-gallery__trigger:hover {
  background: rgba(0, 0, 0, 0.7);
}

.woocommerce-product-gallery__trigger:focus {
  outline: 2px solid rgba(17, 24, 39, 0.2);
  outline-offset: 2px;
}

.woocommerce-product-gallery__trigger span {
  position: absolute;
  left: -9999px;
}

.woocommerce-product-gallery__trigger::after {
  content: '';
  width: 20px;
  height: 20px;
  background-repeat: no-repeat;
  background-size: contain;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="7"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>');
}

/* Gallery thumbnails row; remove bullets and enable horizontal scroll */
/* Keep default Flexslider nav intact; enhance visuals without changing layout mechanics */
.woocommerce-product-gallery .flex-control-nav,
.woocommerce-product-gallery .woocommerce-product-thumbnails {
  list-style: none;
  margin: 0;
  padding: 10px 0 0 0;
  gap: 8px;
  display: flex;
}

.woocommerce-product-gallery .flex-control-nav li,
.woocommerce-product-gallery .woocommerce-product-thumbnails li {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 92px;
  height: 92px;
}

.woocommerce-product-gallery .flex-control-nav img,
.woocommerce-product-gallery .woocommerce-product-thumbnails img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

/* Active thumb styling with high specificity */
.woocommerce-product-gallery .flex-control-nav li.is-active img,
.woocommerce-product-gallery .woocommerce-product-thumbnails li.is-active img,
.woocommerce-product-gallery .flex-control-nav li.flex-active img,
.woocommerce-product-gallery .woocommerce-product-thumbnails li.flex-active img,
.woocommerce-product-gallery .flex-control-nav a.is-active img,
.woocommerce-product-gallery .woocommerce-product-thumbnails a.is-active img,
.woocommerce-product-gallery .flex-control-nav img.is-active,
.woocommerce-product-gallery .woocommerce-product-thumbnails img.is-active {
  outline: 3px solid var(--eb-color-primary) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.2) !important;
  border: 2px solid #fff !important;
}

/* Also show focus state when keyboard navigating */
.woocommerce-product-gallery .flex-control-nav a:focus img,
.woocommerce-product-gallery .woocommerce-product-thumbnails a:focus img,
.woocommerce-product-gallery .flex-control-nav img:focus,
.woocommerce-product-gallery .woocommerce-product-thumbnails img:focus {
  outline: 3px solid var(--eb-color-primary) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.3) !important;
}

/* Ensure thumbnails are clickable */
.woocommerce-product-gallery .flex-control-nav img,
.woocommerce-product-gallery .woocommerce-product-thumbnails img {
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.woocommerce-product-gallery .flex-control-nav img:hover,
.woocommerce-product-gallery .woocommerce-product-thumbnails img:hover {
  opacity: 0.8 !important;
  transform: scale(1.02) !important;
}

.eb-sp-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.eb-sp-title {
  margin: 0;
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.25;
}

.eb-sp-meta {
  color: #6b7280;
  font-size: 14px;
}

.eb-sp-price {
  font-size: 22px;
  font-weight: 700;
    color: #16a34a;

}

.eb-sp-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.eb-sp-purchase form.cart {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.eb-sp-purchase table.variations {
  width: 100%;
}

.eb-sp-purchase table.variations td.label {
  width: 140px;
  white-space: nowrap;
}

.eb-sp-purchase table.variations select {
  width: 100%;
}

.eb-sp-purchase .single_variation_wrap {
  width: 100%;
}

.eb-sp-purchase .woocommerce-variation {
  margin: 6px 0;
}

/* Quantity + button styles */
.eb-qty {
  display: flex;
  align-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.eb-qty button {
  background: #f9fafb;
  border: 0;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #374151;
}

.eb-qty input.qty {
  border: 0;
  width: 54px;
  text-align: center;
  height: 36px;
  outline: none;
}

.eb-qty button:hover {
  background: #f3f4f6;
}

.wc-pao-addons-container {
  width: 100%;
}

.single_variation_wrap .woocommerce-variation-add-to-cart {
  display: flex;
  gap: 12px;
}

.eb-sp-card .eb-sp-purchase .single_add_to_cart_button {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: auto;
  background: linear-gradient(90deg, #2563eb 0%, #6366f1 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.3s ease;
}

.eb-sp-card .eb-sp-purchase .single_add_to_cart_button:hover {
  background: linear-gradient(90deg, #6366f1 0%, #2563eb 100%);
}

/* .eb-sp-card  .eb-sp-purchase .single_add_to_cart_button  svg {
                    width: 16px;
                    height: 16px;
                } */

/* Radio-style variation chips */
.eb-variant-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0 6px;
}

.eb-variant-chip {
  appearance: none;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s ease;
}

.eb-variant-chip:hover {
  background: #f3f4f6;
}

.eb-variant-chip.is-active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

.eb-variant-chip.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.eb-hidden-select {
  position: absolute !important;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.eb-attrs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.eb-attr-chip {
  font-size: 13px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 4px 10px;
}

.eb-sp-card {
  background: #fff;
  border: 0;
  border-radius: 12px;
  padding: 14px;
}

.eb-sp-section {
  margin-top: 28px;
}

.eb-sp-section h3 {
  font-size: 18px;
  margin: 0 0 10px 0;
}

.eb-related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

@media (min-width: 768px) {
  .eb-related-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.eb-archive-toolbar {
  display: none;
}

.eb-product-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}

/* Product data tabs as horizontal row; remove bullets */
.woocommerce-tabs ul.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid #e5e7eb;
}

.woocommerce-tabs ul.tabs li {
  list-style: none;
  margin: 0;
}

.woocommerce-tabs ul.tabs li a {
  display: block;
  padding: 10px 12px;
  text-decoration: none;
  color: #374151;
  border-bottom: 2px solid transparent;
}

.woocommerce-tabs ul.tabs li.active a,
.woocommerce-tabs ul.tabs li a:hover,
.woocommerce-tabs ul.tabs li a:focus {
  border-bottom-color: #111827;
  color: #111827;
}

/* Single product meta styling */
.eb-sp-meta-block {
  border-top: 1px solid #e5e7eb;
  padding-top: 12px;
}

.eb-sp-meta-block .product_meta {
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: #374151;
}

.eb-sp-meta-block .product_meta > span {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.eb-sp-meta-block .product_meta .posted_in,
.eb-sp-meta-block .product_meta .tagged_as,
.eb-sp-meta-block .product_meta .sku_wrapper {
  color: #6b7280;
}

.eb-sp-meta-block .product_meta a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 4px 10px;
  color: #111827;
  text-decoration: none;
}

.eb-sp-meta-block .product_meta a:hover {
  background: #e5e7eb;
}

.eb-sp-meta-block .product_meta .sku_wrapper .sku {
  display: inline-flex;
  align-items: center;
  background: #eef2ff;
  color: #1f2937;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  padding: 3px 8px;
  font-weight: 600;
}

.eb-sp-meta-block .product_meta .posted_in::before,
.eb-sp-meta-block .product_meta .tagged_as::before,
.eb-sp-meta-block .product_meta .sku_wrapper::before {
  content: '';
  width: 16px;
  height: 16px;
  margin-right: 2px;
  background-repeat: no-repeat;
  background-size: contain;
  display: inline-block;
}

.eb-sp-meta-block .product_meta .posted_in::before {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%236b7280" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 4h18v4H3z"/><path d="M3 8h18v12H3z"/></svg>');
}

.eb-sp-meta-block .product_meta .tagged_as::before {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%236b7280" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20.59 13.41L12 22 2 12l8.59-8.59a2 2 0 012.82 0l7.18 7.18a2 2 0 010 2.82z"/><circle cx="7" cy="7" r="1"/></svg>');
}

.eb-sp-meta-block .product_meta .sku_wrapper::before {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%236b7280" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h2v12H3zM7 6h1v12H7zM10 6h3v12h-3zM15 6h1v12h-1zM18 6h3v12h-3z"/></svg>');
}

div.product-addon-totals {
  display: none;
}

/* Prevent unintended page-level horizontal scroll */
html,
body {
  overflow-x: hidden;
}

/* Responsive tweaks (mobile only) */
@media (max-width: 767.98px) {
  /* Let the main image keep its natural aspect on phones */
  .eb-sp-gallery .woocommerce-product-gallery__image {
    aspect-ratio: auto !important;
  }
  .eb-sp-gallery .woocommerce-product-gallery__image img.wp-post-image {
    height: auto !important;
    object-fit: contain;
  }
  /* Ensure first section aligns nicely on phones */
  .eb-sp-wrap {
    align-items: flex-start;
  }
  .eb-sp-gallery,
  .eb-sp-summary {
    width: 100%;
  }
  /* Stack actions for comfortable tapping */
  .eb-sp-purchase form.cart {
    flex-direction: column;
    align-items: stretch;
  }
  .single_variation_wrap .woocommerce-variation-add-to-cart {
    flex-direction: column;
    align-items: stretch;
  }
  .eb-qty {
    width: 100%;
    justify-content: space-between;
  }
  .eb-sp-card .eb-sp-purchase .single_add_to_cart_button {
    width: 100%;
    justify-content: center;
  }
  /* Make variation table rows wrap instead of squeezing */
  .eb-sp-purchase table.variations tr {
    display: block;
    margin-bottom: 8px;
  }
  .eb-sp-purchase table.variations td.label {
    width: auto;
    display: block;
    margin-bottom: 6px;
  }
  .eb-sp-purchase table.variations td.value {
    display: block;
  }
  /* Slightly smaller thumbs on very small screens */
  .woocommerce-product-gallery .flex-control-nav li,
  .woocommerce-product-gallery .woocommerce-product-thumbnails li {
    width: 72px;
    height: 72px;
  }
  /* One column related products */
  .eb-related-grid {
    grid-template-columns: 1fr;
  }
  /* Addons form full width */
  .wc-pao-addons-container {
    width: 100%;
  }
}
