/* Custom composite product layout */

.my-composite-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
}

.my-composite-left {
  min-width: 0;
  /* allow grids inside to shrink */
}


.my-composite-right {
  position: sticky;
  top: 24px;
  align-self: start;
  height: max-content;
}

/* Components grid inside left column */
.my-composite-left .wooco_components {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

/* Individual component card */
.my-wooco-component,
.wooco_component {
  background: #fff;
  padding: 16px;
}

/* Grid selection inside a component */
.wooco_component_product_selection_grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.wooco_component_product_selection_grid_item {
  padding: 5px !important;
  min-width: 90px;

  /* min-height: 120px; */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
}

/* List selection compact layout */
.wooco_component_product_selection_list_item {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 8px;
}

.wooco_component_product_selection_grid_item_name {
  display: block;
  white-space: normal !important;

  word-break: break-word !important;

  word-wrap: break-word !important;

  overflow-wrap: anywhere !important;

  hyphens: auto !important;

}

.wooco_component_product_selection_list_item_image img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
}

/* Make grid item at least as big as the image and center content vertically */
.wooco_component_product_selection_grid_item_image {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

/* Ensure composite product images are always visible, not too small, and show a placeholder if missing */
.wooco_component_product_selection_grid_item_image img,
.wooco_component_product_selection_list_item_image img {
  display: block !important;
  max-width: 130px !important;
  max-height: 130px !important;
  min-width: 60px !important;
  min-height: 60px !important;
  width: auto !important;
  height: auto !important;
  margin: 0 auto !important;
  object-fit: contain !important;
  background: #f3f3f3;
  border-radius: 8px;
}

/* Show a placeholder if no image is present */
.wooco_component_product_selection_grid_item_image:empty::before,
.wooco_component_product_selection_list_item_image:empty::before {
  content: '\1F5BC';
  /* Unicode for framed picture */
  display: block;
  font-size: 48px;
  color: #bbb;
  text-align: center;
  line-height: 120px;
}

/* Quantity row look */
.wooco-qty-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.wooco-minus,
.wooco-plus {
  display: inline-flex;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f3f4f6;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
}

/* Summary and alert */
.wooco-summary,
.wooco-total,
.wooco-count {
  font-weight: 600;
}

.wooco-alert {
  margin-top: 10px;
}

/* Responsive */
@media (max-width: 1024px) {
  .my-composite-layout {
    grid-template-columns: 1fr;
  }

  .my-composite-right {
    position: static;
  }

  .my-composite-left .wooco_components {
    grid-template-columns: 1fr;
  }

  .wooco_component_product_selection_grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* --- Wizard Stepper --- */
.wooco-stepper {
  display: flex;
  gap: 8px;
  margin: 6px 0 14px;
  flex-wrap: wrap;
}

.wooco-step {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 14px;
  border: 1px solid #1e2024;
  color: #1e2024;
  font-weight: 400;
  cursor: pointer;
  user-select: none;
  transition: background .2s ease, color .2s ease;
}

.wooco-step .wooco-step-index {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e5e7eb;
  color: #374151;
  font-size: 12px;
}

.wooco-step.active {
  background: #6643c8;
  border: 1px solid #6643c8;
  color: #fff;
}

.wooco-step.active .wooco-step-index {
  background: #fff;
  color: #111827;

}

.wooco-step.completed {
  background: #e6fffa;
  color: #065f46;
  border: 1px solid #065f46;
}

.wooco-step.disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* Controls */
.wooco-steps-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
  margin-bottom: 16px;
}

.wooco-steps-controls .wooco-steps-gap {
  flex: 1;
}

.wooco-steps-controls button {
  appearance: none;
  border: 0;
  padding: 10px 16px;
  font-weight: 600;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  cursor: pointer;
}

.wooco-steps-controls .wooco-step-prev {
  background: #e5e7eb;
  color: #111827;
}

.wooco-steps-controls button:disabled {
  opacity: .6;
  cursor: not-allowed;
}

/* Step visibility */
.wooco-step-hidden {
  display: none !important;
}

.wooco-step-invalid {
  outline: 2px solid #ef4444;
  outline-offset: 4px;
}

/* --- Product gallery thumbnails: full opacity and improved styling --- */
.woocommerce-product-gallery .flex-control-nav.flex-control-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px !important;
}

.woocommerce-product-gallery .flex-control-nav.flex-control-thumbs li {
  width: 140px !important;
  height: auto;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  cursor: pointer;
}

.woocommerce-product-gallery .flex-control-nav.flex-control-thumbs li .wooco-thumb-name {
  font-size: 12px;
  line-height: 1.3;
  margin-top: 6px;
  padding: 0 6px 6px;
  color: #333;
  text-align: center;
  word-break: break-word;
}

.woocommerce-product-gallery .flex-control-nav.flex-control-thumbs li img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1 !important;
  /* ensure full opacity */
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.woocommerce-product-gallery .flex-control-nav.flex-control-thumbs li:hover img {
  transform: scale(1.03);
}

/* Active/current thumbnail highlight */
.woocommerce-product-gallery .flex-control-nav.flex-control-thumbs li.flex-active,
.woocommerce-product-gallery .flex-control-nav.flex-control-thumbs li.is-active {
  border-color: #6643c8;
  box-shadow: 0 0 0 2px #6643c8 inset;
}

/* Elementor Woo Product Data Tabs under composite products */
.elementor-widget-woocommerce-product-data-tabs .woocommerce-tabs {
  margin-top: 24px;
}

.elementor-widget-woocommerce-product-data-tabs .woocommerce-tabs ul.tabs {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 0 0 12px 0;
  padding: 0;
  border-bottom: 1px solid #e5e7eb;
}

.elementor-widget-woocommerce-product-data-tabs .woocommerce-tabs ul.tabs li {
  margin: 0;
}

.elementor-widget-woocommerce-product-data-tabs .woocommerce-tabs ul.tabs li a {
  display: inline-block;
  padding: 10px 14px;
  font-weight: 600;
  color: #374151;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  border-radius: 6px 6px 0 0;
}

.elementor-widget-woocommerce-product-data-tabs .woocommerce-tabs ul.tabs li.active a,
.elementor-widget-woocommerce-product-data-tabs .woocommerce-tabs ul.tabs li a:hover {
  color: #111827;
  border-color: #e5e7eb;
  border-bottom-color: #6643c8;
}

.elementor-widget-woocommerce-product-data-tabs .woocommerce-tabs .woocommerce-Tabs-panel {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.elementor-widget-woocommerce-product-data-tabs .woocommerce-tabs .woocommerce-Tabs-panel h2 {
  font-size: 1.125rem;
  margin-top: 0;
}

/* --- Box composite single product content within 1550px when using Elementor Containers (.e-con) --- */
/* Use broader targeting for Elementor Containers; set variable and fallbacks */
.single-product.product-type-composite .elementor.elementor-location-single .e-con {
  --container-max-width: 1550px;
  /* Elementor container variable */
  max-width: 1550px !important;
  width: 100%;
  box-sizing: border-box;
  margin-left: auto;
  margin-right: auto;
}

/* If inner wrapper is present, ensure it is boxed too */
.single-product.product-type-composite .elementor.elementor-location-single .e-con>.e-con-inner {
  max-width: 1550px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  box-sizing: border-box;
}

/* Custom: Fully rounded corners for specific component options */
.wooco_component.fully-rounded-options .wooco_component_product_selection_grid_item_image img,
.wooco_component.fully-rounded-options .wooco_component_product_selection_list_item_image img {
  border-radius: 9999px !important;
  border: 1px solid #e5e7eb !important;
  width: 60px !important;
  height: 60px !important;
  object-fit: cover !important;
  transition: all 0.2s ease !important;
}

/* Novelty components: make images 2x larger than normal */
.wooco_component.novelty-options .wooco_component_product_selection_grid_item_image {
  width: 160px !important;
  /* 2x of default 80px */
  height: 160px !important;
  /* 2x of default 80px */
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  margin: 0 auto 8px auto !important;
}

/* Grid images should fit the 160px container exactly to avoid overlap */
.wooco_component.novelty-options .wooco_component_product_selection_grid_item_image img {
  width: 160px !important;
  height: 160px !important;
  max-width: 160px !important;
  max-height: 160px !important;
}

.wooco_component.novelty-options .wooco_component_product_selection_grid_item {
  width: 100% !important;
}


/* Ensure grid has enough space: switch to 2 columns for novelty components */
.wooco_component.novelty-options .wooco_component_product_selection_grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)) !important;
  gap: 12px !important;
  justify-items: stretch !important;
}





/* Extra-small screens: stack novelty grid to 1 column to avoid overlap */
@media (max-width: 640px) {
  .wooco_component.novelty-options .wooco_component_product_selection_grid {
    grid-template-columns: 1fr !important;
  }
}

/* Direct targeting for fabric color components based on data attributes */
.wooco_component_product_selection_grid_item[data-source_titles*="Fabric Colors"] .wooco_component_product_selection_grid_item_image img {
  /* border-radius: 9999px !important; */
  border: 2px solid #e5e7eb !important;
  width: 60px !important;
  height: 60px !important;
  object-fit: cover !important;
  transition: all 0.2s ease !important;
}

.wooco_component_product_selection_grid_item[data-source_titles*="Fabric Colors"] .wooco_component_product_selection_grid_item_image {
  width: 60px !important;
  height: 60px !important;
  border-radius: 50% !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 auto 8px auto !important;
}



/* Product image border radius */
.woocommerce div.product div.images img,
.woocommerce div.product div.images .woocommerce-product-gallery__image img,
.woocommerce-product-gallery__image img {
  border-radius: 8px !important;
}

.wooco_component_product_selection_grid_item:before {
  height: 10px !important;
  width: 10px !important;
  line-height: 10px !important;
  top: 3px !important;
  border: none !important;
}