/** Shopify CDN: Minification failed

Line 1473:17 Unexpected "{"
Line 1473:24 Expected ":"
Line 1473:31 Unexpected "{"
Line 1474:22 Expected identifier but found whitespace
Line 1474:24 Expected identifier but found "%"
Line 1474:73 Unexpected "{"
Line 1474:74 Unexpected "{"
Line 1474:81 Expected ":"
Line 1474:111 Unexpected "{"
Line 1474:112 Expected identifier but found "%"
... and 72 more hidden warnings

**/
/* Product Bundle Builder Styles - Complete Version with Enhanced Metafield Styling */

/* Main Container */
.product-bundle-builder {
  --bundle-spacing: 30px;
  --bundle-item-gap: 15px;
  display: block;
  width: 100%;
}

.bundle-builder-container {
  background: var(--bundle-background, var(--body_alternate_background));
  border-radius: var(--bundle-radius, var(--card_radius));
  padding: var(--bundle-padding, 30px);
  border: 1px solid var(--bundle-border, transparent);
  /* Fix: Allow content to overflow */
  overflow: visible;
}

/* Header Section */
.bundle-header {
  text-align: center;
  margin-bottom: var(--bundle-spacing);
}

.bundle-title {
  color: var(--heading_color);
  margin-bottom: 8px;
}

.bundle-description {
  color: var(--text_color);
  opacity: 0.8;
}

/* Content Layout */
.bundle-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--bundle-spacing);
  /* Fix: Allow overflow */
  overflow: visible;
  /* Fix: Create proper stacking context */
  position: relative;
  z-index: 1;
}

/* Desktop Layout */
@media (min-width: 1025px) {
  .bundle-content {
    grid-template-columns: 1fr 380px;
    gap: 40px;
  }
  
  .bundle-summary {
    position: sticky;
    top: var(--sticky-top, 20px);
    height: fit-content;
    /* Fix: Lower z-index for summary to stay below dropdowns */
    z-index: 1;
  }
  
  /* Fix: Ensure steps column has higher z-index than summary */
  .bundle-steps {
    z-index: 10;
    position: relative;
  }
}

/* Steps Section */
.bundle-steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
  /* Fix: Allow overflow for dropdowns */
  overflow: visible !important;
  position: relative;
  /* Fix: Higher base z-index for steps container */
  z-index: 10;
}

.bundle-step {
  padding: 20px;
  background: var(--step-background, var(--card_background));
  border-radius: var(--step-radius, 12px);
  border: 1px solid var(--step-border, var(--border_color));
  transition: all 0.3s ease;
  /* Fix: Ensure step can show dropdown */
  position: relative;
  overflow: visible !important;
  z-index: 1;
}

/* Fix: Higher z-index for steps with open dropdowns */
.bundle-step:has(.bundle-selector-trigger[aria-expanded="true"]) {
  z-index: 1000 !important;
}

.bundle-step:hover {
  border-color: var(--text_color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.bundle-step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.bundle-step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--text_color);
  color: var(--body_background);
  border-radius: 50%;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.bundle-step-title {
  font-size: var(--h6);
  color: var(--heading_color);
  margin: 0;
  flex-grow: 1;
  min-width: 0;
}

.required-badge {
  background: var(--sale_bg_color);
  color: var(--sale_text_color);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 600;
  flex-shrink: 0;
}

/* Empty state fallback */
.required-badge:empty::after {
  content: "Required";
}

/* Dropdown Selector */
.bundle-selector {
  position: relative;
  /* Fix: Ensure dropdown can overflow and appear above other content */
  z-index: 1;
}

/* Fix: Active selector gets higher z-index */
.bundle-selector:has(.bundle-selector-trigger[aria-expanded="true"]) {
  z-index: 2000 !important;
}

.bundle-selector-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--form_background);
  border: 1px solid var(--form_border);
  border-radius: var(--form_radius);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: var(--form-height, 52px);
  font-family: inherit;
  font-size: inherit;
}

.bundle-selector-trigger:hover {
  border-color: var(--text_color);
}

.bundle-selector-trigger[aria-expanded="true"] {
  border-color: var(--text_color);
  box-shadow: 0 0 0 1px var(--text_color);
}

.selected-text {
  color: var(--form_text);
  font-size: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-arrow {
  width: 12px;
  height: 12px;
  transform: rotate(0deg);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.bundle-selector-trigger[aria-expanded="true"] .dropdown-arrow {
  transform: rotate(180deg);
}

/* Dropdown Content - FIXED */
.bundle-selector-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--form_background);
  border: 1px solid var(--form_border);
  border-radius: var(--form_radius);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  /* Fix: Maximum z-index to ensure it's above everything */
  z-index: 999999 !important;
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  /* Fix: Ensure dropdown width */
  min-width: 100%;
  width: max-content;
  max-width: 500px;
}

/* Fix: Ensure open dropdowns are absolutely above everything */
.bundle-selector-trigger[aria-expanded="true"] + .bundle-selector-dropdown {
  z-index: 9999999 !important;
}

/* Fix: When dropdown is appended to body */
.bundle-selector-dropdown[data-appended="true"] {
  z-index: 9999999 !important;
}

.bundle-selector-dropdown[hidden] {
  display: none;
}

.dropdown-list {
  padding: 8px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  transition: background 0.2s ease;
  cursor: pointer;
  /* Fix: Ensure proper width */
  min-width: 0;
}

.dropdown-item:not(:last-child) {
  border-bottom: 1px solid rgba(var(--color-base-text), 0.08);
}

.dropdown-item:hover {
  background: var(--body_alternate_background);
}

.dropdown-item input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.dropdown-item-content {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  width: 100%;
  min-width: 0;
}

.dropdown-item:has(.dropdown-item-image) .dropdown-item-content {
  min-height: 3rem;
}

.dropdown-item-image {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--image_bg);
  flex-shrink: 0;
}

.dropdown-item-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}

.dropdown-item-title {
  font-size: 0.9375rem;
  color: var(--text_color);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-item:has(.dropdown-item-metafield) .dropdown-item-title {
  font-size: 0.9375rem;
}

.dropdown-item-variant {
  font-size: var(--small_text);
  color: var(--text_color);
  opacity: 0.7;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Enhanced Metafield Styling */
.dropdown-item-metafield {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text_color);
  opacity: 0.7;
  margin-top: 0.375rem;
  line-height: 1.4;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.dropdown-item-metafield[data-format="list"] {
  display: block;
  margin-top: 0.375rem;
}

.metafield-label {
  font-weight: 500;
  opacity: 0.85;
}

.metafield-value {
  flex: 1;
}

/* Metafield ingredients/tags styling */
.metafield-ingredients {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.metafield-ingredients span {
  position: relative;
}

.metafield-ingredients span:not(:last-child)::after {
  content: "·";
  margin-left: 0.25rem;
  opacity: 0.5;
}

/* Alternative tag-style display for metafields */
.dropdown-item-metafield-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.25rem;
}

.dropdown-item-metafield-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  background: var(--body_alternate_background);
  border: 1px solid var(--border_color);
  border-radius: 0.875rem;
  font-size: 0.75rem;
  color: var(--text_color);
  opacity: 0.85;
  white-space: nowrap;
}

.dropdown-item-price {
  font-size: 1rem;
  color: var(--text_color);
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
  align-self: center;
}

/* Checkbox/Radio Styling */
.bundle-checkbox,
.bundle-radio {
  width: 20px;
  height: 20px;
  border: 2px solid var(--form_border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.bundle-radio {
  border-radius: 50%;
}

.dropdown-item input:checked ~ .dropdown-item-content .bundle-checkbox,
.dropdown-item input:checked ~ .dropdown-item-content .bundle-radio {
  background: var(--text_color);
  border-color: var(--text_color);
}

.dropdown-item input:checked ~ .dropdown-item-content .bundle-checkbox::after,
.dropdown-item input:checked ~ .dropdown-item-content .bundle-radio::after {
  content: "✓";
  color: var(--body_background);
  font-size: 12px;
  font-weight: bold;
}

.dropdown-item input:checked ~ .dropdown-item-content .dropdown-item-title {
  font-weight: 500;
}

/* Selected Items Display */
.selected-items-container {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 20px;
}

.selected-item {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--body_alternate_background);
  border: 1px solid var(--border_color);
  border-radius: 1.25rem;
  font-size: 0.875rem;
}

.selected-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.selected-item-title {
  font-weight: 500;
  color: var(--text_color);
}

.selected-item-metafield {
  font-size: 0.75rem;
  color: var(--text_color);
  opacity: 0.7;
  line-height: 1.3;
}

.selected-item button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text_color);
  opacity: 0.6;
  transition: opacity 0.2s ease;
  width: 16px;
  height: 16px;
}

.selected-item button:hover {
  opacity: 1;
}

/* Bundle Summary - FIXED FOR MOBILE */
.bundle-summary {
  background: var(--summary-background, var(--body_background));
  border: 1px solid var(--summary-border, var(--border_color));
  border-radius: var(--summary-radius, var(--card_radius));
  padding: 24px;
  /* Fix: Lower z-index to stay below dropdowns */
  position: relative;
  z-index: 1;
}

/* Fix: Mobile-specific summary positioning */
@media (max-width: 1024px) {
  .bundle-summary {
    /* Fix: Ensure summary doesn't create stacking context issues on mobile */
    position: static !important;
    z-index: auto !important;
    transform: none !important;
  }
  
  /* Fix: Steps should be above summary on mobile */
  .bundle-steps {
    position: relative;
    z-index: 100 !important;
  }
  
  /* Fix: Active step gets even higher priority */
  .bundle-step:has(.bundle-selector-trigger[aria-expanded="true"]) {
    z-index: 10000 !important;
  }
}

.summary-title {
  font-size: var(--h5);
  color: var(--heading_color);
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border_color);
}

.summary-placeholder {
  text-align: center;
  padding: 40px 20px;
  color: var(--text_color);
  opacity: 0.6;
}

/* Summary Items */
.summary-items {
  margin-bottom: 20px;
}

.summary-item {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border_color);
}

.summary-item:last-child {
  border-bottom: none;
}

.summary-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--image_bg);
}

.summary-item-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.summary-item-title {
  font-size: var(--text);
  color: var(--text_color);
  font-weight: 500;
}

.summary-item-metafield {
  font-size: 0.8125rem;
  color: var(--text_color);
  opacity: 0.7;
  margin-top: 0.25rem;
  line-height: 1.4;
}

.summary-item-price {
  font-size: var(--small_text);
  color: var(--text_color);
  opacity: 0.8;
}

/* Summary Pricing */
.summary-pricing {
  padding-top: 16px;
  border-top: 1px solid var(--border_color);
}

.pricing-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: var(--text);
}

.pricing-row.discount {
  color: var(--discount_text, var(--sale_text_color));
}

.pricing-row.total {
  font-size: var(--h6);
  font-weight: 600;
  color: var(--heading_color);
  padding-top: 12px;
  margin-top: 8px;
  border-top: 1px solid var(--border_color);
}

/* Add to Cart Button */
.bundle-add-to-cart {
  margin-top: 24px;
}

.bundle-add-to-cart .button {
  width: 100%;
  justify-content: center;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Error Message */
.bundle-error {
  margin-top: 12px;
  padding: 12px;
  background: rgba(255, 0, 0, 0.05);
  color: var(--color_error_text);
  border-radius: 8px;
  font-size: var(--small_text);
  text-align: center;
}

.bundle-error[hidden] {
  display: none;
}

/* Loading State */
.btn-loader {
  display: none !important;
  width: 20px;
  height: 20px;
  margin: 0 auto;
}

.btn-loader:not(.hidden) {
  display: inline-block !important;
}

.loading [data-atc-text] {
  display: none;
}

/* Fix: Modal/Popup specific styles */
.modal-content,
.popup-content,
[role="dialog"],
.modal-body,
.popup-body,
.modal__inner,
.popup__inner {
  overflow: visible !important;
}

.modal-content .bundle-builder-container,
.popup-content .bundle-builder-container,
[role="dialog"] .bundle-builder-container {
  overflow: visible !important;
}

.modal-content .bundle-steps,
.popup-content .bundle-steps,
[role="dialog"] .bundle-steps {
  overflow: visible !important;
}

/* Mobile Responsive - ENHANCED FIXES */
@media (max-width: 1024px) {
  .bundle-content {
    grid-template-columns: 1fr;
    /* Fix: Ensure proper stacking order on mobile */
    display: flex;
    flex-direction: column;
  }
  
  /* Fix: Steps should come first and have higher z-index */
  .bundle-steps {
    order: 1;
    position: relative;
    z-index: 100 !important;
  }
  
  .bundle-summary {
    order: 2;
    position: relative;
    top: 0;
    margin-top: var(--bundle-spacing);
    /* Fix: Remove sticky and transform to prevent stacking context issues */
    transform: none !important;
    z-index: 1 !important;
  }
  
  /* Fix: Mobile dropdown positioning */
  .bundle-selector-dropdown {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    /* Fix: Ensure dropdown is above everything on mobile */
    z-index: 999999 !important;
  }
  
  /* Fix: Prevent horizontal scroll on mobile */
  .bundle-selector {
    max-width: 100%;
  }
  
  /* Fix: Adjust dropdown content for mobile */
  .dropdown-item-content {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 767px) {
  .bundle-builder-container {
    padding: var(--bundle-padding-mobile, 20px);
  }
  
  .bundle-step {
    padding: 16px;
  }
  
  .bundle-step-header {
    flex-wrap: wrap;
  }
  
  .dropdown-item-content {
    gap: 10px;
  }
  
  .dropdown-item-image {
    width: 40px;
    height: 40px;
  }
  
  .dropdown-item-metafield {
    font-size: 0.75rem;
  }
  
  .dropdown-item-metafield-tag {
    font-size: 0.6875rem;
    padding: 0.0625rem 0.375rem;
  }
  
  .selected-item-metafield,
  .summary-item-metafield {
    font-size: 0.6875rem;
  }
  
  .summary-item {
    grid-template-columns: 48px 1fr;
  }
  
  .summary-item img {
    width: 48px;
    height: 48px;
  }
  
  /* Fix: Mobile dropdown specific styles - ENHANCED */
  .bundle-selector-dropdown {
    /* Use fixed positioning on mobile to escape any container constraints */
    position: fixed !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    max-width: calc(100vw - 20px) !important;
    max-height: 50vh !important;
    /* Fix: Maximum z-index to ensure visibility */
    z-index: 2147483647 !important; /* Maximum 32-bit integer */
  }
  
  /* Fix: Ensure body doesn't have transform that creates stacking context */
  body:has(.bundle-selector-trigger[aria-expanded="true"]) {
    transform: none !important;
  }
  
  /* Fix: Adjust item layout for mobile */
  .dropdown-item {
    padding: 10px;
  }
  
  .dropdown-item-title {
    font-size: 14px;
  }
  
  .dropdown-item-variant {
    font-size: 12px;
  }
  
  .dropdown-item-price {
    font-size: 14px;
  }
}

/* Fix: Global stacking context fixes */
.bundle-selector-trigger[aria-expanded="true"] {
  position: relative;
  z-index: 10001 !important;
}

/* Fix: Ensure no parent containers create problematic stacking contexts */
.product-bundle-builder,
.product-bundle-builder * {
  transform-style: flat !important;
}

/* Fix: When dropdown is open, ensure it's not clipped */
.bundle-selector:has(.bundle-selector-trigger[aria-expanded="true"]) {
  overflow: visible !important;
  clip: auto !important;
  clip-path: none !important;
}

/* Animations */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bundle-selector-dropdown {
  animation: slideDown 0.3s ease-out;
}

/* Custom scrollbar */
.bundle-selector-dropdown::-webkit-scrollbar,
.bundle-summary::-webkit-scrollbar {
  width: 6px;
}

.bundle-selector-dropdown::-webkit-scrollbar-track,
.bundle-summary::-webkit-scrollbar-track {
  background: var(--body_alternate_background);
  border-radius: 3px;
}

.bundle-selector-dropdown::-webkit-scrollbar-thumb,
.bundle-summary::-webkit-scrollbar-thumb {
  background: var(--border_color);
  border-radius: 3px;
}

.bundle-selector-dropdown::-webkit-scrollbar-thumb:hover,
.bundle-summary::-webkit-scrollbar-thumb:hover {
  background: var(--text_color);
}

/* Accessibility */
.bundle-selector-trigger:focus,
.bundle-add-to-cart .button:focus,
.selected-item button:focus {
  outline: 2px solid var(--text_color);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .bundle-step,
  .bundle-summary {
    border-width: 2px;
  }
  
  .required-badge {
    font-weight: 700;
  }
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
  .dropdown-item-metafield,
  .selected-item-metafield,
  .summary-item-metafield {
    opacity: 0.8;
  }
  
  .dropdown-item-metafield-tag {
    opacity: 0.9;
  }
}

/* Discounted Price Display in Dropdown Items */
.dropdown-item-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.125rem;
  font-size: 1rem;
  color: var(--text_color);
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
  align-self: center;
}

.dropdown-item-price.has-discount {
  align-self: flex-start;
}

/* Original price with strikethrough */
.dropdown-item-original-price {
  font-size: 0.875rem;
  color: var(--text_color);
  opacity: 0.6;
  text-decoration: line-through;
  font-weight: 400;
}

/* Discounted price styling */
.dropdown-item-discounted-price {
  font-size: 1rem;
  color: var(--sale_text_color, #9e2424);
  font-weight: 600;
}

/* Discount badge (optional) */
.dropdown-item-discount-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.375rem;
  background: var(--sale_bg_color, #ffe5e5);
  color: var(--sale_text_color, #e74c3c);
  border-radius: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

/* Summary item price with discount */
.summary-item-price {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  font-size: var(--small_text);
  color: var(--text_color);
  opacity: 0.8;
}

.summary-item-price.has-discount {
  opacity: 1;
}

.summary-item-original-price {
  font-size: 0.75rem;
  color: var(--text_color);
  opacity: 0.6;
  text-decoration: line-through;
  font-weight: 400;
}

.summary-item-discounted-price {
  font-size: 0.875rem;
  color: var(--sale_text_color, #e74c3c);
  font-weight: 600;
}

/* Selected item with discount */
.selected-item-price {
  display: flex;
  gap: 0.375rem;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--text_color);
  margin-top: 0.125rem;
}

.selected-item-original-price {
  text-decoration: line-through;
  opacity: 0.6;
}

.selected-item-discounted-price {
  color: var(--sale_text_color, #e74c3c);
  font-weight: 600;
}

/* Mobile adjustments */
@media (max-width: 767px) {
  .dropdown-item-original-price {
    font-size: 0.75rem;
  }
  
  .dropdown-item-discounted-price {
    font-size: 0.875rem;
  }
  
  .dropdown-item-discount-badge {
    font-size: 0.625rem;
    padding: 0.0625rem 0.25rem;
  }
}

/* Z-index and stacking fixes */
.product-bundle-builder {
  position: relative;
  z-index: 100;
}

.bundle-builder-modal {
  z-index: 999999 !important;
}

.bundle-modal-overlay {
  z-index: 999998 !important;
}

.bundle-modal-content {
  z-index: 999999 !important;
  position: relative;
}

.bundle-selector-dropdown {
  z-index: 9999999 !important;
}

.bundle-selector:has(.bundle-selector-trigger[aria-expanded="true"]) {
  z-index: 10000 !important;
}

.bundle-steps {
  position: relative;
  z-index: 1000 !important;
}

.bundle-summary {
  position: relative;
  z-index: 1 !important;
}

.bundle-builder-modal .bundle-steps {
  z-index: 10000 !important;
}

.bundle-builder-modal .bundle-selector-dropdown {
  z-index: 9999999 !important;
}

.section-wrapper,
.section-main-product {
  transform: none !important;
  position: relative;
  z-index: auto !important;
}

@media (max-width: 1024px) {
  .bundle-steps {
    z-index: 10000 !important;
  }
  
  .bundle-summary {
    position: static !important;
    z-index: 1 !important;
    transform: none !important;
  }
  
  .bundle-selector-dropdown {
    position: fixed !important;
    z-index: 2147483647 !important;
  }
}

/* Remove transforms from parent containers */
.section-wrapper,
.section-main-product,
.product__info,
.product__media,
.product-single,
.product-template,
[data-section-type="product"],
.shopify-section {
  transform: none !important;
  transform-style: flat !important;
}

.product-bundle-builder {
  position: relative;
  z-index: 999990 !important;
}

.bundle-builder-container {
  position: relative;
  z-index: 999991 !important;
}

.bundle-selector {
  position: static;
}

.bundle-selector:has(.bundle-selector-trigger[aria-expanded="true"]) {
  position: static !important;
}

.bundle-selector-dropdown {
  position: fixed !important;
  z-index: 2147483647 !important;
}

.product-bundle-builder *,
.bundle-builder-container *,
.bundle-steps * {
  filter: none !important;
  -webkit-filter: none !important;
  mask: none !important;
  -webkit-mask: none !important;
  clip-path: none !important;
  -webkit-clip-path: none !important;
  mix-blend-mode: normal !important;
  isolation: auto !important;
}

.site-header,
.header-wrapper,
header,
[data-section-type="header"],
.announcement-bar,
.sticky-header,
.fixed-header {
  z-index: 999 !important;
}

.product-bundle-builder,
.product-bundle-builder * {
  will-change: auto !important;
}

.bundle-summary {
  position: relative !important;
  z-index: 1 !important;
  transform: none !important;
}

@media (max-width: 1024px) {
  .bundle-selector-dropdown {
    position: fixed !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    max-width: calc(100vw - 20px) !important;
    z-index: 2147483647 !important;
  }
  
  body:has(.bundle-selector-trigger[aria-expanded="true"]) {
    overflow-x: hidden;
  }
}

.product__info > *,
.product__info-wrapper > *,
.product-form > * {
  transform: none !important;
}

.modal,
.modal-content,
.popup,
.popup-content,
[role="dialog"],
.modal__inner,
.popup__inner {
  transform: none !important;
  filter: none !important;
}

.product__media-wrapper,
.product__info-container,
.product-single__media,
.product-single__info {
  transform: none !important;
  position: relative !important;
}

* {
  transform-style: flat !important;
  -webkit-transform-style: flat !important;
}

.bundle-selector-dropdown[data-appended="true"] {
  position: fixed !important;
  z-index: 2147483647 !important;
}

/* Constrain dropdown size */
.bundle-selector-dropdown {
  position: absolute !important;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--form_background, #ffffff);
  border: 1px solid var(--form_border, #e5e5e5);
  border-radius: var(--form_radius, 8px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  max-height: 320px !important;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 100%;
  width: 100% !important;
  max-width: 100% !important;
  z-index: 999999 !important;
}

.bundle-selector-dropdown[data-appended="true"] {
  position: fixed !important;
  width: auto !important;
  min-width: 200px !important;
  max-width: min(500px, 90vw) !important;
}

.bundle-selector-dropdown .dropdown-list {
  padding: 8px;
  max-height: 100%;
  overflow-y: auto;
}

.bundle-selector-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  transition: background 0.2s ease;
  cursor: pointer;
  min-width: 0;
  max-width: 100%;
}

.bundle-selector {
  position: relative;
  width: 100%;
  max-width: 100%;
}

.bundle-selector-trigger {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

@media (max-width: 1024px) {
  .bundle-selector-dropdown[data-appended="true"] {
    position: fixed !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    max-width: calc(100vw - 20px) !important;
    max-height: 50vh !important;
  }
}

.bundle-steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  z-index: 10;
}

.bundle-step {
  position: relative;
  overflow: visible !important;
  z-index: 1;
}

.bundle-step:has(.bundle-selector-trigger[aria-expanded="true"]) {
  z-index: 100 !important;
}

.dropdown-item-content {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  width: 100%;
  min-width: 0;
  flex: 1;
}

.dropdown-item-details {
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.dropdown-item-title,
.dropdown-item-variant,
.dropdown-item-metafield {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-item-price {
  flex-shrink: 0;
  margin-left: auto;
  padding-left: 1rem;
}

.bundle-selector-dropdown {
  max-height: 320px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

.bundle-selector-dropdown[data-appended="true"] {
  max-height: 320px !important;
  min-height: auto !important;
}

.dropdown-item {
  width: 100% !important;
  max-width: 100% !important;
}

.dropdown-item-content {
  width: 100% !important;
  max-width: 100% !important;
}

/* ===== MODAL STYLES WITH ADJUSTED SCALING ===== */
/* Modal styles for card overlay */
.bundle-builder-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999999;
  align-items: center;
  justify-content: center;
  /* Fix: Force GPU acceleration */
  will-change: opacity;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.bundle-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

/* Mobile Modal Content - 80% of current size (0.5 * 1.8 = 0.9) */
.bundle-modal-content {
  position: relative;
  background: var(--body_background);
  width: 81vw;  /* 90vw * 0.9 */
  max-width: 306px;  /* 340px * 0.9 */
  height: auto;
  max-height: 81vh;  /* 90vh * 0.9 */
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 9px;  /* 10px * 0.9 */
  padding: 10.8px;  /* 12px * 0.9 */
  padding-top: 54px;  /* 60px * 0.9 */
  box-shadow: 0 9px 27px rgba(0, 0, 0, 0.3);
  margin: 0 auto;
  margin-top: calc(var(--header_height, 60px) + 9px);
  box-sizing: border-box;
  /* Fix: Apply scale without animation */
  transform: scale(0.9);
  transform-origin: center center;
  /* Fix: Start with invisible and no transition */
  opacity: 0;
  visibility: hidden;
  transition: none;
}

/* Fix: When modal opens, show content with delay to prevent glitch */
.bundle-builder-modal[style*="display: flex"] .bundle-modal-content {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.3s ease-out 0.05s; /* Small delay to let scale settle */
}

.bundle-modal-close {
  position: absolute;
  top: 22.5px;  /* 25px * 0.9 */
  right: 9px;  /* 10px * 0.9 */
  background: rgba(0, 0, 0, 0.05);
  border: none;
  cursor: pointer;
  padding: 7.2px;  /* 8px * 0.9 */
  border-radius: 50%;
  transition: all 0.2s;
  z-index: 1000000;
  width: 36px;  /* 40px * 0.9 */
  height: 36px;
}

.bundle-modal-close svg {
  width: 18px;  /* 20px * 0.9 */
  height: 18px;
}

.bundle-modal-close:hover {
  background: rgba(0, 0, 0, 0.1);
  transform: rotate(90deg);
}

/* Simplified view styles */
.bundle-simple-view {
  padding: 20px;
  background: var(--body_alternate_background);
  border-radius: 12px;
  text-align: center;
  margin: 20px 0;
  border: 1px solid var(--border_color);
}

.bundle-simple-view h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--heading_color);
}

.bundle-simple-view p {
  font-size: 0.9rem;
  opacity: 0.7;
  margin-bottom: 15px;
  color: var(--text_color);
}

.bundle-simple-view .button {
  font-size: 0.95rem;
}

/* Scoped styles for bundle builder */
#bundle-builder-{{ block.id }} {
  --bundle-background: {% if block.settings.bundle_background != blank %}{{ block.settings.bundle_background }}{% else %}var(--body_alternate_background){% endif %};
  --bundle-border: {% if block.settings.bundle_border != blank %}{{ block.settings.bundle_border }}{% else %}transparent{% endif %};
  --step-background: {% if block.settings.step_background != blank %}{{ block.settings.step_background }}{% else %}var(--card_background){% endif %};
  --step-border: {% if block.settings.step_border != blank %}{{ block.settings.step_border }}{% else %}var(--border_color){% endif %};
  --summary-background: {% if block.settings.summary_background != blank %}{{ block.settings.summary_background }}{% else %}var(--body_background){% endif %};
  --summary-border: {% if block.settings.summary_border != blank %}{{ block.settings.summary_border }}{% else %}var(--border_color){% endif %};
  --bundle-padding: 12px;
  --bundle-padding-mobile: 8px;
  --bundle-spacing: {{ block.settings.bundle_spacing }}px;
  --bundle-radius: {{ block.settings.bundle_radius }}px;
  --step-radius: {{ block.settings.step_radius }}px;
  --summary-radius: {{ block.settings.summary_radius }}px;
  {% case block.settings.form_input_size %}
    {% when 'small' %}
      --form-height: 42px;
    {% when 'medium' %}
      --form-height: 52px;
    {% when 'large' %}
      --form-height: 62px;
  {% endcase %}
  --sticky-top: calc(var(--header_height, 0px) + {{ block.settings.sticky_offset }}px);
}

/* Desktop-specific overrides - 70% larger (0.5 * 1.7 = 0.85) */
@media (min-width: 1025px) {
  .bundle-modal-content {
    width: 76.5%;  /* 90% * 0.85 */
    min-width: 680px;  /* 800px * 0.85 */
    max-width: 1190px;  /* 1400px * 0.85 */
    margin-top: 0;
    padding: 0 17px 17px;  /* 0 20px 20px * 0.85 */
    max-height: none;
    overflow-y: visible;
    border-radius: 17px;  /* 20px * 0.85 */
    box-sizing: border-box;
    /* Fix: Apply scale without animation */
    transform: scale(0.85) !important;
    transform-origin: center center;
    /* Fix: Ensure visibility and opacity are inherited */
    visibility: hidden;
    opacity: 0;
    transition: none;
  }
  
  /* Fix: Desktop also needs the visibility fix */
  .bundle-builder-modal[style*="display: flex"] .bundle-modal-content {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.3s ease-out 0.05s;
  }
  
  .bundle-builder-modal .bundle-content {
    display: flex;
    flex-direction: row;
    gap: 15px;  /* 20px * 0.75 */
    height: auto;
    align-items: flex-start;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
    min-height: 0;
  }
  
  .bundle-builder-modal .bundle-steps {
    flex: 1;
    min-width: 0;
    padding: 17px;  /* 20px * 0.85 */
    box-sizing: border-box;
    overflow-y: auto;
    max-height: calc(85vh - 85px);  /* Adjusted for scale */
    margin-top: 34px;  /* 40px * 0.85 */
  }
  
  .bundle-builder-modal .bundle-summary {
    flex: 0 0 408px;  /* 480px * 0.85 */
    padding: 17px;  /* 20px * 0.85 */
    margin-top: 0;
    box-sizing: border-box;
    position: sticky;
    top: 34px;  /* 40px * 0.85 */
    overflow-y: auto;
    max-height: calc(85vh - 85px);  /* Adjusted for scale */
    background: var(--body_background);
    z-index: 1000;
  }
  
  .bundle-builder-modal .bundle-step {
    padding: 17px;  /* 20px * 0.85 */
  }
  
  .bundle-builder-modal .bundle-add-to-cart {
    position: static;
    width: 100%;
    padding: 12.75px 0;  /* 15px * 0.85 */
    margin-top: 17px;  /* 20px * 0.85 */
    border-top: 1px solid var(--border_color);
  }
  
  .bundle-builder-modal .bundle-add-to-cart .button {
    width: 100%;
    justify-content: center;
  }
  
  /* Fix for dropdown positioning in scaled modal */
  .bundle-builder-modal .bundle-selector-dropdown {
    position: absolute;
    top: 100%;
    margin-top: 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: var(--body_background);
    border: 1px solid var(--border_color);
    border-radius: 8px;
    transition: margin-top 0.2s ease;
  }
  
  .bundle-builder-modal .bundle-selector.open .bundle-selector-dropdown,
  .bundle-builder-modal .bundle-selector-dropdown.open,
  .bundle-builder-modal .bundle-selector-dropdown[style*="display: block"] {
    margin-top: 4px;
  }
  
  .bundle-builder-modal .bundle-selector-trigger {
    position: relative;
  }
  
  /* Fix for the last dropdown to open upward */
  .bundle-builder-modal .bundle-steps .bundle-step:last-child .bundle-selector-dropdown {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 8px;
  }
  
  .bundle-builder-modal .bundle-steps .bundle-step:last-child .bundle-selector.open .bundle-selector-dropdown,
  .bundle-builder-modal .bundle-steps .bundle-step:last-child .bundle-selector-dropdown.open,
  .bundle-builder-modal .bundle-steps .bundle-step:last-child .bundle-selector-dropdown[style*="display: block"] {
    margin-bottom: 4px;
  }
  
  /* Smooth out dropdown item hover effects */
  .bundle-builder-modal .dropdown-item {
    transition: background-color 0.15s ease, color 0.15s ease;
  }
}

/* Tablet responsive (1024px to 769px) */
@media (max-width: 1024px) and (min-width: 769px) {
  .bundle-modal-content {
    width: 72%;  /* 80% * 0.9 */
    padding: 18px;  /* 20px * 0.9 */
    min-width: 360px;  /* 400px * 0.9 */
    margin-top: calc(var(--header_height, 50px) + 9px);
  }
  
  .bundle-builder-modal .bundle-content {
    grid-template-columns: 1fr;
  }
  
  .bundle-builder-modal .bundle-summary {
    position: relative;
    margin-top: 18px;  /* 20px * 0.9 */
  }
}

/* Mobile responsive (below 768px) */
@media (max-width: 768px) {
  .bundle-modal-content {
    width: 81vw;  /* 90vw * 0.9 */
    max-width: 306px;  /* 340px * 0.9 */
    height: auto;
    max-height: 81vh;  /* 90vh * 0.9 */
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 9px;  /* 10px * 0.9 */
    padding: 10.8px;  /* 12px * 0.9 */
    padding-top: 54px;  /* 60px * 0.9 */
    margin-top: calc(var(--header_height, 60px) + 9px);
  }
  
  .bundle-modal-close {
    top: 18px;  /* 20px * 0.9 */
    right: 9px;  /* 10px * 0.9 */
  }
  
  .bundle-builder-modal .bundle-content {
    grid-template-columns: 1fr;
    gap: 7.2px;  /* 8px * 0.9 */
    display: flex;
    flex-direction: column;
    height: 100%;
    padding-bottom: 54px;  /* 60px * 0.9 */
  }
  
  .bundle-builder-modal .bundle-step {
    padding: 10.8px;  /* 12px * 0.9 */
  }
  
  .bundle-builder-modal .bundle-summary {
    padding: 10.8px;  /* 12px * 0.9 */
    position: relative;
    margin-top: 10.8px;  /* 12px * 0.9 */
  }
  
  .bundle-builder-modal .bundle-selector-trigger {
    padding: 10.8px 13.5px;  /* 12px 15px * 0.9 */
    min-height: 43.2px;  /* 48px * 0.9 */
    font-size: 12.6px;  /* 14px * 0.9 */
  }
  
  .bundle-builder-modal .dropdown-item {
    padding: 9px;  /* 10px * 0.9 */
    font-size: 12.6px;  /* 14px * 0.9 */
  }
  
  .bundle-builder-modal .bundle-selector-dropdown {
    max-height: 45vh;  /* 50vh * 0.9 */
    width: 100%;
  }
  
  /* Sticky Add to Cart button for mobile */
  .bundle-builder-modal .bundle-add-to-cart {
    position: sticky;
    bottom: 0;
    width: 100%;
    padding: 10.8px 0;  /* 12px * 0.9 */
    background: var(--body_background);
    border-top: 1px solid var(--border_color);
    margin-top: auto;
    z-index: 1000;
  }
  
  .bundle-builder-modal .bundle-add-to-cart .button {
    width: 100%;
    justify-content: center;
  }
}

/* Animations - Simplified to prevent glitch */
@keyframes modalFadeIn {
  from { 
    opacity: 0; 
    visibility: hidden;
  }
  to { 
    opacity: 1; 
    visibility: visible;
  }
}

/* Only animate the overlay */
.bundle-builder-modal {
  animation: modalFadeIn 0.2s ease-out;
}

/* Modal content has no animation - scale is static */
.bundle-modal-content {
  /* No animation here - handled by visibility states above */
}

@media (min-width: 1025px) {
  /* Desktop-specific visibility handling is in the main desktop section above */
}

/* Scrollbar styling for modal */
.bundle-modal-content::-webkit-scrollbar {
  width: 6px;
}

.bundle-modal-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
}

.bundle-modal-content::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.bundle-modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}
/* Force fix for opening glitch */
.bundle-builder-modal .bundle-modal-content {
  -webkit-transform: scale(0.9) !important;
  -moz-transform: scale(0.9) !important;
  -ms-transform: scale(0.9) !important;
  -o-transform: scale(0.9) !important;
  transform: scale(0.9) !important;
  -webkit-transform-origin: center center !important;
  transform-origin: center center !important;
}

@media (min-width: 1025px) {
  .bundle-builder-modal .bundle-modal-content {
    -webkit-transform: scale(0.85) !important;
    -moz-transform: scale(0.85) !important;
    -ms-transform: scale(0.85) !important;
    -o-transform: scale(0.85) !important;
    transform: scale(0.85) !important;
  }
}
