/* Fix for PLA parent product notice: prevent flex, ensure normal wrapping, and anchor word-break */
.pla-parent-product-notice-fixed {
  display: block !important;
  word-break: break-word;
  white-space: normal;
  padding: 0.75em 1em;
  margin-bottom: 0px !important;
  margin-top: 9px  !important;
}
.pla-parent-product-notice-fixed a {
  word-break: break-word;
  text-decoration: underline;
  cursor: pointer;
  vertical-align: middle !important;
}

.availability.stock {
  margin-bottom: 3px !important; 
}

/* ========== ACCESSORIES SELECTION UI ========== */

.pla-accessories-wrapper {
    margin: 30px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 4px;
}

.pla-accessories-heading {
    margin: 0 0 20px 0;
    font-size: 1.5em;
    font-weight: 600;
}

.pla-accessories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.pla-accessory-item {
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.pla-accessory-item:hover {
    border-color: #999;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.pla-accessory-label {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    cursor: pointer;
    gap: 12px;
}

.pla-accessory-checkbox {
    margin-top: 5px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.pla-accessory-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.pla-accessory-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 3px;
}

.pla-accessory-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.pla-accessory-name {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.3;
}

.pla-accessory-price {
    color: #666;
    font-size: 16px;
}

/* Selected state */
.pla-accessory-item:has(.pla-accessory-checkbox:checked) {
    border-color: #2c3e50;
    background: #f0f7ff;
}

/* Price summary */
.pla-price-summary {
    margin-top: 15px;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.pla-price-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.pla-price-summary-row:last-child {
    margin-bottom: 0;
    padding-top: 8px;
    border-top: 2px solid #ddd;
    font-weight: 700;
    font-size: 18px;
}

/* Responsive */
@media (max-width: 768px) {
    .pla-accessories-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== CART ACCESSORIES DISPLAY ========== */

/* Accessory rows - same structure as parent */
.pla-accessory-row td,
.pla-accessory-row th {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}

/* Visual tree indicator on the left */
.pla-accessory-row .product-thumbnail {
    position: relative;
    padding-left: 40px !important;
}

.pla-accessory-row .product-thumbnail::before {
    content: "└─";
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-weight: bold;
    font-size: 16px;
    line-height: 1;
}

/* Smaller thumbnails for accessories */
.pla-accessory-row .product-thumbnail img {
    max-width: 60px !important;
    height: auto !important;
}

.pla-accessory-row .product-name a {
    font-weight: normal;
    color: #555;
}

.pla-accessory-row .product-remove a.remove {
    color: #dc3545;
    font-size: 21px;
}

.pla-accessory-row .product-remove a.remove:hover {
    color: #c82333;
    background-color: transparent;
}

/* Main cart child items - nested tree structure */
.woocommerce-cart-form .merto-mini-cart-child,
.woocommerce-cart-form .pla-accessory-item {
    background: #f8f9fa;
    position: relative;
}

/* Add visual nesting with border and background */
.woocommerce-cart-form .merto-mini-cart-child td:first-child,
.woocommerce-cart-form .pla-accessory-item td:first-child {
    border-left: 3px solid #2c3e50;
    padding-left: 40px !important;
    position: relative;
}

.woocommerce-cart-form .merto-mini-cart-child td:first-child::before,
.woocommerce-cart-form .pla-accessory-item td:first-child::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(to right, #e8eef3 0%, transparent 100%);
    border-left: 3px solid #2c3e50;
}

.woocommerce-cart-form .merto-mini-cart-child td:first-child::after,
.woocommerce-cart-form .pla-accessory-item td:first-child::after {
    content: "└─";
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    color: #2c3e50;
    font-weight: bold;
    font-size: 14px;
}

/* All cells in child row get subtle background */
.woocommerce-cart-form .merto-mini-cart-child td,
.woocommerce-cart-form .pla-accessory-item td {
    background: #f8f9fa;
}

/* Make product name in accessories slightly smaller and italic */
.woocommerce-cart-form .merto-mini-cart-child .product-name,
.woocommerce-cart-form .pla-accessory-item .product-name {
    font-size: 0.95em;
    font-style: italic;
    color: #555;
}

/* Checkout review order child items */
.woocommerce-checkout-review-order .merto-mini-cart-child,
.woocommerce-checkout-review-order .pla-accessory-item {
    background: #f8f9fa;
    padding-left: 30px;
    position: relative;
    border-left: 3px solid #2c3e50;
    margin-left: 10px;
}

.woocommerce-checkout-review-order .merto-mini-cart-child::before,
.woocommerce-checkout-review-order .pla-accessory-item::before {
    content: "└─";
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    color: #2c3e50;
    font-weight: bold;
}

.pla-accessory-row {
  margin-left: 32px;
}

/* .pla-linked-addons {
  padding: 0.75em;
  background: #fff;
  border-radius: 6px;
}
.pla-linked-addons > h2 {
  margin: 0 0 12px;
  padding: 0;
  background: transparent;
  border-bottom: none;
  border-radius: 0;
  font-size: 1.25em;
}
.pla-linked-addons .products {
  list-style: none;
  margin: 0;
  padding: 12px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.pla-linked-addons .products .product {
  margin: 0;
  width: auto;
  box-shadow: none;
  border: none;
  background: transparent;
  box-sizing: border-box;
}
.pla-addon-thumb img {
  max-width: 100%;
  height: auto;
  display: block;
  margin-bottom: 6px;
}
.pla-addon-title {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}
.pla-addon .price {
  color: #777;
  display: block;
  margin-bottom: 6px;
}
.pla-addon-qty-wrap {
  margin-top: 6px;
}
.woocommerce .pla-linked-addons .products {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 18px !important;
  align-items: stretch !important;
  margin: 0 -9px !important;
}
.woocommerce .pla-linked-addons .products .product {
  flex: 0 0 auto !important;
  max-width: none !important;
  width: auto !important;
  box-sizing: border-box !important;
  padding: 10px !important;
  background: transparent !important;
}
.woocommerce .pla-linked-addons .products .product .product-wrapper {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
}
.woocommerce .pla-linked-addons .products .product .thumbnail-wrapper {
  flex: 0 0 auto !important;
}
.woocommerce .pla-linked-addons .products .product .meta-wrapper {
  flex: 1 1 auto !important;
  min-height: 1px !important;
}
.woocommerce .pla-linked-addons .products .product .meta-wrapper.meta-wrapper-2 {
  margin-top: 8px !important;
}
.woocommerce .pla-linked-addons .products .product img {
  width: 100% !important;
  height: auto !important;
  display: block !important;
}

@media (max-width: 1000px) {
  .woocommerce .pla-linked-addons .products .product {
    flex: 0 0 auto !important;
    max-width: none !important;
  }
}
@media (max-width: 600px) {
  .woocommerce .pla-linked-addons .products .product {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .woocommerce .pla-linked-addons .products {
    gap: 12px !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
  }
}

.woocommerce .pla-linked-addons .products .product,
.woocommerce .pla-linked-addons .products .product * {
  min-width: 0 !important;
}

.woocommerce .pla-parent-products-wrapper {
  clear: both !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin-top: 12px !important;
}
.woocommerce .pla-parent-products-wrapper .products {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 18px !important;
  align-items: stretch !important;
  margin: 0 -9px !important;
  padding: 6px 9px !important;
}
.woocommerce .pla-parent-products-wrapper .products .product {
  flex: 0 0 auto !important;
  max-width: none !important;
  width: auto !important;
  padding: 10px !important;
}
@media (max-width:1000px) {
  .woocommerce .pla-parent-products-wrapper .products .product {
    flex: 0 0 auto !important;
    max-width: none !important;
  }
}
@media (max-width:600px) {
  .woocommerce .pla-parent-products-wrapper .products .product {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

.woocommerce .summary.entry-summary {
  overflow: visible !important;
}
.woocommerce .summary.entry-summary .pla-parent-product-notice {
  float: none !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0.75rem 1rem !important;
  font-size: 1em !important;
  font-weight: 400 !important;
}
.woocommerce .summary.entry-summary .pla-parent-products-wrapper {
  clear: both !important;
  margin-top: 12px !important;
}

section.related.products.pla-parent-products .products .swiper-slide,
section.related.products.pla-parent-products .products .product {
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: none !important;
  box-sizing: border-box !important;
  padding: 8px !important;
}

section.related.products.pla-parent-products .products .product * {
  min-width: 0 !important;
}

section.related.products.pla-parent-products .products .swiper-slide {
  padding-left: 0 !important;
  padding-right: 0 !important;
}
section.related.products.pla-parent-products .products .swiper-slide .product {
  padding-left: 0 !important;
  padding-right: 0 !important;
  width: 100% !important;
}
section.related.products.pla-parent-products .products .swiper-slide .product .product-wrapper {
  padding: 8px !important;
}

section.related.products.pla-parent-products .products .product .thumbnail-wrapper,
section.related.products.pla-parent-products .products .product .thumbnail-wrapper figure {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}
section.related.products.pla-parent-products .products .product .thumbnail-wrapper img {
  width: 100% !important;
  height: auto !important;
  max-height: 200px !important;
  object-fit: cover !important;
  display: block !important;
}

section.related.products.pla-parent-products .products .product .meta-wrapper,
section.related.products.pla-parent-products .products .product .meta-wrapper-2 {
  padding: 6px 0 0 !important;
}

section.related.products.pla-parent-products .products .product,
section.related.products.pla-parent-products .products .swiper-slide {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

section.related.products.pla-parent-products .products .swiper-slide[data-swiper-slide-index="0"]:not(.swiper-slide-duplicate),
section.related.products.pla-parent-products .products .swiper-wrapper .swiper-slide[data-swiper-slide-index="0"]:not(.swiper-slide-duplicate) {
  width: 160px !important;
  flex: 0 0 160px !important;
  max-width: 160px !important;
}
section.related.products.pla-parent-products .products .swiper-slide[data-swiper-slide-index="0"]:not(.swiper-slide-duplicate) .product {
  width: 100% !important;
}

@media (max-width: 1000px) {
  section.related.products.pla-parent-products .products .swiper-slide[data-swiper-slide-index="0"]:not(.swiper-slide-duplicate),
  section.related.products.pla-parent-products .products .swiper-wrapper .swiper-slide[data-swiper-slide-index="0"]:not(.swiper-slide-duplicate) {
    width: 180px !important;
    flex: 0 0 180px !important;
    max-width: 180px !important;
  }
}
@media (max-width: 600px) {
  section.related.products.pla-parent-products .products .swiper-slide[data-swiper-slide-index="0"]:not(.swiper-slide-duplicate),
  section.related.products.pla-parent-products .products .swiper-wrapper .swiper-slide[data-swiper-slide-index="0"]:not(.swiper-slide-duplicate) {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
} */
