/* Modern Swatch Styling - Clean and User-Friendly */
.wap-swatches {
  --label-font-size: 16px;
  --label-font-weight: 600;
  --label-color: #2c3e50;
  --label-margin-bottom: 12px;
  --dropdown-width: 100%;
  --dropdown-height: 48px;
  --dropdown-font-size: 15px;
  --dropdown-border-radius: 8px;
  --dropdown-border-color: #e1e8ed;
  --dropdown-bg-color: #fff;
  --button-size: auto;
  --button-font-size: 14px;
  --button-font-weight: 500;
  --button-border-radius: 8px;
  --button-spacing: 12px;
  --button-padding: 12px 20px;
  --image-size: 60px;
  --image-border-radius: 8px;
  --color-size: 50px;
  --color-border-radius: 50px;
  --selected-border-color: #007cba;
  --selected-border-width: 2px;
  --hover-scale: 1.02;
  --transition-duration: 0.1s;
  margin: 20px 0;
  padding: 0;
  background: transparent;
  border: none;
}

/* Remove stray paragraph gaps between price and swatches for some themes */
.summary .price + p:empty{display:none!important}
.summary .custom-price-wrapper + p:empty{display:none!important}

/* Attribute container - clean spacing */
.wap-attr {
  margin-bottom: 24px;
  padding: 0;
  background: transparent;
  border: none;
}

/* Label styling - prominent and clear */
.wap-attr-label {
  font-size: var(--label-font-size);
  font-weight: var(--label-font-weight);
  color: var(--label-color);
  margin: 0 0 var(--label-margin-bottom) 0;
  line-height: 1.3;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Terms container - flexible layout */
.wap-terms {
  display: flex;
  gap: var(--button-spacing);
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start; /* Ensure left alignment */
  align-content: flex-start; /* Align rows to start */
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

/* Dropdown: no scroll needed (single select element) */
.wap-terms:has(select.wap-select) {
  max-height: none;
  overflow: visible;
}

/* Desktop: No scroll limits - show all items naturally */

/* Custom scrollbar for swatch containers */
.wap-terms::-webkit-scrollbar {
  width: 8px;
}

.wap-terms::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.wap-terms::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
  transition: background 0.2s;
}

.wap-terms::-webkit-scrollbar-thumb:hover {
  background: #007cba;
}

/* Firefox scrollbar styling */
.wap-terms {
  scrollbar-width: thin;
  scrollbar-color: #c1c1c1 #f1f1f1;
}

/* Clean flat design - no borders, bars, or gradients */

/* Button styling - modern and spacious */
.wap-swatch {
  min-width: auto;
  width: var(--button-size);
  height: auto;
  min-height: 48px;
  font-size: var(--button-font-size);
  font-weight: var(--button-font-weight);
  border-radius: var(--button-border-radius);
  padding: var(--button-padding);
  border: 2px solid #e1e8ed;
  background: #fff;
  cursor: pointer;
  transition: all var(--transition-duration) ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.2;
  color: #2c3e50;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  position: relative;
  overflow: hidden;
}

.wap-swatch:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-color: #007cba;
}

.wap-swatch.is-selected {
  border-color: var(--selected-border-color);
  background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,124,186,0.3);
  transform: translateY(-2px);
}

.wap-swatch.is-unavailable {
  opacity: 0.4;
  cursor: not-allowed;
  background: #f8f9fa;
  color: #6c757d;
}

/* Image swatch wrapper - allows label below */
.wap-swatch-wrapper {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

/* Image swatch label - shown below image */
.wap-swatch-label {
  font-size: 12px;
  font-weight: 500;
  color: #2c3e50;
  line-height: 1.2;
  max-width: var(--image-size);
  word-wrap: break-word;
  text-align: center;
  transition: color var(--transition-duration) ease;
}

.wap-swatch-wrapper:has(.wap-swatch.is-selected) .wap-swatch-label {
  color: #007cba;
  font-weight: 600;
}

/* Image swatch styling - prominent and clear */
.wap-swatch.is-image {
  width: var(--image-size);
  height: var(--image-size);
  min-width: var(--image-size);
  min-height: var(--image-size);
  border-radius: var(--image-border-radius);
  background-size: cover;
  background-position: center;
  padding: 0;
  border: 3px solid #e1e8ed;
  position: relative;
}

.wap-swatch.is-image:hover {
  border-color: #007cba;
  transform: scale(1.05);
}

.wap-swatch.is-image.is-selected {
  border-color: #87CEEB;
  border-width: 3px;
  box-shadow: 0 4px 12px rgba(135,206,235,0.3);
}

/* Color swatch styling - circular and prominent */
.wap-swatch[style*="background-color"] {
  width: var(--color-size);
  height: var(--color-size);
  min-width: var(--color-size);
  min-height: var(--color-size);
  border-radius: var(--color-border-radius);
  padding: 0;
  border: 3px solid #e1e8ed;
  position: relative;
  overflow: hidden;
}

.wap-swatch[style*="background-color"]:hover {
  border-color: #007cba;
  transform: scale(1.1);
}

.wap-swatch[style*="background-color"].is-selected {
  border-color: var(--selected-border-color);
  border-width: 3px;
  box-shadow: 0 4px 12px rgba(0,124,186,0.3);
}

.wap-swatch[style*="background-color"]::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-weight: bold;
  font-size: 16px;
  opacity: 0;
  transition: opacity var(--transition-duration) ease;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.wap-swatch[style*="background-color"].is-selected::after {
  opacity: 1;
}

/* Dropdown styling - full width and modern */
.wap-terms select.wap-select {
  width: var(--dropdown-width);
  height: var(--dropdown-height);
  font-size: var(--dropdown-font-size);
  border-radius: var(--dropdown-border-radius);
  border: 2px solid var(--dropdown-border-color);
  background-color: var(--dropdown-bg-color);
  padding: 0 16px;
  line-height: 1.4;
  color: #2c3e50;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: all var(--transition-duration) ease;
}

.wap-terms select.wap-select:focus {
  outline: none;
  border-color: #007cba;
  box-shadow: 0 0 0 3px rgba(0,124,186,0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  /* Clean, flat design - no borders or containers */
  .wap-terms {
    gap: 8px;
    margin: 0 !important;
    padding: 0 !important; /* Reset all desktop scroll padding for consistent alignment */
  }
  
  /* Mobile: Subtle scroll indicators */
  .wap-terms::-webkit-scrollbar {
    width: 4px;
  }
  
  .wap-terms::-webkit-scrollbar-thumb {
    background: rgba(0, 124, 186, 0.4);
    border-radius: 2px;
  }
  
  /* Reduce max-height for swatches on mobile - enable scroll */
  .wap-terms:has(.wap-swatch:not(.is-image):not(.is-color):nth-child(8)) {
    max-height: calc((40px + var(--button-spacing)) * 3);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 !important;
  }
  
  .wap-attr:has(.wap-swatch.is-color) .wap-terms:has(.wap-swatch:nth-child(6)) {
    max-height: calc(var(--color-size) * 2 + var(--button-spacing) * 3 + 60px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 !important;
  }
  
  .wap-attr:has(.wap-swatch.is-image) .wap-terms:has(.wap-swatch-wrapper:nth-child(5)) {
    max-height: calc(var(--image-size) * 2 + var(--button-spacing) * 3 + 80px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 !important;
  }
  
  
  .wap-swatch {
    padding: 10px 16px;
    font-size: 13px;
  }
  
  .wap-swatch.is-image {
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
  }
  
  .wap-swatch-label {
    font-size: 11px;
    max-width: 50px;
  }
  
  .wap-swatch[style*="background-color"] {
    width: 45px;
    height: 45px;
    min-width: 45px;
    min-height: 45px;
  }
}

/* Ensure Astra/other themes spacing around quantity/add-to-cart is preserved */
.variations_form .wap-swatches{clear:both}

/* Replace native variations UI entirely with our swatches */
.variations_form .variations{display:none!important}
.variations_form .reset_variations{display:none!important}


