/* ============================================
   BestBuddies Pet Grooming - Booking Page Styles
   ============================================ */

/* Booking Page Container */
#bookingPage.container-lg {
  max-width: 1400px;
  width: 100%;
  padding: 0 2rem;
  box-sizing: border-box;
}

/* Booking Layout */
.booking-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
  margin-top: 2rem;
  align-items: start;
  box-sizing: border-box;
  max-width: 100%;
}

/* Navigation buttons (desktop) */
.booking-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 2rem;
}

/* Desktop: push navigation buttons to the right */
@media (min-width: 969px) {
  .booking-nav {
    justify-content: flex-end;
  }
}

/* Booking Steps */
.booking-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  position: relative;
}

.booking-steps::before {
  content: '';
  position: absolute;
  top: 1.5rem;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gray-200);
  z-index: 0;
}

.booking-steps .step {
  flex: 1;
  text-align: center;
  position: relative;
  z-index: 1;
}

.booking-steps .step-number {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  margin: 0 auto 0.5rem;
  transition: var(--transition);
}

.booking-steps .step.active .step-number {
  background: linear-gradient(135deg, var(--gray-900), var(--gray-600));
  color: var(--white);
  box-shadow: var(--shadow);
}

.booking-steps .step.completed .step-number {
  background: var(--gray-900);
  color: var(--white);
}

.booking-steps .step-label {
  font-size: 0.875rem;
  color: var(--gray-600);
  font-weight: 500;
}

.booking-steps .step.active .step-label {
  color: var(--gray-900);
  font-weight: 600;
}

/* Step Content */
.step-content {
  display: none;
}

/* Step Content - Active state with horizontal scroll */
.step-content.active {
  display: block;
  animation: fadeIn 0.5s ease-in;
  width: 100%;
  max-width: 100%;
  overflow-x: auto !important;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--gray-500) var(--gray-100);
}

/* Show scrollbar for step content - WebKit browsers */
.step-content.active::-webkit-scrollbar {
  height: 8px;
}

.step-content.active::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: 4px;
}

.step-content.active::-webkit-scrollbar-thumb {
  background: var(--gray-500);
  border-radius: 4px;
}

.step-content.active::-webkit-scrollbar-thumb:hover {
  background: var(--gray-700);
}

/* Touch container - allow horizontal scroll */
.touch-container {
  width: 100%;
  max-width: 100%;
  overflow-x: visible;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

/* Calendar Time Picker - Horizontal scroll */
#calendarTimePicker {
  width: 100%;
  max-width: 100%;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--gray-500) var(--gray-100);
}

/* Calendar wrapper inside time picker */
#calendarWrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  padding-bottom: 0.5rem;
}

/* Show scrollbar for calendar time picker - WebKit browsers */
#calendarTimePicker::-webkit-scrollbar,
#calendarWrapper::-webkit-scrollbar {
  height: 8px;
}

#calendarTimePicker::-webkit-scrollbar-track,
#calendarWrapper::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: 4px;
}

#calendarTimePicker::-webkit-scrollbar-thumb,
#calendarWrapper::-webkit-scrollbar-thumb {
  background: var(--gray-500);
  border-radius: 4px;
}

#calendarTimePicker::-webkit-scrollbar-thumb:hover,
#calendarWrapper::-webkit-scrollbar-thumb:hover {
  background: var(--gray-700);
}

/* Packages Container - Horizontal scroll on mobile */
#packagesContainer {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  padding-bottom: 0.5rem;
  display: flex;
  gap: 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--gray-500) var(--gray-100);
}

/* Show scrollbar for packages container - WebKit browsers */
#packagesContainer::-webkit-scrollbar {
  height: 8px;
}

#packagesContainer::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: 4px;
}

#packagesContainer::-webkit-scrollbar-thumb {
  background: var(--gray-500);
  border-radius: 4px;
}

#packagesContainer::-webkit-scrollbar-thumb:hover {
  background: var(--gray-700);
}

/* Package cards - fixed width for scroll */
.package-card {
  flex: 0 0 auto;
  min-width: 250px;
}

/* Time Slots - Horizontal scroll */
.time-slots {
  display: flex;
  gap: 1rem;
  width: max-content;
  min-width: 100%;
}

/* Time Slot Button */
.time-slot {
  flex: 0 0 auto;
  min-width: 100px;
}

/* Pet Type Cards */
.pet-type-card {
  cursor: pointer;
  transition: var(--transition);
}

.pet-type-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.pet-type-card.selected {
  border-color: var(--gray-900);
  background: linear-gradient(135deg, rgba(18, 18, 18, 0.08), rgba(72, 72, 72, 0.08));
}

/* Package Cards */
.package-card {
  cursor: pointer;
  transition: var(--transition);
}

.package-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.package-card.selected {
  border-color: var(--gray-900);
  background: linear-gradient(135deg, rgba(18, 18, 18, 0.08), rgba(72, 72, 72, 0.08));
}

/* Groomer Cards */
.groomer-card {
  cursor: pointer;
  transition: var(--transition);
}

.groomer-card:hover:not(.disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.groomer-card.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Weight Checklist */
.weight-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Summary Card */
.summary-card {
  position: sticky;
  top: 100px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: visible;
}

/* Summary item styling */
.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--gray-100);
  gap: 0.5rem;
}

.summary-item:last-child {
  border-bottom: none;
}

.summary-label {
  font-size: 0.85rem;
  color: var(--gray-600);
  flex-shrink: 0;
  min-width: 70px;
}

.summary-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-900);
  text-align: right;
  word-break: break-word;
}

.summary-alert {
  background: #fff3e0;
  border: 1px solid #ff9800;
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: #e65100;
}

/* Desktop: limit height so summary doesn't overflow the page and enable internal scroll */
@media (min-width: 969px) {
  .summary-card {
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    overflow-x: visible;
    width: 100%;
    min-height: 400px;
  }
  
  /* Ensure summary content is fully visible */
  .summary-card .summary-item {
    margin-bottom: 0.75rem;
    word-wrap: break-word;
  }
  
  .summary-card h3 {
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 1;
    padding-bottom: 0.5rem;
  }
}

/* Mobile Responsive */
@media (max-width: 968px) {
  #bookingPage.container-lg {
    padding: 0 1rem;
  }

  .booking-layout {
    grid-template-columns: 1fr;
    max-width: 100%;
    overflow-x: hidden;
  }
  
  /* First column - allow horizontal scroll for content */
  .booking-layout > div:first-child {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Summary sidebar on mobile */
  .summary-sidebar {
    position: static !important;
    max-width: 100% !important;
  }

  .summary-card {
    position: static !important;
    margin-top: 2rem;
  }

  /* Prevent the summary card content from forcing overflow */
  .summary-card {
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: visible !important;
  }

  .booking-steps {
    overflow-x: auto;
    padding: 1rem 0.5rem;
  }

  .booking-steps .step {
    min-width: 70px;
    flex-shrink: 0;
  }

  .booking-steps .step-number {
    width: 2.5rem !important;
    height: 2.5rem !important;
    font-size: 0.9rem !important;
  }

  .booking-steps .step-label {
    font-size: 0.75rem !important;
    white-space: nowrap;
  }

  /* Force ALL buttons to be block on mobile - override inline styles */
  /* Make all buttons look like Next button (dark background, white text) on mobile */
  #prevBtn:not([data-hidden]),
  #nextBtn:not([data-hidden]),
  #submitBooking:not([data-hidden]) {
    width: 100% !important;
    margin-bottom: 0.5rem !important;
    padding: 1rem !important;
    font-size: 1rem !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 10 !important;
    /* Make all buttons look like Next button (primary style) on mobile */
    background: linear-gradient(135deg, var(--gray-900), var(--gray-700)) !important;
    color: var(--white) !important;
    border: none !important;
    box-shadow: var(--shadow) !important;
  }

  /* Convert inline-block to block on mobile */
  #prevBtn[style*="inline-block"]:not([data-hidden]),
  #nextBtn[style*="inline-block"]:not([data-hidden]),
  #submitBooking[style*="inline-block"]:not([data-hidden]) {
    display: block !important;
  }

  /* Show nextBtn by default if it doesn't have data-hidden */
  #nextBtn:not([data-hidden]) {
    display: block !important;
  }

  /* Hide buttons with data-hidden attribute */
  #prevBtn[data-hidden],
  #nextBtn[data-hidden],
  #submitBooking[data-hidden] {
    display: none !important;
  }

  /* Navigation buttons container */
  div[style*="justify-content: space-between"][style*="margin-top: 2rem"],
  .booking-nav {
    flex-direction: column !important;
    gap: 0.75rem !important;
    position: sticky !important;
    bottom: 0 !important;
    background: var(--white) !important;
    padding: 1rem !important;
    margin-top: 1rem !important;
    margin-bottom: 0 !important;
    border-top: 2px solid var(--gray-200) !important;
    z-index: 100 !important;
    display: flex !important;
    visibility: visible !important;
  }

  /* Ensure button container is always visible */
  .booking-layout>div:first-child>div[style*="justify-content: space-between"],
  .booking-layout>div:first-child>.booking-nav {
    display: flex !important;
  }

  .form-input,
  .form-select,
  .form-textarea {
    font-size: 16px !important;
    padding: 1rem !important;
  }

  .time-slot {
    padding: 1rem !important;
    font-size: 1rem !important;
    min-height: 50px;
  }

  /* Make time slots wrap nicely on smaller screens */
  .time-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .time-slot {
    flex: 1 1 calc(50% - 0.5rem);
    box-sizing: border-box;
    min-width: 120px;
  }

  /* Calendar container - header stays fixed */
  .mega-calendar {
    width: 100%;
    box-sizing: border-box;
    padding: 0.6rem 0.8rem;
  }

  /* Calendar header stays fixed, doesn't scroll */
  .calendar-header {
    position: relative;
    z-index: 10;
    margin-bottom: 0.5rem;
  }

  /* Calendar grid wrapper - only this scrolls horizontally */
  .calendar-grid {
    width: 100%;
    overflow-x: visible;
    box-sizing: border-box;
  }

  /* Default: flexible column widths for responsive layout */
  .calendar-grid-head,
  .calendar-grid-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.6rem;
    align-items: center;
    grid-auto-rows: minmax(70px, auto);
    width: 100%;
    box-sizing: border-box;
  }

  .calendar-cell {
    box-sizing: border-box;
    min-height: 70px;
    padding: 0.5rem;
    border-radius: 8px;
    background: var(--white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    font-size: 0.85rem;
  }

  .calendar-cell.day .day-number {
    display: block;
    font-weight: 700;
    margin-bottom: 0.25rem;
  }

  /* Add bottom padding so sticky mobile booking-nav doesn't cover content */
  @media (max-width: 968px) {
    .booking-layout {
      padding-bottom: 6.25rem;
      /* leave room for sticky nav */
    }
  }

  .package-card,
  .groomer-card,
  .pet-type-card {
    min-height: 120px;
    padding: 1.5rem !important;
  }
}

/* ============================================
   Lightbox Modal for Images
   ============================================ */

#lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

#lightbox.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

#lightbox-image {
  max-width: 90%;
  max-height: 90vh;
  object-fit: contain;
  animation: slideIn 0.3s ease;
}

#lightbox-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  font-size: 2rem;
  color: white;
  cursor: pointer;
  background: none;
  border: none;
  z-index: 10000;
  transition: transform 0.2s ease;
}

#lightbox-close:hover {
  transform: scale(1.2);
}

/* Grooming Cut Button Styles */
.cut-selector-btn {
  transition: all 0.3s ease;
}

.cut-selector-btn:hover {
  background: #ddd !important;
  border-color: #999 !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cut-selector-btn.selected {
  background: #d0d0d0 !important;
  border: 2px solid #999 !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  color: #000 !important;
  font-weight: 700 !important;
}

.selected-cut {
  outline: 3px solid #2e7d32 !important;
}

.selected-cut-card {
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.08) !important;
  border-radius: 8px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ============================================
   Responsive Horizontal Scroll - All Mobile
   ============================================ */

@media (max-width: 968px) {
  /* Packages container - horizontal scroll */
  #packagesContainer {
    display: flex !important;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 1rem;
  }

  .package-card {
    flex: 0 0 auto;
    min-width: 200px;
  }

  /* Time slots - horizontal scroll */
  .time-slots {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .time-slot {
    flex: 0 0 auto;
    min-width: 90px;
  }
}

/* ============================================
   Mobile Phone Portrait (max 480px)
   ============================================ */

@media (max-width: 480px) {
  body {
    padding-top: 0;
  }

  /* Ensure packages scroll on mobile */
  #packagesContainer {
    display: flex !important;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.75rem;
  }

  .package-card {
    flex: 0 0 auto;
    min-width: 160px;
  }

  /* Time slots scroll on mobile */
  .time-slots {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.75rem;
  }

  .time-slot {
    flex: 0 0 auto;
    min-width: 75px;
  }

  .booking-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .summary-card {
    position: static !important;
    margin-top: 1rem;
    border-bottom: 3px solid var(--gray-900);
  }

  /* Make steps fully scrollable horizontally */
  .booking-steps {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding: 0.75rem 0.5rem;
    gap: 0.5rem;
    justify-content: flex-start;
    min-height: auto;
  }

  .booking-steps::before {
    display: none;
  }

  .booking-steps .step {
    min-width: 60px;
    flex-shrink: 0;
    scroll-snap-align: center;
  }

  .booking-steps .step-number {
    width: 2rem !important;
    height: 2rem !important;
    font-size: 0.7rem !important;
    margin: 0 auto 0.25rem !important;
  }

  .booking-steps .step-label {
    font-size: 0.65rem !important;
    white-space: nowrap;
    line-height: 1.1;
  }

  /* Card and Section Adjustments */
  .card {
    border-radius: var(--radius);
    padding: 1rem !important;
  }

  .card-header {
    padding: 0 !important;
    margin-bottom: 1rem;
  }

  .card-body {
    padding: 0 !important;
  }

  .card-title {
    font-size: 1.25rem !important;
    margin: 0 !important;
  }

  /* Form Elements */
  .form-section-title {
    font-size: 1rem !important;
    margin: 1rem 0 0.75rem 0 !important;
  }

  .grid-2,
  .grid-3,
  .grid {
    grid-template-columns: 1fr !important;
  }

  .form-group {
    margin-bottom: 0.75rem;
  }

  .form-input,
  .form-select,
  .form-textarea {
    font-size: 16px !important;
    padding: 0.75rem !important;
    width: 100%;
  }

  /* Pet type and package cards - stack single column with horizontal scroll for alternatives */
  .pet-type-card,
  .package-card,
  .groomer-card,
  .service-card {
    min-height: 100px;
    padding: 1rem !important;
    font-size: 0.9rem !important;
  }

  /* Time slot cards - show 2 per row or scroll horizontally */
  .time-slot {
    padding: 0.75rem !important;
    font-size: 0.85rem !important;
    min-height: 45px;
    min-width: 90px;
  }

  /* Weight checklist - wrap naturally */
  .weight-checklist {
    gap: 0.35rem !important;
  }

  .addon-chip {
    font-size: 0.8rem !important;
    padding: 0.5rem 0.75rem !important;
  }

  /* Grooming Cuts Carousel - Optimized for Mobile */
  div[style*="display: flex; gap: 1rem; overflow-x: auto"] {
    display: flex !important;
    gap: 0.75rem !important;
    overflow-x: auto !important;
    padding: 0.75rem 0 !important;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory !important;
    scroll-behavior: smooth !important;
  }

  /* Individual cut card styling */
  div[style*="text-align: center; min-width: 140px"] {
    min-width: 120px !important;
    flex: 0 0 auto !important;
    text-align: center !important;
    scroll-snap-align: start !important;
  }

  /* Cut image container */
  div[style*="width: 140px; height: 140px; background: #f5f5f5"] {
    width: 120px !important;
    height: 120px !important;
    border-radius: 0.8rem !important;
    margin: 0 auto 0.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-width: 2px !important;
    border-style: solid !important;
    overflow: hidden !important;
  }

  /* Better carousel controls and scrollbar hiding */
  .cuts-carousel {
    display: flex !important;
    gap: 0.75rem !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory !important;
    scroll-behavior: smooth !important;
    padding-bottom: 0.75rem !important;
  }

  /* Show horizontal scrollbar */
  .cuts-carousel {
    scrollbar-width: thin;
    scrollbar-color: #ccc #f5f5f5;
  }

  .cuts-carousel::-webkit-scrollbar {
    height: 6px;
  }

  .cuts-carousel::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 3px;
  }

  .cuts-carousel::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
  }

  .cuts-carousel>div {
    min-width: 120px !important;
    flex: 0 0 auto !important;
    scroll-snap-align: start !important;
  }

  /* Prev/Next small buttons (mobile) */
  .cuts-carousel-wrapper {
    position: relative;
  }

  .cuts-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    cursor: pointer;
  }

  .cuts-carousel-btn.cuts-prev {
    left: 6px;
  }

  .cuts-carousel-btn.cuts-next {
    right: 6px;
  }

  /* Cut button styling */
  .cut-selector-btn {
    width: 100% !important;
    padding: 0.5rem 0.25rem !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    margin-bottom: 0.3rem !important;
    border-radius: 0.3rem !important;
    background: #e8e8e8 !important;
    border: 1px solid #ccc !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    color: #333 !important;
  }

  .cut-selector-btn:active {
    background: #d0d0d0 !important;
    border-color: #999 !important;
  }

  .cut-selector-btn.selected {
    background: #d0d0d0 !important;
    border: 2px solid #999 !important;
    font-weight: 700 !important;
  }

  /* Cut description text */
  p[style*="font-size: 0.65rem"] {
    font-size: 0.6rem !important;
    color: var(--gray-600) !important;
    margin: 0.25rem 0 0 0 !important;
    line-height: 1;
  }

  /* Cut images responsiveness */
  div[style*="width: 140px; height: 140px"] img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }

  /* Buttons - CRITICAL FIX: ensure all navigation buttons are full-width and visible */
  #prevBtn,
  #nextBtn,
  #submitBooking {
    width: 100% !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    padding: 1rem !important;
    margin-bottom: 0.5rem !important;
    font-size: 1rem !important;
    border-radius: var(--radius) !important;
    background: linear-gradient(135deg, var(--gray-900), var(--gray-700)) !important;
    color: var(--white) !important;
    border: none !important;
    box-shadow: var(--shadow) !important;
    z-index: 20 !important;
    position: relative !important;
    cursor: pointer;
  }

  #prevBtn:hover:not([data-hidden]),
  #nextBtn:hover:not([data-hidden]),
  #submitBooking:hover:not([data-hidden]) {
    background: linear-gradient(135deg, var(--gray-800), var(--gray-600)) !important;
    transform: scale(1.02);
  }

  /* Hide buttons with data-hidden attribute */
  #prevBtn[data-hidden="true"],
  #nextBtn[data-hidden="true"],
  #submitBooking[data-hidden="true"] {
    display: none !important;
    margin: 0 !important;
  }

  /* Button container - sticky at bottom on mobile */
  .booking-layout>div:first-child>div[style*="justify-content: space-between"],
  .booking-layout>div:first-child>.booking-nav {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
    position: sticky !important;
    bottom: 0 !important;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.95), var(--white)) !important;
    padding: 0.75rem !important;
    margin: 1rem -1rem -1rem -1rem !important;
    border-top: 2px solid var(--gray-200) !important;
    z-index: 100 !important;
  }

  /* Alternative button container selector */
  div[style*="flex"][style*="space-between"] {
    flex-direction: column !important;
  }

  /* Action buttons at top of form */
  .form-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
    margin-bottom: 1rem !important;
  }

  .form-actions .btn {
    flex: 1 !important;
    min-width: 100px !important;
    font-size: 0.85rem !important;
    padding: 0.5rem !important;
  }

  /* Responsive text sizes */
  .step-content h2 {
    font-size: 1.25rem !important;
  }

  .step-content p {
    font-size: 0.9rem !important;
    line-height: 1.5;
  }

  /* Add-on checkboxes */
  .addon-chip {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
  }

  .addon-chip input {
    margin-right: 0.35rem;
  }

  /* Vaccination checkboxes */
  #vaccAntiRabies,
  #vaccAntiParvo {
    margin-right: 0.5rem;
  }

  /* Load Profile and Clear buttons */
  #loadProfileBtn,
  #clearProfileBtn {
    flex: 1 !important;
    font-size: 0.85rem !important;
  }
}

/* ============================================
   Tablet / Mobile Landscape (481px - 768px)
   ============================================ */

@media (min-width: 481px) and (max-width: 768px) {

  /* Keep sidebar stacked but improve layout */
  .booking-layout {
    grid-template-columns: 1fr;
  }

  /* Allow steps to be more visible */
  .booking-steps {
    overflow-x: auto;
    justify-content: flex-start;
    gap: 1rem;
  }

  .booking-steps .step {
    min-width: 100px;
  }

  /* 2 columns for pet types and packages if possible */
  .grid-3 {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Ensure summary card is visible */
  .summary-card {
    margin-top: 2rem;
  }
}

/* ==============================================
   MOBILE & DESKTOP FIXES - COMPREHENSIVE
   Version: Final Clean 
   ============================================== */

/* ============================================
   1. DESKTOP: Grid Layout Fix
   ============================================ */
.booking-layout {
  display: grid !important;
  grid-template-columns: 1fr 380px !important;
  gap: 2rem !important;
  align-items: start !important;
  max-width: 100% !important;
  overflow: visible !important;
}

/* First column flex for proper button ordering */
.booking-layout>div:first-child {
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
}

/* Second column - Summary sidebar container */
.booking-layout>div:last-child,
.booking-layout .summary-sidebar {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 380px !important;
  overflow: visible !important;
}

/* Booking Summary container */
#bookingSummary {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: visible !important;
}

/* Summary sidebar specific styles */
.summary-sidebar {
  position: sticky;
  top: 100px;
  align-self: start;
}

/* ============================================
   2. NAVIGATION BUTTONS - Force to Bottom
   ============================================ */
.booking-nav {
  order: 999 !important;
  margin-top: 2rem !important;
  position: relative !important;
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 0.75rem !important;
  width: 100% !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  float: none !important;
}

/* ============================================
   3. SUMMARY SIDEBAR - Sticky on Right
   ============================================ */
.booking-layout>div:last-child {
  position: sticky !important;
  top: 100px !important;
  align-self: start !important;
}

/* ============================================
   4. GROOMING CUTS - Horizontal on Desktop
   ============================================ */
.cuts-carousel-wrapper {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.5rem;
}

.cuts-carousel-wrapper>div {
  flex: 0 0 auto;
  scroll-snap-align: start;
}

/* Show horizontal scrollbar for better UX */
.cuts-carousel-wrapper {
  scrollbar-width: thin;
  scrollbar-color: #ccc #f5f5f5;
}

.cuts-carousel-wrapper::-webkit-scrollbar {
  height: 8px;
}

.cuts-carousel-wrapper::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 4px;
}

.cuts-carousel-wrapper::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

.cuts-carousel-wrapper::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

/* ============================================
   5. MOBILE RESPONSIVE (max-width: 968px)
   ============================================ */
@media (max-width: 968px) {

  /* Single column layout */
  .booking-layout {
    grid-template-columns: 1fr !important;
  }

  /* Summary goes to bottom */
  .booking-layout>div:last-child,
  .booking-layout .summary-sidebar {
    position: static !important;
    order: 2 !important;
    max-width: 100% !important;
  }

  /* Buttons stack vertically */
  .booking-nav {
    flex-direction: column !important;
    order: 1 !important;
  }

  .booking-nav button {
    width: 100% !important;
  }
}

/* ============================================
   6. MOBILE PHONE (max-width: 480px)
   ============================================ */
@media (max-width: 480px) {

  /* Booking Summary - Row Layout */
  .summary-card {
    padding: 1rem !important;
    margin-top: 1.5rem !important;
  }

  .summary-card h3 {
    font-size: 1.05rem !important;
    margin-bottom: 0.75rem !important;
  }

  .summary-item {
    padding: 0.5rem 0 !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    gap: 0.5rem !important;
  }

  .summary-label {
    font-size: 0.75rem !important;
    color: var(--gray-600) !important;
    flex-shrink: 0 !important;
  }

  .summary-value {
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    text-align: right !important;
  }
}






/* ============================================
   POLICY AGREEMENT SECTION
   ============================================ */

.policy-scroll-container {
  max-height: 350px;
  overflow-y: auto;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.5rem;
  background: linear-gradient(135deg, #fafafa, #f5f5f5);
  margin-bottom: 1.5rem;
  scroll-behavior: smooth;
}

.policy-scroll-container::-webkit-scrollbar {
  width: 8px;
}

.policy-scroll-container::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: 4px;
}

.policy-scroll-container::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: 4px;
}

.policy-scroll-container::-webkit-scrollbar-thumb:hover {
  background: var(--gray-600);
}

.policy-content h3 {
  color: var(--gray-900);
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  text-align: center;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--gray-300);
}

.policy-content h4 {
  color: var(--gray-800);
  font-size: 1rem;
  margin: 1.25rem 0 0.75rem 0;
  font-weight: 600;
}

.policy-content p {
  color: var(--gray-700);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 0.75rem;
  text-align: justify;
}

.policy-end-marker {
  text-align: center;
  padding: 1.5rem 0;
  margin-top: 1.5rem;
  border-top: 2px dashed var(--gray-300);
}

.policy-end-marker p {
  color: var(--gray-500);
  font-style: italic;
  font-size: 0.85rem;
}

.policy-agreement-section {
  padding: 1rem;
  background: linear-gradient(135deg, rgba(255, 200, 100, 0.1), rgba(255, 180, 50, 0.1));
  border-radius: var(--radius);
  border: 2px solid #ff9800;
}

.scroll-indicator {
  text-align: center;
  padding: 0.75rem;
  background: #fff3e0;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  animation: pulse 2s infinite;
}

.scroll-indicator span {
  color: #e65100;
  font-weight: 600;
  font-size: 0.9rem;
}

.scroll-indicator.hidden {
  display: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.policy-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: background 0.3s ease;
}

.policy-checkbox-label:hover {
  background: rgba(255, 152, 0, 0.1);
}

.policy-checkbox-label input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: #4caf50;
  flex-shrink: 0;
}

.policy-checkbox-label input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.policy-checkbox-label span {
  color: var(--gray-800);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.4;
}

.policy-checkbox-label input[type="checkbox"]:checked + span {
  color: #2e7d32;
}

/* ============================================
   LOADING OVERLAY
   ============================================ */

.loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
}

.loading-overlay.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.loading-content {
  text-align: center;
  background: white;
  padding: 3rem 4rem;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 5px solid var(--gray-200);
  border-top: 5px solid var(--gray-900);
  border-radius: 50%;
  margin: 0 auto 1.5rem;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.loading-subtext {
  font-size: 0.9rem;
  color: var(--gray-600);
}

/* Mobile responsive for loading */
@media (max-width: 768px) {
  .loading-content {
    padding: 2rem;
    margin: 1rem;
    width: calc(100% - 2rem);
  }
  
  .loading-spinner {
    width: 50px;
    height: 50px;
  }
  
  .loading-text {
    font-size: 1.1rem;
  }
  
  .policy-scroll-container {
    max-height: 50vh;
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  .policy-content h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
  }
  
  .policy-content h4 {
    font-size: 0.95rem;
    margin: 1rem 0 0.5rem 0;
  }
  
  .policy-content p {
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
  }
  
  .scroll-indicator {
    padding: 0.5rem;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
  }
  
  .policy-checkbox-label {
    font-size: 0.9rem;
    gap: 0.5rem;
  }
  
  .policy-checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 0;
  }
}

@media (max-width: 480px) {
  .loading-content {
    padding: 1.5rem;
    margin: 0.5rem;
    width: calc(100% - 1rem);
  }
  
  .loading-spinner {
    width: 45px;
    height: 45px;
    border-width: 4px;
  }
  
  .loading-text {
    font-size: 1rem;
  }
  
  .loading-subtext {
    font-size: 0.8rem;
  }
  
  .policy-scroll-container {
    max-height: 45vh;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border-radius: 8px;
  }
  
  .policy-content h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
  }
  
  .policy-content h4 {
    font-size: 0.9rem;
    margin: 0.75rem 0 0.4rem 0;
  }
  
  .policy-content p {
    font-size: 0.8rem;
    line-height: 1.5;
    margin-bottom: 0.4rem;
  }
  
  .policy-end-marker {
    padding: 1rem 0;
    margin-top: 1rem;
  }
  
  .policy-end-marker p {
    font-size: 0.75rem;
  }
  
  .scroll-indicator {
    padding: 0.4rem;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
  }
  
  .scroll-indicator span {
    font-size: 0.75rem;
  }
  
  .policy-agreement-section {
    padding: 0.75rem;
    border-radius: 6px;
  }
  
  .policy-checkbox-label {
    font-size: 0.85rem;
    gap: 0.5rem;
    padding: 0.4rem;
  }
  
  .policy-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 1px;
  }
  
  .policy-checkbox-label span {
    font-size: 0.85rem;
  }
}

/* ============================================
   Grooming Cuts Reference System Styles
   ============================================ */

/* Grooming Cuts Container */
#groomingCutsCarousel {
  margin: 2rem 0;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 16px;
  border: 1px solid #dee2e6;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Cuts Header */
.cuts-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.cuts-header h3 {
  color: #2c3e50;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.cuts-header h3 i {
  color: #e74c3c;
  font-size: 1.3rem;
}

.cuts-header p {
  color: #6c757d;
  font-size: 1rem;
  margin: 0;
}

/* Cuts Carousel */
.cuts-carousel {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 1rem 0;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.cuts-carousel::-webkit-scrollbar {
  height: 8px;
}

.cuts-carousel::-webkit-scrollbar-track {
  background: #f1f3f4;
  border-radius: 4px;
}

.cuts-carousel::-webkit-scrollbar-thumb {
  background: #c1c8cd;
  border-radius: 4px;
}

.cuts-carousel::-webkit-scrollbar-thumb:hover {
  background: #a8b2ba;
}

/* Grooming Cut Card */
.grooming-cut-card {
  flex: 0 0 280px;
  background: var(--bg-color, #ffffff);
  border: 2px solid var(--border-color, #e0e0e0);
  border-radius: 16px;
  padding: 1rem;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.grooming-cut-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  border-color: var(--border-color, #e0e0e0);
}

.grooming-cut-card.selected {
  border-color: var(--border-color, #4CAF50);
  background: var(--bg-color, #f8fff8);
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.grooming-cut-card.selected::before {
  content: '✓';
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--border-color, #4CAF50);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: bold;
  z-index: 2;
}

/* Cut Image Container */
.cut-image-container {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto 1rem auto;
  border-radius: 50%;
  overflow: hidden;
  background: #f8f9fa;
  border: 3px solid var(--border-color, #e0e0e0);
}

.cut-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.cut-image:hover {
  transform: scale(1.05);
}

.cut-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.cut-image-container:hover .cut-overlay {
  opacity: 1;
}

.cut-overlay i {
  color: white;
  font-size: 1.5rem;
}

/* Cut Info */
.cut-info {
  text-align: center;
}

.cut-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2c3e50;
  margin: 0 0 0.5rem 0;
}

.cut-description {
  font-size: 0.9rem;
  color: #6c757d;
  line-height: 1.4;
  margin: 0 0 1rem 0;
  min-height: 2.8rem;
}

/* Cut Select Button */
.cut-select-btn {
  background: var(--border-color, #007bff);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
}

.cut-select-btn:hover {
  background: var(--border-color, #0056b3);
  transform: translateY(-1px);
}

.cut-select-btn i {
  font-size: 0.8rem;
}

.grooming-cut-card.selected .cut-select-btn {
  background: #28a745;
  color: white;
}

.grooming-cut-card.selected .cut-select-btn:hover {
  background: #1e7e34;
}

/* Selected Cut Indicator */
.selected-cut-indicator {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #28a745;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(40, 167, 69, 0.3);
  z-index: 1000;
  display: none;
  animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.selection-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.selection-content i {
  font-size: 1.2rem;
}

.clear-selection {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
}

.clear-selection:hover {
  background: rgba(255,255,255,0.3);
}

/* Placeholder State */
.cuts-placeholder {
  text-align: center;
  padding: 3rem 1rem;
  color: #6c757d;
}

.cuts-placeholder i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: #dee2e6;
}

.cuts-placeholder p {
  font-size: 1.1rem;
  margin: 0;
}

/* No Cuts Message */
.no-cuts-message {
  text-align: center;
  padding: 2rem;
  color: #6c757d;
}

.no-cuts-message p {
  font-size: 1rem;
  margin: 0;
}

/* ============================================
   Responsive Design for Grooming Cuts
   ============================================ */

/* Tablet */
@media (max-width: 968px) {
  #groomingCutsCarousel {
    margin: 1.5rem 0;
    padding: 1rem;
  }
  
  .grooming-cut-card {
    flex: 0 0 240px;
  }
  
  .cut-image-container {
    width: 140px;
    height: 140px;
  }
  
  .selected-cut-indicator {
    bottom: 1rem;
    right: 1rem;
    padding: 0.75rem 1rem;
  }
}

/* Mobile */
@media (max-width: 600px) {
  #groomingCutsCarousel {
    margin: 1rem 0;
    padding: 0.75rem;
  }
  
  .cuts-header h3 {
    font-size: 1.3rem;
  }
  
  .cuts-header p {
    font-size: 0.9rem;
  }
  
  .grooming-cut-card {
    flex: 0 0 200px;
    padding: 0.75rem;
  }
  
  .cut-image-container {
    width: 120px;
    height: 120px;
  }
  
  .cut-name {
    font-size: 1rem;
  }
  
  .cut-description {
    font-size: 0.85rem;
    min-height: 2.4rem;
  }
  
  .cut-select-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
  }
  
  .selected-cut-indicator {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 0;
    padding: 1rem;
  }
  
  .cuts-placeholder {
    padding: 2rem 1rem;
  }
  
  .cuts-placeholder i {
    font-size: 2.5rem;
  }
}

/* Extra Small Mobile */
@media (max-width: 400px) {
  .grooming-cut-card {
    flex: 0 0 180px;
  }
  
  .cut-image-container {
    width: 100px;
    height: 100px;
  }
}