/*
Theme Name: Avada Child
Description: Child theme for Avada theme
Author: ThemeFusion
Author URI: https://theme-fusion.com
Template: Avada
Version: 1.0.0
Text Domain:  Avada
*/

/* Wholesale Pricing Display */
.wholesale-price {
  color: #e74c3c;
  font-weight: bold;
}

.original-price {
  color: #95a5a6;
  font-size: 0.9em;
  text-decoration: line-through;
}

/* Booking Form Wrapper Styles */
.booking-form-wrapper {
  background: #fff;
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.starting-price {
  align-items: center;
  margin-bottom: 8px;
}

.starting-price .price-label {
  font-size: 30px;
  font-weight: 600;
  color: #678e5c;
}

.booking-price-section {
  margin: 20px 0;
}

.starting-price .minimum-price {
  font-size: 30px;
  font-weight: bold;
  color: #9c274a;
  margin: 10px 0;
}

.price-disclaimer {
  margin: 0;
  font-size: 14px;
  color: #7f8c8d;
  font-style: italic !important;
}

/* Main Booking Content Layout */
.booking-content-wrapper {
  display: block;
}

/* Left Section */
.booking-left-section {
  display: flex;
  flex-direction: column;
}

/* Composite Section */
.composite-section {
  font-size: 14px;
}

/* Date Range Section */
.date-range-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.date-range-section .date-inputs-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.date-range-section .date-input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.date-range-section label {
  font-weight: 600;
  color: #678e5c;
  margin-bottom: 4px;
  font-size: 14px;
}

.date-range-section label .required {
  color: #9c274a;
  margin-left: 4px;
}

.single_add_to_cart_button {
  padding: 6px 20px !important;
  font-size: 17px !important;
  text-transform: uppercase !important;
}

/* Disabled Add to Cart visual state */
button[name="add-to-cart"][disabled],
.single_add_to_cart_button[disabled],
.single_add_to_cart_button.th-disabled {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
  pointer-events: none;
  filter: grayscale(15%);
}

.date-range-section .date-input {
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.date-range-section .date-input:hover,
.date-range-section .date-input:focus {
  border-color: #678e5c;
  outline: none;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

@media (max-width: 768px) {
  .date-range-section .date-inputs-wrapper {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* Price Calculator Section */
.price-calculator-section {
  background: #f8f9fa;
  padding: 16px;
  border-radius: 6px;
  border: 1px solid #e9ecef;
}

/* Final Price Calculator Enhanced */
.final-price-calculator .price-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #ecf0f1;
}

.final-price-calculator .price-item:last-child {
  border-bottom: none;
}

.final-price-calculator .total-price {
  font-size: 18px;
  font-weight: bold;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px solid #678e5c;
}

/* Loading State */
.final-price-loading .skeleton-line {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 4px;
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-title {
  height: 20px !important;
  width: 60%;
}

.skeleton-item {
  width: 100%;
}

.skeleton-total {
  height: 24px !important;
  width: 80%;
}

@keyframes loading {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Flatpickr Custom Styling */
.flatpickr-calendar {
  font-size: 14px !important;
}

.flatpickr-day.selected {
  background: #678e5c !important;
  border-color: #678e5c !important;
}

.flatpickr-day.inRange {
  background: rgba(52, 152, 219, 0.2) !important;
  border-color: rgba(52, 152, 219, 0.2) !important;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Enquiry Form Placeholder */
.enquiry-form-placeholder {
  text-align: center;
  padding: 60px 20px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 2px dashed #dee2e6;
  margin: 20px 0;
}

.enquiry-form-placeholder p {
  margin: 0;
  color: #6c757d;
  font-size: 16px;
  font-style: italic;
}

/* Keep this style active for single form wrapper */
@media (max-width: 768px) {
  .booking-form-wrapper {
    padding: 10px;
  }
}

/* Loading State for Tab Content */
.tab-panel-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  background: #f8f9fa;
}

.tab-panel-loading::before {
  content: "";
  width: 40px;
  height: 40px;
  border: 4px solid #e9ecef;
  border-left-color: #678e5c;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Composite Product Styling */
.composite-children-list {
  list-style: none;
  padding: 0;
}

.component-header {
  margin-bottom: 10px;
  font-size: 18px;
}

.component-products {
  list-style: none;
  margin-top: 10px;
  font-size: 14px;
  color: #182958;
  padding: 0;
}

.composite-children-list li {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  padding: 8px;
  border-radius: 4px;
}

.composite-children-list input[type="checkbox"] {
  margin-right: 10px;
}

.composite-children-list fusion-li-item {
  display: flex;
  align-items: center;
}

.composite-children-list .fusion-li-item-content {
  display: flex;
  justify-content: space-between;
  flex: 1;
  align-items: center;
}

.composite-children-list .price {
  font-weight: bold;
  margin-left: 15px;
}

.composite-qty-input {
  width: 50px !important;
  padding: 5px !important;
  height: 40px;
  text-align: center;
  margin-right: 5px;
}

/* Final Price Calculator Styles */
.final-price-calculator {
  margin: 20px 0;
  padding: 10px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
}

.final-price-title {
  margin: 0 0 5px 0;
  font-size: 15px;
  font-weight: 600;
  color: #678e5c;
}

/* Skeleton Loading Styles */
.final-price-loading {
  animation: pulse 1.5s ease-in-out infinite alternate;
}

.skeleton-line {
  height: 20px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 10px;
}

.skeleton-title {
  height: 24px;
  width: 30%;
  margin-bottom: 15px;
}

.skeleton-item {
  height: 18px;
  width: 80%;
}

.skeleton-total {
  height: 22px;
  width: 50%;
  margin-top: 15px;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0.7;
  }
}

/* Price Display Styles */
.final-price-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.price-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.price-item:last-child {
  border-bottom: none;
}

.price-item.main-product {
  background: rgba(0, 123, 255, 0.05);
  padding: 10px;
  border-radius: 4px;
  border-bottom: none;
  margin-bottom: 5px;
}

.price-item.child-product {
  padding-left: 15px;
  font-size: 14px;
  color: #666;
}

.price-item.total-price {
  border-top: 1px solid #333;
  border-bottom: none;
  margin-top: 10px;
  padding-top: 12px;
  font-size: 16px;
}

.price-item.savings {
  color: #28a745;
  font-weight: 500;
  border-bottom: none;
}

.product-name {
  flex: 1;
  font-weight: 500;
}

.product-price {
  font-weight: 600;
  white-space: nowrap;
}

.product-price.total {
  color: #9c274a;
  font-size: 30px;
}

.product-price.savings-amount {
  color: #28a745;
}

.child-products-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.price-error {
  text-align: center;
  color: #dc3545;
  padding: 20px;
  background: rgba(220, 53, 69, 0.1);
  border-radius: 4px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .final-price-calculator {
    padding: 15px;
    margin: 15px 0;
  }

  .final-price-title {
    font-size: 16px;
  }

  .price-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .price-item.total-price {
    flex-direction: row;
    align-items: center;
  }

  .product-price {
    align-self: flex-end;
  }
}

/*
 * @author    TuanHa
 * @copyright Copyright (c) 2025 Tuan Ha <https://www.tuanha.dev/>
 *
 * Booking Dates Cart Display Styling
 */

/* Style booking dates to look like additional products in cart */
.woocommerce-cart-form__cart-item .variation,
.woocommerce-mini-cart-item .variation {
  margin-top: 8px;
}

.woocommerce-cart-form__cart-item .variation dt,
.woocommerce-mini-cart-item .variation dt {
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
  display: inline-block;
}

.woocommerce-cart-form__cart-item .variation dd,
.woocommerce-mini-cart-item .variation dd {
  margin-left: 0;
  margin-bottom: 8px;
  color: #666;
}

/* Style booking period like additional options */
/* Use generated classes from WooCommerce for reliable styling */
.woocommerce-cart-form__cart-item .variation dt.variation-BookingPeriod,
.woocommerce-mini-cart-item .variation dt.variation-BookingPeriod {
  color: #678e5c;
}

.woocommerce-cart-form__cart-item .variation dt.variation-AdditionalOptions,
.woocommerce-mini-cart-item .variation dt.variation-AdditionalOptions {
  color: #678e5c;
}

/* Style check marks for dates */
/* If you need icons or extra markers, add explicit classes via filters. */

/* Arrow styling in booking period */
.woocommerce-cart-form__cart-item .variation dd,
.woocommerce-mini-cart-item .variation dd {
  font-size: 14px;
  line-height: 1.6;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .woocommerce-cart-form__cart-item .variation,
  .woocommerce-mini-cart-item .variation {
    font-size: 13px;
  }
}

.th-error-message {
  color: #9c274a;
  font-weight: 600;
  font-size: 14px;
}

/* Inline date validation message positioning */
.th-date-message {
  margin-top: 6px;
  padding: 8px 10px;
  background: rgba(156, 39, 74, 0.08);
  border-left: 3px solid #9c274a;
  border-radius: 4px;
}

.woocommerce-cart-form .product-title {
  font-weight: 600;
  font-size: 18px;
}

.fusion-woo-cart .fusion-button-wrapper {
  justify-content: space-around;
}
