/* Mandyju Single Product Modern Redesign
 * Enhanced styling for product pages with modern variation buttons
 * Designed to work with the redesigned single-product.html template
 */

/* ===== PRODUCT HERO SECTION ===== */
.mandyju-single-product-modern {
  --product-card-shadow: 0 10px 40px -12px rgba(0, 0, 0, 0.12);
  --product-card-shadow-hover: 0 20px 50px -12px rgba(0, 0, 0, 0.18);
  --variation-button-size: 42px;
  --variation-button-border: 2px;
  
  /* Force center everything */
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Reset any potential interfering margins/padding */
.mandyju-single-product-modern * {
  box-sizing: border-box;
}

/* Ensure hero takes full width without causing horizontal overflow */
.mandyju-product-hero {
  position: relative;
  left: auto;
  transform: none;
  width: 100%;
  max-width: none;
}

/* FORCE CENTER ALIGNMENT - High Specificity */
body.single-product .mandyju-product-hero,
.mandyju-single-product-modern .mandyju-product-hero {
  text-align: initial !important;
}

body.single-product .mandyju-product-hero .wp-block-group,
.mandyju-single-product-modern .mandyju-product-hero .wp-block-group {
  margin-left: auto !important;
  margin-right: auto !important;
  max-width: 1200px !important;
}

body.single-product .mandyju-centered-container,
.mandyju-single-product-modern .mandyju-centered-container {
  max-width: 1200px !important;
  margin: 0 auto !important;
  display: block !important;
  text-align: center !important;
}

body.single-product .mandyju-product-main-columns,
.mandyju-single-product-modern .mandyju-product-main-columns {
  max-width: 1200px !important;
  width: 100% !important;
  margin: 0 auto !important;
  display: flex !important;
  justify-content: center !important;
  align-items: flex-start !important;
  gap: 4rem !important;
  text-align: left !important;
}

/* Force all block elements to center */
body.single-product .mandyju-product-hero .alignwide,
.mandyju-single-product-modern .mandyju-product-hero .alignwide {
  max-width: 1200px !important;
  margin: 0 auto !important;
  display: block !important;
}

/* Override any potential theme constraints */
body.single-product .wp-site-blocks .mandyju-product-hero,
.wp-site-blocks .mandyju-single-product-modern .mandyju-product-hero {
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Enhanced gallery styling */
.mandyju-enhanced-gallery {
  position: sticky;
  top: 2rem;
  box-shadow: var(--product-card-shadow);
  transition: box-shadow 0.3s ease;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

/* Override WordPress layout constraints to force centering */
.mandyju-single-product-modern .is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
  max-width: 1200px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.mandyju-single-product-modern .wp-container-core-group-is-layout-1 {
  justify-content: center !important;
}

/* ULTIMATE CENTERING - Maximum Specificity */
html body.single-product .mandyju-single-product-modern,
html body .mandyju-single-product-modern {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  width: 100% !important;
}

html body.single-product .mandyju-single-product-modern > .wp-block-group,
html body .mandyju-single-product-modern > .wp-block-group {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  width: 100% !important;
  max-width: 1400px !important;
  margin: 0 auto !important;
}

/* Force center the entire product hero section */
html body .mandyju-product-hero.alignfull {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
}

/* Center all content within the hero */
html body .mandyju-product-hero .wp-block-group.alignwide {
  margin: 0 auto !important;
  max-width: 1200px !important;
  width: 100% !important;
}

.mandyju-enhanced-gallery:hover {
  box-shadow: var(--product-card-shadow-hover);
}

/* Product summary card with enhanced styling */
.mandyju-product-summary-card {
  box-shadow: var(--product-card-shadow);
  border: 1px solid var(--wp--preset--color--border-subtle);
  transition: all 0.3s ease;
  position: relative;
  width: 100%;
  max-width: 100%;
  text-align: left;
  margin: 0 auto;
}

/* Center the product details content */
.mandyju-product-details-column {
  display: flex !important;
  justify-content: center !important;
  align-items: flex-start !important;
}

.mandyju-product-gallery-column {
  display: flex !important;
  justify-content: center !important;
  align-items: flex-start !important;
}

/* Target specific WordPress generated classes for centering */
.wp-container-core-group-is-layout-96fb51ff,
.wp-block-group.alignfull.mandyju-product-hero {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center !important;
}

.wp-container-core-group-is-layout-96fb51ff > .wp-block-group,
.mandyju-product-hero > .wp-block-group {
  margin: 0 auto !important;
  max-width: 1200px !important;
  width: 100% !important;
}

/* Force center alignment for all product content */
.mandyju-single-product-modern .wp-block-columns {
  justify-content: center !important;
  align-items: flex-start !important;
  margin: 0 auto !important;
  max-width: 1200px !important;
}

.mandyju-single-product-modern .wp-block-column {
  display: flex !important;
  justify-content: center !important;
}

.mandyju-product-summary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, 
    var(--wp--preset--color--primary) 0%, 
    var(--wp--preset--color--primary-alt) 100%);
  border-radius: 16px 16px 0 0;
}

/* Enhanced product title */
.mandyju-product-title {
  margin-bottom: 0.75rem !important;
}

/* Enhanced rating display */
.mandyju-enhanced-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mandyju-enhanced-rating .star-rating {
  font-size: 16px;
}

/* Enhanced price styling */
.mandyju-enhanced-price {
  position: relative;
  margin-bottom: 1.5rem !important;
}

.mandyju-enhanced-price .price {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.mandyju-enhanced-price .price del {
  color: var(--wp--preset--color--text-muted);
  font-weight: 500;
  font-size: 0.8em;
}

/* ===== ENHANCED VARIATION BUTTONS ===== */
.mandyju-enhanced-cart-form .variations_form {
  margin-bottom: 2rem;
}

.mandyju-enhanced-cart-form .variations {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 1.5rem;
}

.mandyju-enhanced-cart-form .variations td,
.mandyju-enhanced-cart-form .variations th {
  padding: 0.75rem 0;
  border: 0;
  vertical-align: top;
}

.mandyju-enhanced-cart-form .variations .label {
  font-weight: 600;
  font-size: 14px;
  color: var(--wp--preset--color--text-base);
  padding-right: 1rem;
}

/* Color variation buttons */
.mandyju-enhanced-cart-form .variations .value {
  position: relative;
}

.mandyju-enhanced-cart-form .variations .value select {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 2px solid var(--wp--preset--color--border-subtle);
  border-radius: 12px;
  background: var(--wp--preset--color--white);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

.mandyju-enhanced-cart-form .variations .value select:focus {
  outline: none;
  border-color: var(--wp--preset--color--primary);
  box-shadow: 0 0 0 3px rgba(193, 154, 91, 0.15);
}

/* Custom variation buttons for swatches */
.mandyju-variation-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
  justify-content: flex-start;
  align-items: center;
}

.mandyju-variation-swatch {
  width: var(--variation-button-size);
  height: var(--variation-button-size);
  border: var(--variation-button-border) solid var(--wp--preset--color--border-subtle);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  background: var(--wp--preset--color--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--wp--preset--color--text-base);
}

.mandyju-variation-swatch:hover {
  border-color: var(--wp--preset--color--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mandyju-variation-swatch.selected {
  border-color: var(--wp--preset--color--primary);
  background: var(--wp--preset--color--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(193, 154, 91, 0.4);
}

.mandyju-variation-swatch.color-swatch {
  border-radius: 50%;
  overflow: hidden;
}

.mandyju-variation-swatch.size-swatch {
  min-width: var(--variation-button-size);
  width: auto;
  padding: 0 0.75rem;
}

/* Selected variation display */
.mandyju-enhanced-cart-form .single_variation {
  padding: 1rem;
  background: var(--wp--preset--color--background-base);
  border-radius: 12px;
  border: 1px solid var(--wp--preset--color--border-subtle);
  margin-bottom: 1.5rem;
}

.mandyju-enhanced-cart-form .single_variation .price {
  font-size: 1.25em !important;
  font-weight: 800 !important;
  color: var(--wp--preset--color--primary) !important;
  margin-bottom: 0.5rem;
}

.mandyju-enhanced-cart-form .single_variation .woocommerce-variation-description {
  color: var(--wp--preset--color--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

/* Quantity and Add to Cart styling */
.mandyju-enhanced-cart-form .cart {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: stretch;
}

.mandyju-enhanced-cart-form .quantity {
  flex: 0 0 auto;
}

.mandyju-enhanced-cart-form .quantity .qty {
  width: 80px;
  padding: 1rem;
  border: 2px solid var(--wp--preset--color--border-subtle);
  border-radius: 12px;
  background: var(--wp--preset--color--white);
  text-align: center;
  font-weight: 600;
  transition: all 0.2s ease;
}

.mandyju-enhanced-cart-form .quantity .qty:focus {
  outline: none;
  border-color: var(--wp--preset--color--primary);
  box-shadow: 0 0 0 3px rgba(193, 154, 91, 0.15);
}

.mandyju-enhanced-cart-form .single_add_to_cart_button {
  flex: 1 1 auto;
  min-width: 200px;
  padding: 1rem 2rem;
  border: none;
  border-radius: 12px;
  background: var(--wp--preset--color--primary);
  color: white;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.mandyju-enhanced-cart-form .single_add_to_cart_button:hover {
  background: var(--wp--preset--color--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(193, 154, 91, 0.3);
}

.mandyju-enhanced-cart-form .single_add_to_cart_button:active {
  transform: translateY(0);
}

/* Enhanced product meta */
.mandyju-product-meta-enhanced {
  background: var(--wp--preset--color--background-base);
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--wp--preset--color--border-subtle);
}

.mandyju-product-meta-enhanced .wp-block-group {
  padding: 0.25rem 0;
}

/* Enhanced social sharing */
.mandyju-product-share-enhanced .wp-social-link {
  background: var(--wp--preset--color--background-base) !important;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.mandyju-product-share-enhanced .wp-social-link:hover {
  background: var(--wp--preset--color--primary) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mandyju-product-share-enhanced .wp-social-link a {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

/* ===== ENHANCED TABS SECTION ===== */
.mandyju-enhanced-tabs {
  box-shadow: var(--product-card-shadow);
  transition: box-shadow 0.3s ease;
}

.mandyju-enhanced-tabs:hover {
  box-shadow: var(--product-card-shadow-hover);
}

.mandyju-enhanced-tabs .woocommerce-tabs .wc-tabs,
.mandyju-enhanced-tabs .wc-tabs {
  display: flex;
  gap: 2rem;
  border-bottom: 2px solid var(--wp--preset--color--border-subtle);
  margin-bottom: 2rem;
  padding-bottom: 0;
}

.mandyju-enhanced-tabs .woocommerce-tabs .wc-tabs li a,
.mandyju-enhanced-tabs .wc-tabs li a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0;
  text-decoration: none;
  color: var(--wp--preset--color--text-muted);
  font-weight: 600;
  font-size: 16px;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
}

.mandyju-enhanced-tabs .woocommerce-tabs .wc-tabs li.active a,
.mandyju-enhanced-tabs .wc-tabs li a:hover {
  color: var(--wp--preset--color--primary);
  border-bottom-color: var(--wp--preset--color--primary);
}

.mandyju-enhanced-tabs .woocommerce-Tabs-panel {
  padding: 1rem 0;
  line-height: 1.7;
}

/* ===== RELATED PRODUCTS SECTION ===== */
.mandyju-related-grid {
  gap: 2rem;
}

.mandyju-enhanced-product-card {
  box-shadow: var(--product-card-shadow);
  transition: all 0.3s ease;
  overflow: hidden;
}

.mandyju-enhanced-product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--product-card-shadow-hover);
  border-color: var(--wp--preset--color--primary);
}

.mandyju-card-title a {
  color: var(--wp--preset--color--text-base);
  text-decoration: none;
  transition: color 0.2s ease;
}

.mandyju-card-title a:hover {
  color: var(--wp--preset--color--primary);
}

.mandyju-card-button .wp-block-button__link,
.mandyju-card-button a {
  background: var(--wp--preset--color--primary) !important;
  color: white !important;
  border: none;
  transition: all 0.2s ease;
  font-weight: 700;
}

.mandyju-card-button .wp-block-button__link:hover,
.mandyju-card-button a:hover {
  background: var(--wp--preset--color--primary-hover) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(193, 154, 91, 0.3);
}

/* CTA Button enhancement */
.mandyju-cta-button .wp-block-button__link {
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.mandyju-cta-button .wp-block-button__link:hover {
  background: var(--wp--preset--color--primary-hover) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(193, 154, 91, 0.3);
}

.mandyju-cta-button .wp-block-button__link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.mandyju-cta-button .wp-block-button__link:hover::before {
  left: 100%;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
  .mandyju-enhanced-gallery {
    position: relative;
    top: auto;
  }
  
  .mandyju-product-main-columns {
    flex-direction: column;
    align-items: center;
    gap: 2rem;
  }
  
  .mandyju-product-gallery-column,
  .mandyju-product-details-column {
    flex-basis: 100% !important;
    width: 100%;
    max-width: 600px;
    display: flex;
    justify-content: center;
  }
  
  .mandyju-product-gallery-column .mandyju-enhanced-gallery,
  .mandyju-product-details-column .mandyju-product-summary-card {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .mandyju-product-hero .alignwide {
    padding: 0 1rem;
  }
  
  .mandyju-product-main-columns {
    gap: 1.5rem;
    padding: 0;
  }
  
  .mandyju-product-gallery-column,
  .mandyju-product-details-column {
    max-width: 100%;
  }
  
  .mandyju-enhanced-cart-form .cart {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
  
  .mandyju-enhanced-cart-form .quantity {
    align-self: center;
    width: 120px;
  }
  
  .mandyju-enhanced-cart-form .single_add_to_cart_button {
    min-width: auto;
    width: 100%;
    max-width: 300px;
  }
  
  .mandyju-related-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }
  
  .mandyju-enhanced-tabs .woocommerce-tabs .wc-tabs,
  .mandyju-enhanced-tabs .wc-tabs {
    flex-direction: column;
    gap: 1rem;
  }
  
  :root {
    --variation-button-size: 38px;
  }
}

@media (max-width: 480px) {
  .mandyju-variation-swatches {
    gap: 0.25rem;
  }
  
  .mandyju-variation-swatch.size-swatch {
    padding: 0 0.5rem;
  }
  
  .mandyju-product-summary-card,
  .mandyju-enhanced-gallery,
  .mandyju-enhanced-tabs {
    margin-left: -1rem;
    margin-right: -1rem;
    border-radius: 12px 12px 0 0;
  }
}