/**
 * Resham Product Page Styles
 * Only button styling - minimal CSS to avoid conflicts
 */

/* Remove padding-top from product title */
.extra-title {
  padding-top: 0 !important;
}

/* Product Image Wrapper */
.resham-product-image-wrapper {
  position: relative;
  width: 100%;
  display: block;
  overflow: visible;
}

/* Magnifying Glass Button */
.resham-magnify-button {
  position: absolute !important;
  top: 15px !important;
  right: 15px !important;
  width: 45px !important;
  height: 45px !important;
  background: white !important;
  border: none !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
  z-index: 999 !important;
  transition: all 0.3s ease !important;
  color: #333 !important;
  padding: 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.resham-magnify-button:hover {
  background: #c97899 !important;
  color: white !important;
  box-shadow: 0 4px 12px rgba(201, 120, 153, 0.2) !important;
  transform: scale(1.05) !important;
}

.resham-magnify-button svg {
  width: 22px !important;
  height: 22px !important;
  stroke-width: 2.5 !important;
}

/* Wishlist Button */
.resham-wishlist-button {
  position: absolute !important;
  top: 65px !important;
  right: 15px !important;
  width: 45px !important;
  height: 45px !important;
  background: white !important;
  border: none !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
  z-index: 999 !important;
  transition: all 0.3s ease !important;
  color: #333 !important;
  padding: 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.resham-wishlist-button:hover {
  background: #c97899 !important;
  color: white !important;
  box-shadow: 0 4px 12px rgba(201, 120, 153, 0.2) !important;
  transform: scale(1.05) !important;
}

.resham-wishlist-button.added {
  color: #c97899 !important;
  fill: #c97899 !important;
}

.resham-wishlist-button.added svg {
  fill: #c97899 !important;
}

.resham-wishlist-button.added:hover {
  background: #fff !important;
  color: #c97899 !important;
}

.resham-wishlist-button svg {
  width: 22px !important;
  height: 22px !important;
  stroke-width: 2 !important;
}

/* Magnify Button Active State */
.resham-magnify-button.zoom-active {
  background: #c97899 !important;
  color: white !important;
}

/* Zoom Overlay Styling */
.resham-zoom-overlay {
  border-radius: 6px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
  pointer-events: none;
}

/* Gallery Thumbnails Display */
.resham-product-thumbnails-wrapper {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  margin-top: -80px !important;
  padding: 0 !important;
  justify-content: center !important;
  position: relative !important;
  z-index: 10 !important;
}

.resham-product-thumbnails-wrapper .woocommerce-product-gallery__image {
  flex: 0 0 auto !important;
  margin: 0 !important;
  display: inline-block !important;
}

.resham-product-thumbnails-wrapper .woocommerce-product-gallery__image img {
  width: 100px !important;
  height: 100px !important;
  object-fit: cover !important;
  border-radius: 6px !important;
  border: 2px solid #e0e0e0 !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
}

.resham-product-thumbnails-wrapper
  .woocommerce-product-gallery__image
  img:hover {
  border-color: #c97899 !important;
  box-shadow: 0 2px 8px rgba(201, 120, 153, 0.2) !important;
}

.resham-product-thumbnails-wrapper
  .woocommerce-product-gallery__image.flex-active-slide
  img {
  border-color: #c97899 !important;
  box-shadow: 0 2px 8px rgba(201, 120, 153, 0.3) !important;
}

/* Legacy support for flex-control-nav if present */
.resham-product-gallery ol.flex-control-nav,
.resham-product-gallery .flex-control-nav,
.images.resham-product-gallery .flex-control-nav li {
  display: flex !important;
  list-style: none !important;
  margin: 15px 0 0 0 !important;
  padding: 0 !important;
  gap: 10px !important;
}

.resham-product-gallery .flex-control-nav li,
.images.resham-product-gallery .flex-control-nav li {
  display: inline-block !important;
  margin: 0 !important;
  padding: 0 !important;
}

.resham-product-gallery .flex-control-nav img,
.images.resham-product-gallery .flex-control-nav img {
  width: 80px !important;
  height: 80px !important;
  object-fit: cover !important;
  border-radius: 4px;
  border: 2px solid #e0e0e0;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.resham-product-gallery .flex-control-nav img:hover,
.images.resham-product-gallery .flex-control-nav img:hover {
  border-color: #c97899;
}

/* Only style thumbnail images in the gallery nav, NOT the main image */
.flex-control-nav .woocommerce-product-gallery__image {
  margin: 8px !important;
  display: inline-block !important;
}

.flex-control-nav .woocommerce-product-gallery__image img {
  width: 80px !important;
  height: 80px !important;
  object-fit: cover !important;
  border-radius: 4px;
}

/* Lightbox Styles */
.resham-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.resham-lightbox.active {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
}

.resham-lightbox-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1;
}

.resham-lightbox-container {
  position: relative;
  z-index: 2;
  width: 90%;
  max-width: 1000px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.resham-lightbox-content {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
}

.resham-lightbox-image {
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

/* Navigation Buttons */
.resham-lightbox-prev,
.resham-lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  font-size: 28px;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.resham-lightbox-prev {
  left: -70px;
}

.resham-lightbox-next {
  right: -70px;
}

.resham-lightbox-prev:hover,
.resham-lightbox-next:hover {
  background: #c97899;
  color: white;
  box-shadow: 0 4px 12px rgba(201, 120, 153, 0.4);
  transform: translateY(-50%) scale(1.1);
}

/* Close Button */
.resham-lightbox-close {
  position: absolute;
  top: -50px;
  right: 0;
  width: 45px;
  height: 45px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  font-size: 32px;
  color: #333;
  cursor: pointer;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  padding: 0;
  line-height: 1;
}

.resham-lightbox-close:hover {
  background: #c97899;
  color: white;
  transform: rotate(90deg);
}

/* Counter Display */
.resham-lightbox-counter {
  position: absolute;
  bottom: -45px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* Cart Buttons - Enhanced Styling */

/* Buy Now Button - Primary Action */
.resham-checkout-button {
  background-color: #c86c78 !important;
  color: white !important;
  border: none !important;
  padding: 12px 14px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  border-radius: 4px !important;
  transition: all 0.3s ease !important;
  cursor: pointer !important;
  margin-right: 12px !important;
}

.resham-checkout-button:hover:not(:disabled) {
  background-color: #b86483 !important;
  border-color: #b86483 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(201, 120, 153, 0.3) !important;
}

.resham-checkout-button:active:not(:disabled) {
  transform: translateY(0) !important;
}

.resham-checkout-button:disabled {
  opacity: 0.7 !important;
  cursor: not-allowed !important;
}

/* Add to Cart Button - Secondary Action with Reduced Opacity */
.woocommerce .single_add_to_cart_button.button.alt,
button.single_add_to_cart_button.alt,
.woocommerce div.product .button.single_add_to_cart_button {
  background-color: white !important;
  color: #c97899 !important;
  border: 1px solid #c97899 !important;
  padding: 12px 14px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  border-radius: 4px !important;
  transition: all 0.3s ease !important;
  cursor: pointer !important;
  opacity: 0.65 !important;
  height: auto !important;
  line-height: normal !important;
}

.woocommerce .single_add_to_cart_button.button.alt::before,
.woocommerce .single_add_to_cart_button.button.alt::after,
button.single_add_to_cart_button.alt::before,
button.single_add_to_cart_button.alt::after {
  opacity: 1 !important;
}

.woocommerce .single_add_to_cart_button.button.alt:hover,
button.single_add_to_cart_button.alt:hover {
  background-color: rgba(201, 120, 153, 0.05) !important;
  border-color: #c97899 !important;
  color: #c97899 !important;
  opacity: 0.9 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(201, 120, 153, 0.3) !important;
}

.woocommerce .single_add_to_cart_button.button.alt:disabled,
button.single_add_to_cart_button.alt:disabled {
  opacity: 0.4 !important;
  cursor: not-allowed !important;
}


/* Remove Product Meta Section */
.product_meta {
  display: none !important;
}

/* Remove Product Badges Section */
.resham-product-badges {
  display: none !important;
}

/* Single Product Extras - Normal Text Weight */
.single-product-extras,
.single-product-extras * {
  font-weight: normal !important;
}

/* Product Quantity Styling */
.woocommerce div.product form.cart div.quantity {
  margin: 0 0.8rem 0 0 !important;
}

/* Quantity Spinners Styling */
.quantity.spinners-added {
  border: 3px solid #fff !important;
}

/* Related/Upsells Products - Match Shop Grid Style */
.related.products,
.upsells.products {
  clear: both;
}

.related.products .resham-products-grid,
.upsells.products .resham-products-grid,
.related.products .products,
.upsells.products .products {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 30px !important;
  margin-bottom: 40px !important;
  list-style: none !important;
  padding: 0 !important;
  margin: 0 0 40px 0 !important;
  width: 100% !important;
}

.related.products .resham-products-grid .product,
.upsells.products .resham-products-grid .product,
.related.products li.product,
.upsells.products li.product {
  position: relative !important;
  background: white !important;
  border: 1px solid #e8e8e8 !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  transition: all 0.3s ease !important;
  display: flex !important;
  flex-direction: column !important;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.related.products .resham-products-grid .product:hover,
.upsells.products .resham-products-grid .product:hover,
.related.products li.product:hover,
.upsells.products li.product:hover {
  border-color: #c97899 !important;
  box-shadow: 0 6px 20px rgba(201, 120, 153, 0.12) !important;
  transform: translateY(-4px) !important;
}

/* Product Image */
.related.products .product-image-wrapper,
.upsells.products .product-image-wrapper,
.related.products .woocommerce-product-gallery,
.upsells.products .woocommerce-product-gallery {
  overflow: hidden !important;
  border-radius: 8px 8px 0 0 !important;
  background: #f5f5f5 !important;
  aspect-ratio: 1 !important;
  margin: 0 !important;
}

.related.products .product-image-wrapper img,
.upsells.products .product-image-wrapper img,
.related.products .woocommerce-product-gallery img,
.upsells.products .woocommerce-product-gallery img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: top center !important;
  transition: transform 0.4s ease !important;
}

.related.products li.product:hover .product-image-wrapper img,
.upsells.products li.product:hover .product-image-wrapper img,
.related.products li.product:hover .woocommerce-product-gallery img,
.upsells.products li.product:hover .woocommerce-product-gallery img {
  transform: scale(1.08) !important;
}

/* Product Info */
.related.products .product-info,
.upsells.products .product-info {
  padding: 18px !important;
  flex-grow: 1 !important;
  display: flex !important;
  flex-direction: column !important;
}

.related.products .woocommerce-loop-product__title,
.upsells.products .woocommerce-loop-product__title,
.related.products .product-title,
.upsells.products .product-title {
  font-size: 20px !important;
  font-weight: 300 !important;
  color: #333 !important;
  margin: 0 0 8px 0 !important;
  line-height: 1.4 !important;
  min-height: 28px !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

.related.products .woocommerce-loop-product__title a,
.upsells.products .woocommerce-loop-product__title a {
  color: #333 !important;
  text-decoration: none !important;
  transition: color 0.3s ease !important;
}

.related.products .woocommerce-loop-product__title a:hover,
.upsells.products .woocommerce-loop-product__title a:hover {
  color: #c97899 !important;
}

/* Product Rating */
.related.products .star-rating,
.upsells.products .star-rating {
  margin: 8px 0 !important;
}

/* Product Price */
.related.products .price,
.upsells.products .price,
.related.products .product-price,
.upsells.products .product-price {
  color: #333 !important;
  font-size: 18px !important;
  margin: 12px 0 !important;
  font-weight: 300 !important;
  line-height: 1.3 !important;
}

/* Product Buttons */
.related.products .product-buttons,
.upsells.products .product-buttons {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 10px !important;
  margin-top: 12px !important;
}

.related.products .product-buttons .button,
.upsells.products .product-buttons .button,
.related.products .product-add-to-cart .button,
.upsells.products .product-add-to-cart .button {
  display: block !important;
  width: 100% !important;
  padding: 12px 14px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  text-align: center !important;
  border: 1px solid #c97899 !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  height: auto !important;
  line-height: normal !important;
}

.related.products .resham-product-buy-now,
.upsells.products .resham-product-buy-now {
  background: #c97899 !important;
  color: white !important;
  opacity: 1 !important;
}

.related.products .resham-product-buy-now:hover,
.upsells.products .resham-product-buy-now:hover {
  background: #b86483 !important;
  border-color: #b86483 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(201, 120, 153, 0.3) !important;
}

.related.products .product-add-to-cart .button,
.upsells.products .product-add-to-cart .button {
  background: white !important;
  color: #c97899 !important;
  opacity: 0.6 !important;
}

.related.products .product-add-to-cart .button:hover,
.upsells.products .product-add-to-cart .button:hover {
  background: rgba(201, 120, 153, 0.05) !important;
  border-color: #c97899 !important;
  transform: translateY(-2px) !important;
  opacity: 0.85 !important;
}

/* Responsive Design for Related Products */
@media (max-width: 1024px) {
  .related.products .resham-products-grid,
  .upsells.products .resham-products-grid,
  .related.products .products,
  .upsells.products .products {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 25px !important;
  }
}

@media (max-width: 768px) {
  .related.products .resham-products-grid,
  .upsells.products .resham-products-grid,
  .related.products .products,
  .upsells.products .products {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  .related.products .product-buttons,
  .upsells.products .product-buttons,
  .related.products .resham-products-grid .product-buttons,
  .upsells.products .resham-products-grid .product-buttons {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .resham-lightbox-prev,
  .resham-lightbox-next {
    position: static;
    transform: none;
    margin: 0 10px;
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .resham-lightbox-container {
    flex-direction: row;
    gap: 10px;
  }

  .resham-lightbox-image {
    max-height: 60vh;
  }

  .resham-lightbox-close {
    position: static;
    width: 40px;
    height: 40px;
    font-size: 28px;
    margin-bottom: 10px;
    align-self: flex-start;
  }

  .resham-lightbox-counter {
    position: static;
    transform: none;
    margin-top: 10px;
  }

  /* Checkout button responsive */
  .resham-checkout-button {
    margin-left: 8px !important;
    padding: 10px 20px !important;
    font-size: 13px !important;
  }

  /* Stack buttons on very small screens */
  @media (max-width: 480px) {
    .resham-cart-buttons {
      display: flex !important;
      flex-wrap: wrap !important;
      gap: 8px !important;
    }

    .resham-checkout-button,
    .single_add_to_cart_button {
      flex: 1 !important;
      min-width: 120px !important;
      margin: 0 !important;
    }
  }
}
