/* ============================================
   MOBILE-FRIENDLY MODAL FIX
   Specifically for Order and Review Modals
   ============================================ */

/* Make modals full-screen on mobile */
@media (max-width: 768px) {
  
  /* Order Modal and Review Modal - Full Screen */
  #orderModal .modal-dialog,
  #reviewModal .modal-dialog {
    margin: 0;
    max-width: 100%;
    height: 100vh;
  }
  
  #orderModal .modal-content,
  #reviewModal .modal-content {
    height: 100vh;
    border-radius: 0;
    border: none;
  }
  
  /* Make modal body scrollable */
  #orderModal .modal-body,
  #reviewModal .modal-body {
    overflow-y: auto;
    max-height: calc(100vh - 120px);
    padding: 1rem;
  }
  
  /* Better select dropdown on mobile */
  #serviceSelect,
  #serviceType,
  #userRating {
    font-size: 16px !important; /* Prevents zoom on iOS */
    padding: 12px !important;
    min-height: 44px;
    width: 100%;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
  }
  
  /* Make multi-select taller for better visibility */
  #serviceSelect[multiple] {
    min-height: 250px !important;
    font-size: 15px;
  }
  
  /* Style for select options */
  #serviceSelect option,
  #serviceType option,
  #userRating option {
    padding: 12px 8px;
    font-size: 15px;
  }
  
  /* Optgroup styling */
  #serviceSelect optgroup {
    font-weight: bold;
    color: #e9914d;
    font-size: 16px;
    margin-top: 8px;
  }
  
  /* Form labels bigger on mobile */
  .modal-body .form-label {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
  }
  
  /* Input fields touch-friendly */
  .modal-body .form-control,
  .modal-body .form-select {
    font-size: 16px !important;
    padding: 12px;
    min-height: 44px;
  }
  
  /* Textarea bigger */
  .modal-body textarea.form-control {
    min-height: 100px;
  }
  
  /* Buttons full-width on mobile */
  .modal-footer .btn {
    width: 100%;
    margin-bottom: 8px;
    padding: 14px;
    font-size: 16px;
  }
  
  /* Modal header sticky */
  #orderModal .modal-header,
  #reviewModal .modal-header {
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: #e9914d;
    color: white;
  }
  
  /* Modal footer sticky */
  #orderModal .modal-footer,
  #reviewModal .modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 1;
    background-color: white;
    border-top: 2px solid #e9ecef;
  }
}

/* Small mobile specific adjustments */
@media (max-width: 576px) {
  
  /* Even bigger select on small phones */
  #serviceSelect[multiple] {
    min-height: 300px !important;
  }
  
  /* Bigger close button */
  .modal-header .btn-close {
    font-size: 24px;
    padding: 12px;
  }
}

/* ============================================
   OPTIONAL: Better Select Box Styling
   ============================================ */

/* Selected option highlighting */
#serviceSelect option:checked {
  background: #e9914d !important;
  color: white !important;
}

/* Focus state for better accessibility */
#serviceSelect:focus,
#serviceType:focus,
#userRating:focus {
  border-color: #e9914d;
  box-shadow: 0 0 0 0.2rem rgba(233, 145, 77, 0.25);
  outline: none;
}

/* ============================================
   REVIEW MODAL SPECIFIC
   ============================================ */

@media (max-width: 768px) {
  /* Review sections */
  #reviewModal .modal-body h6 {
    font-size: 18px;
    margin-top: 20px;
    margin-bottom: 12px;
    font-weight: 600;
  }
  
  /* Review content */
  #acReviews p,
  #freezerReviews p,
  #wmReviews p,
  #mwReviews p {
    font-size: 15px;
    line-height: 1.6;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
  }
  
  /* Review form spacing */
  #reviewForm .mb-3 {
    margin-bottom: 1.5rem !important;
  }
}

/* ============================================
   DESKTOP - Keep Normal Behavior
   ============================================ */

@media (min-width: 769px) {
  /* Normal modal size on desktop */
  #orderModal .modal-dialog,
  #reviewModal .modal-dialog {
    max-width: 600px;
  }
  
  /* Multi-select reasonable height on desktop */
  #serviceSelect[multiple] {
    min-height: 200px;
  }
}