/**
 * 2Sit Dynamic Price Preview Styles
 */
.tosit-price-preview {
  background: none !important;
}

/* Hidden state - initially hidden until conditions are met */
.tosit-price-preview-hidden {
  display: none !important;
}

/* Container for price elements that should be inline */
.tosit-price-preview-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tosit-price-preview-amount {
  font-family: 'Assistant' !important;
  font-size: 32px;
  font-weight: bold;
  color: #fa0754;
  margin: 0;
  line-height: 1.2;
}

.tosit-price-preview-original {
  font-family: 'Assistant' !important;
  font-size: 24px;
  color: #1C191A;
  text-decoration: line-through;
  margin: 0;
  display: none;
  font-weight: 600;
  opacity: 0.5;
}

.tosit-price-preview.has-sale .tosit-price-preview-original {
  display: inline-block;
}

.tosit-price-preview-savings {
  font-size: 16px;
  color: #1A8B61;
  font-family: 'Assistant' !important;
  font-weight: 600;
  display: none;
  margin: 0;
  /* Place discount below the price row and align to start */
  width: 100%;
  order: 3;
  align-self: flex-start;
  text-align: start;
  margin-top: -5px;
}

.tosit-price-preview.has-sale .tosit-price-preview-savings {
  display: block;
}

/* Loading state */
.tosit-price-preview.loading {
  opacity: 0.7;
  pointer-events: none;
}

.tosit-price-preview.loading .tosit-price-preview-amount:after {
  content: "";
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #1C191A;
  border-radius: 50%;
  border-top-color: transparent;
  animation: tosit-spin 1s linear infinite;
  margin-left: 10px;
  vertical-align: middle;
}

@keyframes tosit-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive design */
@media (max-width: 768px) {
  .tosit-price-preview {
    padding: 15px;
    margin: 15px 0;
  }

  .tosit-price-preview-main {
    gap: 8px;
  }

  .tosit-price-preview-amount {
    font-size: 28px;
  }

  .tosit-price-preview-original {
    font-size: 20px;
  }
}

/* Animation for price updates */
.tosit-price-preview-amount {
  transition: all 0.3s ease;
}

.tosit-price-preview[data-updating="true"] .tosit-price-preview-amount {
  transform: scale(1.05);
  color: #ffc107;
}

/* Integration with WooCommerce styles */
.single-product .tosit-price-preview {
  margin-bottom: 20px;
}

.variations_form + .tosit-price-preview {
  margin-top: 15px;
}

/* Compatibility with common themes */
.woocommerce div.product .tosit-price-preview {
  clear: both;
  width: 100%;
}

/* Accessibility improvements */
.tosit-price-preview {
  outline: none;
}

.tosit-price-preview:focus-within {
  outline: 2px solid #007cba;
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .tosit-price-preview {
    background: white !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }

  .tosit-price-preview-amount {
    color: #000 !important;
    text-shadow: none !important;
  }
}
