/**
 * TF Fitment Manager - Checkout Styles
 */

/* Fitment Section */
.tyre-fitment-section {
  margin-top: 30px;
  padding: 20px;
  border-radius: 5px;
}

.tyre-fitment-section h3 {
  font-size: 1.2em;
  color: #333;
}

/* Fitment Buttons */
.fitment-options {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.fitment-btn {
  cursor: pointer;
  border: 2px solid #3d9b4a !important;
  color: #3d9b4a !important;
  background: #fff !important;
  outline: none !important;
  transition: all 0.3s ease;
  font-size: 14px;
  border-radius: 4px;
}

.fitment-btn:hover {
  background: #3d9b4a !important;
  color: #fff !important;
}

.fitment-btn.selected {
  background: #3d9b4a !important;
  color: #fff !important;
  border-color: #3d9b4a !important;
}

/* Date/Time Row */
.form-row-first,
.form-row-last {
  width: 48%;
  display: inline-block;
  vertical-align: top;
}

.form-row-first {
  margin-right: 4%;
}

/* Map Markers */
.branch-marker {
  background: #3d9b4a;
  border: 2px solid #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.branch-marker.selected {
  background: #ff6b35;
  transform: scale(1.2);
}

.branch-popup {
  font-size: 14px;
  font-weight: bold;
  color: #3d9b4a;
}

/* Location Marker (for mobile fitment) */
.location-marker {
  background: #ff6b35;
  border: 2px solid #fff;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Selected Location Display */
#selected_location_display {
  background: #f5f5f5;
  cursor: default;
}

/* Loading State */
.woocommerce-checkout-review-order.loading {
  position: relative;
  opacity: 0.6;
  pointer-events: none;
}

.woocommerce-checkout-review-order.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #3d9b4a;
  border-radius: 50%;
  animation: tf-spin 1s linear infinite;
  z-index: 1000;
}

@keyframes tf-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Fitment Details on Order */
.woocommerce-fitment-details {
  margin-top: 30px;
}

.woocommerce-fitment-details h2 {
  margin-bottom: 15px;
}

.fitment_details {
  width: 100%;
}

.fitment_details th,
.fitment_details td {
  padding: 10px;
  border-bottom: 1px solid #ddd;
}

.fitment_details th {
  text-align: left;
  width: 40%;
  font-weight: 600;
}

/* Flatpickr Customization */
.flatpickr-calendar {
  border-radius: 5px;
  box-shadow: 0 3px 13px rgba(0, 0, 0, 0.08);
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover {
  background: #3d9b4a;
  border-color: #3d9b4a;
}

.flatpickr-day:hover {
  background: #e8f5e9;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .fitment-options {
    flex-direction: column;
  }

  .fitment-btn {
    width: 100%;
    text-align: center;
  }

  .form-row-first,
  .form-row-last {
    width: 100%;
    display: block;
    margin-right: 0;
  }

  #mapbox-container {
    height: 250px;
  }
}

/* Order Review Adjustment for Location */
#order_review.fitment-location-selected {
  margin-top: 20px;
}

/* Mapbox Popup Styles */
.mapboxgl-popup-content {
  padding: 10px 15px;
  border-radius: 4px;
}

.mapboxgl-popup-content h4 {
  margin: 0 0 5px 0;
  color: #3d9b4a;
}

.mapboxgl-popup-content p {
  margin: 0;
  font-size: 12px;
  color: #666;
}

.mapboxgl-popup-content a {
  color: #3d9b4a;
  text-decoration: none;
}

.mapboxgl-popup-content a:hover {
  text-decoration: underline;
}

/* Clear Float */
.clear {
  clear: both;
}
