/**
 * Frontend styles for WooCommerce Stock Availability
 */

/* Badge styles - Updated for proper positioning within product image */
.wsa-badge {
  display: inline-block;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  border-radius: 4px;
  position: absolute;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

/* Force relative positioning on image containers ONLY */
.woocommerce ul.products li.product a,
.woocommerce ul.products li.product .woocommerce-loop-product__link,
.woocommerce div.product div.images,
.woocommerce div.product .woocommerce-product-gallery,
.woocommerce div.product .woocommerce-product-gallery__wrapper,
.woocommerce div.product .woocommerce-product-gallery__image,
.woocommerce div.product .woocommerce-product-gallery__image:first-child,
.single-product .product .images,
.woocommerce ul.products li.product .attachment-woocommerce_thumbnail {
  position: relative !important;
  overflow: visible !important;
}

/* Specific badge positioning within image containers ONLY */
.woocommerce ul.products li.product a .wsa-badge,
.woocommerce ul.products li.product .woocommerce-loop-product__link .wsa-badge,
.woocommerce div.product .woocommerce-product-gallery__image .wsa-badge,
.woocommerce div.product .woocommerce-product-gallery__wrapper .wsa-badge,
.woocommerce div.product div.images .wsa-badge,
.single-product .product .images .wsa-badge {
  position: absolute;
  z-index: 100;
}

/* Constrain badges to image boundaries - Top right positioning */
.wsa-badge.wsa-top-right,
.wsa-top-right {
  top: 10px !important;
  right: 10px !important;
  bottom: auto !important;
  left: auto !important;
}

/* Constrain badges to image boundaries - Top left positioning */
.wsa-badge.wsa-top-left,
.wsa-top-left {
  top: 10px !important;
  left: 10px !important;
  bottom: auto !important;
  right: auto !important;
}

/* Constrain badges to image boundaries - Bottom right positioning */
.wsa-badge.wsa-bottom-right,
.wsa-bottom-right {
  bottom: 10px !important;
  right: 10px !important;
  top: auto !important;
  left: auto !important;
}

/* Constrain badges to image boundaries - Bottom left positioning */
.wsa-badge.wsa-bottom-left,
.wsa-bottom-left {
  bottom: 10px !important;
  left: 10px !important;
  top: auto !important;
  right: auto !important;
}

/* Center positioning - constrained to image */
.wsa-badge.wsa-center,
.wsa-center {
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  bottom: auto !important;
  right: auto !important;
}

/* Ensure badges are contained within image boundaries */
.woocommerce ul.products li.product a,
.woocommerce ul.products li.product .woocommerce-loop-product__link,
.woocommerce div.product div.images,
.woocommerce div.product .woocommerce-product-gallery,
.woocommerce div.product .woocommerce-product-gallery__wrapper,
.woocommerce div.product .woocommerce-product-gallery__image,
.single-product .product .images {
  overflow: hidden !important; /* Changed from visible to hidden to contain badges */
  position: relative !important;
}

/* Make sure images don't hide the badges but badges stay within image bounds */
.woocommerce ul.products li.product a img,
.woocommerce div.product div.images .woocommerce-product-gallery__wrapper img,
.woocommerce div.product .woocommerce-product-gallery__image img,
.single-product .product .images img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
}

/* Specific container constraints for product thumbnails */
.woocommerce ul.products li.product a {
  display: block;
  position: relative !important;
  overflow: hidden !important;
  border-radius: 4px; /* Optional: adds rounded corners to image container */
}

/* Single product main image container constraints */
.woocommerce div.product div.images .woocommerce-product-gallery__wrapper,
.woocommerce div.product .woocommerce-product-gallery__image:first-child {
  position: relative !important;
  overflow: hidden !important;
  display: block;
}

/* Ensure badges don't overflow outside image containers */
.wsa-badge {
  max-width: calc(100% - 20px); /* Prevent badge from being wider than container minus padding */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Additional specificity for stubborn themes - constrain to image only */
.woocommerce .products .product a {
  position: relative !important;
  display: block !important;
  overflow: hidden !important;
}

.woocommerce .products .product .woocommerce-loop-product__link {
  position: relative !important;
  display: block !important;
  overflow: hidden !important;
}

/* Ensure badges stay within image bounds on mobile */
@media (max-width: 768px) {
  .wsa-badge {
    padding: 4px 8px;
    font-size: 10px;
    border-radius: 3px;
    max-width: calc(100% - 10px); /* Smaller max-width on mobile */
  }
  
  .wsa-badge.wsa-top-right,
  .wsa-top-right {
    top: 5px !important;
    right: 5px !important;
  }
  
  .wsa-badge.wsa-top-left,
  .wsa-top-left {
    top: 5px !important;
    left: 5px !important;
  }
  
  .wsa-badge.wsa-bottom-right,
  .wsa-bottom-right {
    bottom: 5px !important;
    right: 5px !important;
  }
  
  .wsa-badge.wsa-bottom-left,
  .wsa-bottom-left {
    bottom: 5px !important;
    left: 5px !important;
  }
}

/* Badge color styles */
.wsa-in-stock-badge {
  background-color: #4caf50;
}

.wsa-pre-order-badge {
  background-color: #ff9800;
}

/* Status text on single product */
.wsa-status {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 10px;
  text-transform: uppercase;
}

/* Delivery estimate on single product */
.wsa-delivery-estimate {
  font-size: 14px;
  margin-bottom: 15px;
  color: #666;
}

/* Mobile-specific styling for status container */
@media (max-width: 768px) {
  /* Force status container to appear on new line below image gallery */
  .wsa-status-container {
    display: block !important;
    width: 100% !important;
    clear: both !important;
    margin-top: 15px !important;
    margin-bottom: 15px !important;
    padding: 0 !important;
  }
  
  /* Ensure status text breaks to new line on mobile */
  .wsa-status {
    display: block !important;
    width: 100% !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    margin-bottom: 8px !important;
    line-height: 1.3 !important;
  }
  
  /* Delivery estimate styling on mobile */
  .wsa-delivery-estimate {
    display: block !important;
    width: 100% !important;
    font-size: 14px !important;
    margin-top: 5px !important;
    margin-bottom: 10px !important;
    color: #666 !important;
    line-height: 1.4 !important;
  }
  
  /* Force single product summary to stack properly on mobile */
  .single-product .product .summary {
    display: block !important;
    width: 100% !important;
  }
  
  /* Ensure proper spacing after image gallery on mobile */
  .single-product .product .images {
    margin-bottom: 20px !important;
  }
  
  /* Force product info to start on new line after images */
  .woocommerce div.product .summary {
    clear: both !important;
    display: block !important;
    width: 100% !important;
    margin-top: 0 !important;
  }
  
  /* Ensure status appears immediately after images */
  .woocommerce div.product .summary .wsa-status-container {
    order: -1 !important;
    margin-top: 0 !important;
    margin-bottom: 15px !important;
  }
}

/* Admin column styles */
.stock-availability {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: bold;
  color: #fff;
}

.stock-availability.in-stock {
  background-color: #4caf50;
}

.stock-availability.pre-order {
  background-color: #ff9800;
}

/* Cart and checkout text status styles */
.wsa-text-status {
  display: inline-block;
  margin-left: 5px;
  font-size: 12px;
  font-weight: bold;
  /* Removed text-transform: uppercase; to keep "In-Stock" and "Pre-Order" capitalization */
}

/* Make sure the status is visible in cart and checkout */
.woocommerce-cart-form__cart-item td.product-name,
.woocommerce-checkout-review-order-table td.product-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

/* Order details page styling */
.wsa-order-item-status {
  margin-top: 5px;
  margin-bottom: 5px;
}

/* Admin order details page */
table.woocommerce_order_items th.stock-availability,
table.woocommerce_order_items td.stock-availability {
  text-align: center;
}

/* Hide the stock availability meta from the order details meta list since we display it separately */
.woocommerce-order-details .woocommerce-table__line-item .woocommerce-table__product-name .wc-item-meta li:has(strong:contains("Stock Availability")) {
  display: none;
}

/* Split order styles */
.wsa-split-orders {
  margin: 30px 0;
  padding: 20px;
  background-color: #f8f8f8;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.wsa-split-order-details {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -10px;
}

.wsa-split-order {
  flex: 1;
  min-width: 250px;
  margin: 10px;
  padding: 15px;
  background-color: #fff;
  border: 1px solid #eee;
  border-radius: 4px;
}

.wsa-split-order-info {
  margin: 30px 0;
  padding: 15px;
  background-color: #f8f8f8;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* Delivery information styles */
.wsa-delivery-info,
.wsa-pre-order-info {
  margin-bottom: 30px;
  padding: 20px;
  background-color: #f8f8f8;
  border-radius: 5px;
  border-left: 4px solid #4caf50;
}

.wsa-pre-order-info {
  border-left-color: #ff9800;
}

.wsa-delivery-info h2,
.wsa-pre-order-info h2 {
  margin-top: 0;
  color: #333;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e5e5;
}

.wsa-delivery-details,
.wsa-pre-order-details {
  font-size: 14px;
  line-height: 1.6;
}

.wsa-pre-order-list {
  margin: 15px 0;
  padding-left: 20px;
}

.wsa-pre-order-list li {
  margin-bottom: 8px;
}

/* Checkout delivery fields styling */
.woocommerce-delivery-fields {
  margin-bottom: 20px;
  padding: 0;
  background-color: transparent;
  border: none;
  border-radius: 0;
}

.woocommerce-delivery-fields h3 {
  display: none;
}

.woocommerce-delivery-fields .form-row {
  margin-bottom: 15px;
}

.woocommerce-delivery-fields .description {
  font-size: 12px;
  color: #777;
  margin-top: 5px;
}

@media (max-width: 768px) {
  .wsa-split-order {
    flex: 100%;
  }
}

/* Date picker input field styling */
#wsa_delivery_date {
  background-color: #fff;
  border: 1px solid #ddd;
  padding: 8px 12px;
  width: 100%;
  box-sizing: border-box;
  height: 45px;
  font-size: 16px;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

#wsa_delivery_date:focus {
  outline: none;
  border-color: #4caf50;
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

/* Modern jQuery UI Datepicker styling */
.ui-datepicker {
  background-color: #fff;
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 16px;
  width: 300px !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue",
    sans-serif;
  z-index: 9999 !important;
  margin-top: 5px;
}

/* Header styling */
.ui-datepicker-header {
  background-color: transparent;
  border: none;
  padding: 0 0 12px 0;
  position: relative;
  margin-bottom: 8px;
  border-bottom: 1px solid #f0f0f0;
}

.ui-datepicker-title {
  text-align: center;
  font-weight: 600;
  font-size: 16px;
  color: #333;
  line-height: 1.5;
  margin: 0;
  padding: 0 40px;
}

/* Navigation arrows */
.ui-datepicker-prev,
.ui-datepicker-next {
  cursor: pointer;
  position: absolute;
  top: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  text-align: center;
  line-height: 30px;
  color: #666;
  text-decoration: none;
  font-size: 0;
  transition: background-color 0.2s ease;
}

.ui-datepicker-prev:hover,
.ui-datepicker-next:hover {
  background-color: #f5f5f5;
}

.ui-datepicker-prev {
  left: 0;
}

.ui-datepicker-next {
  right: 0;
}

.ui-datepicker-prev:before,
.ui-datepicker-next:before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-style: solid;
  border-width: 2px 2px 0 0;
  transform: translate(-50%, -50%) rotate(-135deg);
  display: block;
}

.ui-datepicker-next:before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.ui-datepicker-prev span,
.ui-datepicker-next span {
  display: none;
}

/* Calendar table styling */
.ui-datepicker-calendar {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
}

.ui-datepicker-calendar thead {
  border-bottom: 1px solid #f0f0f0;
}

.ui-datepicker-calendar th {
  padding: 8px 0;
  text-align: center;
  font-weight: 600;
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
}

.ui-datepicker-calendar td {
  padding: 2px;
  text-align: center;
  border: none;
}

.ui-datepicker-calendar td a,
.ui-datepicker-calendar td span {
  display: block;
  padding: 8px 0;
  text-decoration: none;
  text-align: center;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.5;
  width: 36px;
  height: 36px;
  box-sizing: border-box;
  margin: 0 auto;
  transition: all 0.2s ease;
}

.ui-datepicker-calendar td a {
  color: #333;
  background-color: transparent;
}

.ui-datepicker-calendar td a:hover {
  background-color: #f5f5f5;
}

/* Today styling */
.ui-datepicker-calendar td.ui-datepicker-today a {
  background-color: #f0f7f0;
  color: #4caf50;
  font-weight: 600;
}

/* Selected date styling */
.ui-datepicker-calendar td.ui-datepicker-current-day a {
  background-color: #4caf50;
  color: white;
  font-weight: 600;
}

/* Disabled dates */
.ui-datepicker-calendar td.ui-state-disabled {
  opacity: 1;
}

.ui-datepicker-calendar td.ui-state-disabled span {
  color: #ccc;
  background-color: transparent;
}

/* Holiday dates styling */
.ui-datepicker-calendar td.ui-state-holiday {
  position: relative;
}

.ui-datepicker-calendar td.ui-state-holiday span,
.ui-datepicker-calendar td.ui-state-holiday a {
  background-color: #fff0f0 !important;
  color: #e53935 !important;
  text-decoration: line-through !important;
  opacity: 0.7;
}

.ui-datepicker-calendar td.ui-state-holiday:after {
  content: "✕";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  color: #e53935;
  z-index: 1;
}

/* Recurring holiday styling */
.ui-datepicker-calendar td.ui-state-recurring-holiday {
  position: relative;
}

.ui-datepicker-calendar td.ui-state-recurring-holiday span,
.ui-datepicker-calendar td.ui-state-recurring-holiday a {
  background-color: #fff0f0 !important;
  color: #e53935 !important;
  text-decoration: line-through !important;
  opacity: 0.7;
}

.ui-datepicker-calendar td.ui-state-recurring-holiday:after {
  content: "✕";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  color: #e53935;
  z-index: 1;
}

/* Other month dates */
.ui-datepicker-calendar td.ui-datepicker-other-month a {
  color: #ccc;
}

/* Mobile styling */
@media (max-width: 768px) {
  .ui-datepicker {
    width: 100% !important;
    max-width: 320px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    padding: 12px !important;
  }

  .ui-datepicker-calendar td a,
  .ui-datepicker-calendar td span {
    width: 32px;
    height: 32px;
    padding: 6px 0;
  }

  /* Fix for iOS devices */
  input[readonly] {
    opacity: 1 !important;
    background-color: #fff !important;
  }

  /* Make sure the datepicker is above everything else */
  .ui-datepicker {
    z-index: 100000 !important;
  }
}

/* Improve the date input field for mobile */
@media (max-width: 768px) {
  #wsa_delivery_date {
    font-size: 16px;
    height: 45px;
  }
}

/* Holiday management admin styles */
#wsa-holiday-dates-container table,
#wsa-recurring-holidays-container table {
  border-collapse: collapse;
  width: 100%;
}

#wsa-holiday-dates-container th,
#wsa-holiday-dates-container td,
#wsa-recurring-holidays-container th,
#wsa-recurring-holidays-container td {
  padding: 8px;
  vertical-align: middle;
}

#wsa-holiday-dates-container .wsa-holiday-row input[type="date"],
#wsa-holiday-dates-container .wsa-holiday-row input[type="text"],
#wsa-recurring-holidays-container .wsa-recurring-holiday-row select,
#wsa-recurring-holidays-container .wsa-recurring-holiday-row input[type="text"] {
  width: 100%;
}

.wsa-add-holiday,
.wsa-add-recurring-holiday {
  margin-top: 10px !important;
}

.wsa-remove-holiday,
.wsa-remove-recurring-holiday {
  color: #a00 !important;
}

/* Tooltip for holidays */
.ui-tooltip {
  padding: 8px;
  position: absolute;
  z-index: 9999;
  max-width: 300px;
  background: #333;
  color: white;
  border-radius: 4px;
  font-size: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Recurring holiday admin styles */
#wsa-recurring-holidays-container {
  margin-top: 20px;
}

#wsa-recurring-holidays-container select {
  width: 100%;
  max-width: 100%;
}

/* Thank You Page Layout */
@media (min-width: 768px) {
  .woocommerce-order-details + .wsa-delivery-info,
  .woocommerce-order-details + .wsa-pre-order-info,
  .wsa-delivery-info + .wsa-pre-order-info {
    margin-top: 30px;
  }

  .woocommerce-columns--2 .wsa-delivery-info,
  .woocommerce-columns--2 .wsa-pre-order-info {
    float: left;
    width: 48%;
    margin-right: 4%;
  }

  .woocommerce-columns--2 .wsa-pre-order-info {
    margin-right: 0;
  }

  .woocommerce-columns--2:after {
    content: "";
    display: table;
    clear: both;
  }
}

/* Admin Order Details Styling */
.wsa-admin-delivery-info,
.wsa-admin-pre-order-info {
  background-color: #f8f8f8;
  padding: 15px;
  margin-top: 15px;
  border-radius: 3px;
}

.wsa-admin-delivery-info h3,
.wsa-admin-pre-order-info h3 {
  margin-top: 0;
  color: #23282d;
  font-size: 14px;
  font-weight: 600;
}

/* Responsive styles */
@media (max-width: 768px) {
  .wsa-badge {
    padding: 4px 8px;
    font-size: 10px;
  }
}

/* Ensure consistent display of product information in cart */
.woocommerce-cart-form__cart-item td.product-name {
  display: block;
}

.woocommerce-cart-form__cart-item td.product-name > a {
  display: inline-block;
}

/* Ensure delivery estimate appears on a new line */
.woocommerce-cart-form__cart-item td.product-name .wsa-delivery-estimate-cart {
  display: block;
  margin-top: 5px;
  font-weight: normal;
}

/* Cart blocks styling */
.wc-block-cart-items .wsa-delivery-estimate-cart,
.wc-block-components-order-summary .wsa-delivery-estimate-cart {
  display: block;
  margin-top: 5px;
  font-weight: normal;
}

/* Checkout styling - Keep product name and quantity on same line */
.woocommerce-checkout-review-order-table .product-name {
  display: block !important;
}

/* Make sure the quantity stays on the same line as the product name */
.woocommerce-checkout-review-order-table .product-quantity {
  display: inline !important;
}

/* Style for stock type on checkout page */
.woocommerce-checkout-review-order-table .wsa-text-status {
  display: block;
  margin-left: 0;
  margin-top: 5px;
}

/* Style for delivery estimate on checkout page */
.woocommerce-checkout-review-order-table .wsa-delivery-estimate-checkout {
  display: block;
  margin-top: 5px;
  font-weight: normal;
}

/* Fix for checkout page - ensure product title and quantity are on same line */
.woocommerce-checkout-review-order-table .product-name > strong {
  display: inline !important;
}

/* Ensure product title and quantity are on the same line in checkout */
.woocommerce-checkout-review-order-table .product-name {
  display: block !important;
}

/* Hide the default quantity display */
.woocommerce-checkout-review-order-table .product-quantity {
  display: none !important;
}

/* Style for stock type on checkout page */
.woocommerce-checkout-review-order-table .wsa-text-status {
  display: block;
  margin-left: 0;
  margin-top: 5px;
}

/* Style for delivery estimate on checkout page */
.woocommerce-checkout-review-order-table .wsa-delivery-estimate-checkout {
  display: block;
  margin-top: 5px;
  font-weight: normal;
}

/* Stock Availability Frontend Styles */

/* Product Page */
.wsa-stock-availability {
  margin-bottom: 15px;
  padding: 5px 0;
}

.wsa-stock-availability-label {
  font-weight: bold;
  display: inline-block;
  margin-right: 10px;
}

.wsa-stock-availability.pre-order .wsa-stock-availability-label {
  color: #e2401c;
}

.wsa-stock-availability.in-stock .wsa-stock-availability-label {
  color: #7eb742;
}

.wsa-delivery-estimate {
  display: block;
  margin-top: 5px;
  font-size: 0.9em;
  color: #777;
}

/* Cart Page */
.wsa-cart-item-availability {
  margin-top: 5px;
  font-size: 0.9em;
}

.wsa-cart-item-availability .wsa-stock-availability-label {
  font-weight: bold;
}

.wsa-cart-item-availability.pre-order .wsa-stock-availability-label {
  color: #e2401c;
}

.wsa-cart-item-availability.in-stock .wsa-stock-availability-label {
  color: #7eb742;
}

/* Checkout Page */
.wsa-checkout-item-availability {
  display: block;
  margin-top: 5px;
  font-weight: bold;
}

.wsa-checkout-item-availability.pre-order {
  color: #e2401c;
}

.wsa-checkout-item-availability.in-stock {
  color: #7eb742;
}

.wsa-checkout-delivery-estimate,
.wsa-checkout-delivery-date {
  display: block;
  margin-top: 5px;
  font-size: 0.9em;
  color: #777;
}

/* Order Received Page */
.wsa-order-item-availability {
  margin-top: 5px;
  font-size: 0.9em;
}

.wsa-order-item-availability .wsa-stock-availability-label {
  font-weight: bold;
}

.wsa-order-item-availability.pre-order .wsa-stock-availability-label {
  color: #e2401c;
}

.wsa-order-item-availability.in-stock .wsa-stock-availability-label {
  color: #7eb742;
}

/* Split Orders */
.wsa-split-orders {
  margin-bottom: 30px;
  padding: 20px;
  background-color: #f8f8f8;
  border-radius: 5px;
}

.wsa-split-order-details {
  display: flex;
  flex-wrap: wrap;
  margin-top: 15px;
}

.wsa-split-order {
  flex: 1;
  min-width: 250px;
  margin-bottom: 15px;
  padding: 15px;
  background-color: #fff;
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.wsa-split-order + .wsa-split-order {
  margin-left: 15px;
}

@media (max-width: 768px) {
  .wsa-split-order {
    flex: 100%;
  }

  .wsa-split-order + .wsa-split-order {
    margin-left: 0;
    margin-top: 15px;
  }
}

/* Delivery Fields */
.wsa-date-field label {
  font-weight: bold;
}

.wsa-datepicker-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #fff;
  -webkit-appearance: none;
  appearance: none;
}

/* Delivery Info */
.wsa-delivery-info,
.wsa-pre-order-info {
  margin-bottom: 30px;
  padding: 20px;
  background-color: #f8f8f8;
  border-radius: 5px;
}

.wsa-delivery-details,
.wsa-pre-order-details {
  margin-top: 15px;
}

.wsa-pre-order-list {
  margin-left: 20px;
  list-style: disc;
}

.wsa-pre-order-list li {
  margin-bottom: 5px;
}

/* Checkout formatting */
.woocommerce-checkout-review-order-table .product-name {
  display: block;
}

.woocommerce-checkout-review-order-table .product-quantity {
  display: none !important;
}

.wsa-checkout-item-availability {
  display: block;
  margin-top: 5px;
}

.wsa-checkout-delivery-estimate {
  display: block;
  margin-top: 5px;
}

/* Add these styles to ensure the info boxes look consistent */
.wsa-in-stock-info,
.wsa-pre-order-info {
  margin-bottom: 30px;
  padding: 20px;
  border-radius: 5px;
}

.wsa-in-stock-info {
  background-color: #f0f7f0;
  border-left: 4px solid #4caf50;
}

.wsa-pre-order-info {
  background-color: #fff8f0;
  border-left: 4px solid #ff9800;
}

.wsa-in-stock-info h3,
.wsa-pre-order-info h3 {
  margin-top: 0;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 15px;
}

.wsa-in-stock-info h3 {
  color: #4caf50;
}

.wsa-pre-order-info h3 {
  color: #ff9800;
}

.wsa-in-stock-info ul,
.wsa-pre-order-info ul {
  list-style: disc;
  margin-left: 20px;
  margin-bottom: 15px;
}

.wsa-in-stock-info li,
.wsa-pre-order-info li {
  margin-bottom: 8px;
}

/* Hide the default Product Availability Information section */
.woocommerce-order-received h2:contains("Product Availability Information"),
.woocommerce-order-received h2:contains("Product Availability Information") + ul {
    display: none !important;
}

/* CRITICAL: Prevent badges from appearing outside image containers */
.wsa-badge:not(.woocommerce ul.products li.product a .wsa-badge):not(.woocommerce div.product div.images .wsa-badge):not(.single-product .product .images .wsa-badge) {
  display: none !important;
}

/* Ensure badges only appear within specific image containers */
.wsa-badge {
  /* Only show badges when they are direct children of image containers */
  display: none;
}

/* Show badges only within image containers */
.woocommerce ul.products li.product a .wsa-badge,
.woocommerce ul.products li.product .woocommerce-loop-product__link .wsa-badge,
.woocommerce div.product div.images .wsa-badge,
.woocommerce div.product .woocommerce-product-gallery .wsa-badge,
.woocommerce div.product .woocommerce-product-gallery__wrapper .wsa-badge,
.woocommerce div.product .woocommerce-product-gallery__image .wsa-badge,
.single-product .product .images .wsa-badge {
  display: inline-block !important;
}

/* Additional constraint: badges must be within image boundaries */
.woocommerce ul.products li.product a,
.woocommerce ul.products li.product .woocommerce-loop-product__link,
.woocommerce div.product div.images,
.woocommerce div.product .woocommerce-product-gallery,
.woocommerce div.product .woocommerce-product-gallery__wrapper,
.woocommerce div.product .woocommerce-product-gallery__image,
.single-product .product .images {
  /* Create a containing block for absolute positioned badges */
  position: relative !important;
  /* Hide any overflow to keep badges within image bounds */
  overflow: hidden !important;
  /* Ensure the container has defined dimensions */
  display: block;
}

/* Ensure images fill their containers properly */
.woocommerce ul.products li.product a img,
.woocommerce div.product div.images img,
.woocommerce div.product .woocommerce-product-gallery img,
.single-product .product .images img {
  width: 100%;
  height: auto;
  display: block;
  position: relative;
  z-index: 1;
}

/* Final safety net: prevent badges from appearing anywhere else */
body .wsa-badge:not(.woocommerce ul.products li.product a .wsa-badge):not(.woocommerce div.product div.images .wsa-badge):not(.single-product .product .images .wsa-badge):not(.woocommerce ul.products li.product .woocommerce-loop-product__link .wsa-badge):not(.woocommerce div.product .woocommerce-product-gallery .wsa-badge):not(.woocommerce div.product .woocommerce-product-gallery__wrapper .wsa-badge):not(.woocommerce div.product .woocommerce-product-gallery__image .wsa-badge) {
  display: none !important;
  visibility: hidden !important;
}
