.myo-woo-builder {
  clear: both;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  box-sizing: border-box;
}

/* Concatenate (product 2225) layout overrides: Image + Info side by side, Video Builder + Cart/Meta below */
@media (min-width: 992px) {
  body.postid-2225.woocommerce.single-product div.product {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 24px !important;
  }

  body.postid-2225.woocommerce.single-product div.product div.woocommerce-product-gallery,
  body.postid-2225.woocommerce.single-product div.product div.images {
    grid-column: 1 !important;
    grid-row: 1 / 5 !important;
    width: 100% !important;
    max-width: none !important;
  }
  
  /* Ensure image itself is full width */
  body.postid-2225.woocommerce.single-product div.product div.images img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }

  /* Summary uses display: contents */
  body.postid-2225.woocommerce.single-product div.product div.summary {
    display: contents !important;
  }
  
  /* Breadcrumb in column 2, row 1 */
  body.postid-2225.woocommerce.single-product div.product div.summary .woocommerce-breadcrumb {
    grid-column: 2 !important;
    grid-row: 1 !important;
  }
  
  /* Title in column 2, row 2 */
  body.postid-2225.woocommerce.single-product div.product div.summary .product_title {
    grid-column: 2 !important;
    grid-row: 2 !important;
  }
  
  /* Price in column 2, row 3 */
  body.postid-2225.woocommerce.single-product div.product div.summary .price {
    grid-column: 2 !important;
    grid-row: 3 !important;
  }
  
  /* Description in column 2, row 4 */
  body.postid-2225.woocommerce.single-product div.product div.summary .woocommerce-product-details__short-description {
    grid-column: 2 !important;
    grid-row: 4 !important;
  }

  /* Video builder: spans both columns, row 5 */
  body.postid-2225.woocommerce.single-product div.product .myo-woo-builder {
    grid-column: 1 / -1 !important;
    grid-row: 5 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 24px 0 0 0 !important;
  }
  
  /* Cart: full width, row 6 */
  body.postid-2225.woocommerce.single-product div.product div.summary form.cart {
    grid-column: 1 / -1 !important;
    grid-row: 6 !important;
    margin: 0 !important;
  }
  
  /* Product meta: full width, row 7 */
  body.postid-2225.woocommerce.single-product div.product div.summary .product_meta {
    grid-column: 1 / -1 !important;
    grid-row: 7 !important;
    margin: 0 !important;
  }
  
  /* Desktop: Add to Cart button styling */
  .woocommerce-js div.product form.cart .button.single_add_to_cart_button {
    padding: 10px 20px;
    margin: 15px;
  }
  
  /* Desktop: increase margin for video list box */
  .myo-woo-price-display {
    margin: 66px 0 !important;
  }
}

/* Note: layout sizing is scoped to product 2225 below. */

.myo-woo-builder__title {
  margin: 0 0 10px 0;
  font-size: 1.1em;
}

.myo-woo-builder__actions {
  margin: 0 0 36px 0;
  padding-top: 10px;
  padding-bottom: 0;
  display: block;
  width: 100%;
}

.myo-woo-builder__add {
  width: auto;
}

.myo-woo-builder__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: block;
  width: 100%;
  clear: both;
}

.myo-woo-builder__list li {
  margin: 6px 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

.myo-woo-builder__prefix {
  flex: 0 0 auto;
  font-size: 0.85em;
  opacity: 0.85;
  min-width: 3.5em;
  color: #333;
}

.myo-woo-builder__preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  display: block;
}

/* Wrapper for selected clips thumbnail with play button overlay */
.myo-woo-builder__preview-wrapper {
  position: relative;
  flex: 0 0 auto;
  width: 210px;
  height: 120px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  margin-left: auto;
}

.myo-woo-builder__preview-wrapper img,
.myo-woo-builder__preview-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Play button overlay for selected clips */
.myo-woo-builder__preview-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.5;
  font-size: 48px;
  color: white;
  pointer-events: none;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  transition: opacity 0.2s;
}

.myo-woo-builder__preview-wrapper:hover .myo-woo-builder__preview-play-icon {
  opacity: 0.8;
}

.myo-woo-builder__preview--empty {
  display: inline-block;
}

.myo-woo-builder__clip-title {
  flex: 1 1 auto;
  min-width: 0;
  color: #333;
}

.myo-woo-builder__remove-btn {
  flex: 0 0 auto;
}

.myo-woo-builder__list em {
  opacity: 0.8;
}

.myo-woo-builder__empty {
  justify-content: flex-end;
  text-align: right;
}

/* Custom picker modal (no uploader) */
.myo-woo-picker {
  display: none;
}

.myo-woo-picker[aria-hidden="false"] {
  display: block;
}

.myo-woo-picker__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 99998;
}

.myo-woo-picker__panel {
  position: fixed;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, calc(100% - 24px));
  max-height: 80vh;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  z-index: 99999;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.myo-woo-picker__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.myo-woo-picker__title {
  font-weight: 600;
}

.myo-woo-picker__toolbar {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.myo-woo-picker__search {
  flex: 1 1 auto;
  width: 100%;
  margin: 0;
  padding: 8px 12px;
  height: 40px;
  box-sizing: border-box;
}

.myo-woo-picker__refresh {
  flex: 0 0 auto;
  font-size: 18px;
  line-height: 1;
  padding: 0 !important;
  min-width: 40px;
  width: 40px;
  height: 40px;
  box-sizing: border-box;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.myo-woo-picker__refresh-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.myo-woo-picker__refresh.spinning .myo-woo-picker__refresh-icon {
  animation: myo-spin 1s linear infinite;
}

@keyframes myo-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.myo-woo-picker__body {
  padding: 12px;
  overflow: auto;
  max-height: calc(80vh - 160px);
}

.myo-woo-picker__status {
  margin-bottom: 10px;
  opacity: 0.85;
}

.myo-woo-picker__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.myo-woo-picker__list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.myo-woo-picker__preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  display: block;
}

/* Wrapper for thumbnail with play button overlay */
.myo-woo-picker__preview-wrapper {
  position: relative;
  flex: 0 0 auto;
  width: 180px;
  height: 100px;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
}

.myo-woo-picker__preview-wrapper img,
.myo-woo-picker__preview-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Play button overlay */
.myo-woo-picker__preview-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.5;
  font-size: 48px;
  color: white;
  pointer-events: none;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  transition: opacity 0.2s;
}

.myo-woo-picker__preview-wrapper:hover .myo-woo-picker__preview-play-icon {
  opacity: 0.8;
}

.myo-woo-picker__list li:last-child {
  border-bottom: none;
}

.myo-woo-picker__item-title {
  flex: 1 1 auto;
  min-width: 0;
  color: #333 !important;
  font-weight: 500;
}

/* Row container for thumbnail + button */
.myo-woo-picker__item-row {
  display: contents; /* Makes children direct flex items of parent on desktop */
}

.myo-woo-picker__pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0 8px 0;
  margin-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
}

.myo-woo-picker__page {
  opacity: 0.8;
  font-size: 0.9em;
}

.myo-woo-picker__prev,
.myo-woo-picker__next {
  min-width: 80px;
}

.myo-woo-picker__prev:disabled,
.myo-woo-picker__next:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Price display */
.myo-woo-price-display {
  margin: 26px 0 10px 0;
  padding: 5px 12px 12px 12px;
  background: #f7f7f7;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
}

/* Hide the grey box when no clips are selected */
.myo-woo-price-display.myo-woo-empty {
  display: none;
}

.myo-woo-price-display .myo-woo-builder__list {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e0e0e0;
}

.myo-woo-price-display .myo-woo-builder__empty {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

#myo-woo-price-info {
  margin-top: 12px;
}

.myo-woo-price-info__duration {
  margin-bottom: 8px;
}

.myo-woo-price-info__price {
  font-size: 1.1em;
  color: #2c5f2d;
}

/* Mobile-specific styles for video picker - two-row layout */
@media (max-width: 767px) {
  /* Main list item - column layout for two rows */
  .myo-woo-picker__list li {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  /* Product name - full width on first row */
  .myo-woo-picker__item-title {
    width: 100%;
    font-size: 1.05em;
    font-weight: 600;
    text-align: left;
    margin-bottom: 8px;
    color: #333 !important;
    display: block !important;
  }
  
  /* Second row container for thumbnail + button */
  .myo-woo-picker__item-row {
    display: flex;
    gap: 12px;
    align-items: center;
  }
  
  .myo-woo-picker__preview-wrapper {
    width: 120px;
    height: 68px;
    flex-shrink: 0;
  }
  
  .myo-woo-picker__preview-play-icon {
    font-size: 32px;
  }
  
  .myo-woo-picker__list li button {
    /* flex: 1 1 auto; */
    padding: 10px 16px;
  }
  
  /* Mobile-specific styles for selected clips list - two-row layout */
  .myo-woo-builder__list li {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }
  
  /* Product name row - prefix and title together on first row, full width */
  .myo-woo-builder__prefix {
    font-size: 0.8em;
    min-width: auto;
    width: auto;
    flex: 0 0 auto;
    order: 1;
    color: #0c2340 !important;
  }
  
  .myo-woo-builder__clip-title {
    font-size: 0.9em;
    font-weight: 600;
    flex: 1 1 auto;
    order: 2;
    min-width: 0;
    color: #0c2340 !important;
  }
  
  /* Second row - thumbnail and remove button side by side */
  .myo-woo-builder__preview-wrapper {
    width: 120px;
    height: 68px;
    margin-left: 0;
    margin-right: 0;
    flex-shrink: 0;
    order: 3;
  }
  
  .myo-woo-builder__remove-btn {
    flex: 1 1 auto;
    order: 4;
    padding: 10px 16px;
  }
  
  /* Price info text color in mobile */
  .myo-woo-price-info__duration {
    color: #0c2340 !important;
  }
  
  .myo-woo-price-info__price {
    color: #2c5f2d !important;
    font-size: 1.1em;
  }
  
  /* Mobile-specific margin for video list box */
  .myo-woo-price-display {
    margin: 26px 0 10px 0 !important;
  }
  
  /* Position add to cart button below video list on mobile for Concatenate product */
  .postid-2225 .single_add_to_cart_button {
    display: none;
    width: 100%;
    margin-top: 16px;
  }
  
  /* Mobile: dark text for WooCommerce error notices on Concatenate product */
  .postid-2225 .woocommerce-error,
  .postid-2225 .woocommerce-message,
  .postid-2225 .woocommerce-info,
  .postid-2225 ul.woocommerce-error,
  .postid-2225 .woocommerce-notices-wrapper .woocommerce-error {
    color: #0c2340 !important;
  }
  
  .postid-2225 .woocommerce-error li,
  .postid-2225 .woocommerce-message li,
  .postid-2225 .woocommerce-info li {
    color: #0c2340 !important;
  }
  
  /* Mobile: Add to Cart button styling */
  .woocommerce-js div.product form.cart .button.single_add_to_cart_button {
    padding: 15px 20px;
    margin: 0 15px;
  }
  
  /* Mobile: reorder to show images, product info, video builder, cart, meta */
  .postid-2225.woocommerce div.product {
    display: flex;
    flex-direction: column;
  }
  
  .postid-2225.woocommerce div.product div.images {
    order: 1;
  }
  
  /* Make summary use display: contents so its children become direct flex items */
  .postid-2225.woocommerce div.product div.summary {
    display: contents;
  }
  
  /* Order summary children - product info comes first */
  .postid-2225.woocommerce div.product div.summary > *:not(form.cart):not(.product_meta) {
    order: 2;
  }
  
  /* Video builder after product info */
  .postid-2225.woocommerce div.product .myo-woo-builder {
    order: 3;
  }
  
  /* Cart after video builder */
  .postid-2225.woocommerce div.product div.summary form.cart {
    order: 4;
    margin-top: 16px;
  }
  
  /* Meta after cart */
  .postid-2225.woocommerce div.product div.summary .product_meta {
    order: 5;
    margin-top: 16px;
  }
  
  /* Credits section after video list / meta */
  .postid-2225.woocommerce div.product .myo-memorial-block {
    order: 6;
    margin-top: 16px;
  }
}

