/* =============================================================================
   IFTAR - BOOKING SECTION LAYOUT
   ============================================================================= */

.booking-section {
  padding: 40px 0 40px 0;
  background-color: #f9fafb;
  font-family: 'Raleway', sans-serif;
  width: 100%;
}

.booking-section .container {
  width: 100%;
}

.booking-grid {
  display: flex;
  flex-direction: column;
  gap: 0px;
  position: relative;
  width: 100%;
}

@media (min-width: 1024px) {
  .booking-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-auto-flow: dense;
    gap: 32px;
  }
}

/* --- Form Column & Card Styles --- */
.form-column {
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Mobile: Reorder cards - Urutan: Pilih Tipe & Promo, Informasi Pemesan, Keranjang */
@media (max-width: 1023px) {
  /* form-column tampilkan pertama, tapi card didalamnya di-reorder */
  .form-column {
    order: 1;
  }
  
  /* Card 1 (Pilih Tipe & Promo) - tampilkan pertama di dalam form-column */
  .form-column .form-card:first-child {
    order: 1;
  }
  
  /* Card 2 (Informasi Pemesan) - tampilkan kedua di dalam form-column */
  .form-column .form-card:last-child {
    order: 2;
  }
  
  /* Sidebar (Keranjang) - tampilkan terakhir setelah form-column */
  .sidebar-column {
    order: 2;
  }
}

.sidebar-column {
  width: 100%;
  position: relative;
}

@media (min-width: 1024px) {
  .form-column {
    grid-column: 1;
  }

  .sidebar-column {
    grid-column: 2;
  }
}

.form-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.card-header-text {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f3f4f6;
}

.form-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1F2937;
  margin: 0 0 4px 0;
}

.card-subtitle {
  font-size: 0.875rem;
  color: #6B7280;
}

/* Form Groups */
.form-group {
  margin-bottom: 16px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.form-group-row:last-child {
  margin-bottom: 0;
}

.form-group-row .form-group {
  margin-bottom: 0;
}

@media (min-width: 768px) {
  .form-group-row {
    grid-template-columns: 1fr 1fr;
  }
}

.form-group-row.align-end {
  align-items: end;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  color: #1F2937;
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  font-size: 0.875rem;
  transition: all 0.2s;
  font-family: 'Raleway', sans-serif;
  background-color: white;
}

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23374151' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.form-control:focus {
  outline: none;
  border-color: #871968;
  box-shadow: 0 0 0 3px rgba(135, 25, 104, 0.1);
}

.date-input-wrapper {
  position: relative;
  cursor: pointer;
}

.date-input-wrapper .form-control {
  padding-right: 12px;
  cursor: pointer;
}

.date-input-wrapper input[type="date"] {
  cursor: pointer;
}

.date-input-wrapper input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: auto;
  height: auto;
  color: transparent;
  background: transparent;
  opacity: 0;
}

/* Phone Input Special Styling */
.phone-input-group {
  display: flex;
  gap: 10px;
}

.phone-prefix {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  background-color: #F9FAFB;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  min-width: 75px;
}

.info-note {
  font-size: 0.75rem;
  color: #EF4444;
  font-weight: 600;
  margin-top: 12px;
  margin-bottom: 0;
}

/* --- Promo Group --- */
.promo-group {
  margin-bottom: 16px;
}

.promo-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  color: #1F2937;
  margin-bottom: 8px;
}

.form-control-sm {
  width: 100%;
  height: 44px;
  /* padding: 0 14px; */
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  font-size: 0.875rem;
  transition: all 0.2s;
  font-family: 'Raleway', sans-serif;
}

.form-control-sm:focus {
  outline: none;
  border-color: #871968;
  box-shadow: 0 0 0 3px rgba(135, 25, 104, 0.1);
}

.form-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 10px;
}

.form-label .required {
    color: #EF4444;
    margin-left: 3px;
}

.form-label .required {
    color: #EF4444;
    margin-left: 3px;
}

/* --- Daily Menu Button --- */
.daily-menu-container {
  margin-bottom: 16px;
}

.daily-menu-card {
  background: linear-gradient(135deg, rgba(135, 25, 104, 0.05) 0%, rgba(135, 25, 104, 0.02) 100%);
  border: 2px solid #871968;
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(135, 25, 104, 0.1);
}

/* .daily-menu-card:hover {
  box-shadow: 0 4px 12px rgba(135, 25, 104, 0.2);
  transform: translateY(-1px);
} */

.daily-menu-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: #871968;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.daily-menu-content {
  flex: 1;
  min-width: 0;
}

.daily-menu-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #871968;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.daily-menu-button {
  flex-shrink: 0;
  background: #871968;
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  white-space: nowrap;
  cursor: pointer;
  font-family: 'Raleway', sans-serif;
}

.daily-menu-button:hover {
  background: #6b1454;
  color: white;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(135, 25, 104, 0.2);
  transform: translateX(2px);
}

.daily-menu-button:active {
  transform: translateX(2px) scale(0.98);
}

.daily-menu-button svg {
  width: 14px;
  height: 14px;
}

/* Mobile Responsive for Daily Menu */
@media (max-width: 480px) {
  .daily-menu-card {
    padding: 12px 14px;
    gap: 10px;
  }
  
  .daily-menu-icon {
    width: 36px;
    height: 36px;
  }
  
  .daily-menu-icon svg {
    width: 18px;
    height: 18px;
  }
  
  .daily-menu-content {
    text-align: left;
  }
  
  .daily-menu-title {
    font-size: 0.875rem;
    white-space: normal;
  }
  
  .daily-menu-button {
    padding: 8px 12px;
    font-size: 0.75rem;
    gap: 4px;
  }
  
  .daily-menu-button svg {
    width: 12px;
    height: 12px;
  }
}

/* --- Package Selection Container --- */
.package-selection-container {
  margin-bottom: 16px;
}

.package-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
}

@media (min-width: 768px) {
  .package-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Package Card Styles --- */
.package-card {
  background: white;
  border: 2px solid #E5E7EB;
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.package-card:hover {
  border-color: #871968;
  box-shadow: 0 4px 12px rgba(135, 25, 104, 0.15);
}

.package-card.selected {
  border-color: #871968;
  background-color: rgba(135, 25, 104, 0.05);
  box-shadow: 0 0 0 3px rgba(135, 25, 104, 0.1);
}

.package-card.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.package-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.package-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: #1F2937;
  margin: 0;
}

.package-card.selected .package-card-name {
  color: #871968;
}

.package-card-badge {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.package-card-period {
  font-size: 0.75rem;
  color: #6B7280;
  margin-bottom: 12px;
}

.package-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.package-card-price-group {
  flex: 1;
}

.package-card-price-label {
  font-size: 0.7rem;
  color: #6B7280;
  display: block;
  margin-bottom: 2px;
}

.package-card-price {
  font-size: 1.125rem;
  font-weight: 800;
  color: #871968;
  display: block;
}

.package-card-quota {
  text-align: right;
}

.package-card-quota-text {
  font-size: 0.7rem;
  color: #EF4444;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.package-card-quota-text svg {
  width: 12px;
  height: 12px;
}

/* Hide quota by default, only show when < 16 */
.package-card-quota.hidden {
  display: none;
}

/* Package Card Selection Indicator */
.package-card::before {
  content: '';
  position: absolute;
  top: 12px;
  right: 12px;
  width: 20px;
  height: 20px;
  border: 2px solid #D1D5DB;
  border-radius: 50%;
  transition: all 0.2s;
}

.package-card.selected::before {
  background-color: #871968;
  border-color: #871968;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='white' d='M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px;
}

/* --- Quantity Control with +/- Buttons --- */
.quantity-control {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: 180px;
}

.btn-qty-control {
  width: 44px;
  height: 44px;
  border: 1px solid #D1D5DB;
  background: white;
  color: #871968;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-qty-control:hover:not(:disabled) {
  background-color: rgba(135, 25, 104, 0.1);
  border-color: #871968;
}

.btn-qty-control:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-minus {
  border-radius: 6px 0 0 6px;
  border-right: none;
}

.btn-plus {
  border-radius: 0 6px 6px 0;
  border-left: none;
}

.qty-display {
  width: 60px;
  height: 44px;
  border: 1px solid #D1D5DB;
  border-left: none;
  border-right: none;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: #1F2937;
  background: #F9FAFB;
  pointer-events: none;
  -moz-appearance: textfield;
}

.qty-display::-webkit-inner-spin-button,
.qty-display::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.alert-box {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  color: #9CA3AF;
  font-size: 0.875rem;
  background: #F9FAFB;
  border: 1px dashed #D1D5DB;
  border-radius: 8px;
  margin-bottom: 16px;
}

.btn-add-cart {
  width: 100%;
  height: 44px;
  background-color: white;
  border: 2px solid #871968;
  color: #871968;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  font-size: 0.875rem;
}

.btn-add-cart:hover:not(:disabled) {
  background-color: rgba(135, 25, 104, 0.05);
}

.btn-add-cart:disabled {
  border-color: #D1D5DB;
  color: #9CA3AF;
  background-color: #F3F4F6;
  cursor: not-allowed;
}

/* --- Sidebar Cart (Sticky) --- */
.cart-card {
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 120px);
}

.sticky-cart {
  position: sticky;
  top: 100px;
  z-index: 20;
}

.cart-header {
  padding: 16px;
  background-color: rgba(135, 25, 104, 0.05);
  border-bottom: 1px solid #E5E7EB;
}

.cart-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #871968;
}

.cart-items-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  min-height: 150px;
}

/* Cart Item Style */
.cart-item {
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
  position: relative;
}

.cart-item-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 8px;
}

.item-name-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.item-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1F2937;
}

.item-type {
  font-size: 0.65rem;
  background: rgba(135, 25, 104, 0.15);
  color: #871968;
  padding: 4px 8px;
  border-radius: 3px;
  text-transform: uppercase;
  font-weight: 700;
  white-space: nowrap;
}

.item-date {
  font-size: 0.75rem;
  color: #6B7280;
  margin-bottom: 8px;
}

.item-pricing {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 0.75rem;
  gap: 8px;
}

.item-qty-price {
  color: #6B7280;
  flex: 1;
}

.item-subtotal {
  font-weight: 700;
  font-size: 1rem;
  color: #1F2937;
  min-width: 90px;
  text-align: right;
}

/* Discount Badge Styles */
.item-discount-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: white;
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 600;
  margin-top: 8px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
  animation: slideInUp 0.3s ease-out;
}

.item-discount-badge.percentage {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.item-discount-badge svg {
  flex-shrink: 0;
  opacity: 0.9;
}

.item-discount-badge span {
  white-space: nowrap;
}

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

.btn-remove-item {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: #D1D5DB;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.btn-remove-item:hover {
  color: #EF4444;
}

.cart-empty-state {
  text-align: center;
  color: #9CA3AF;
  padding: 32px 0;
}

.cart-empty-state p {
  margin-bottom: 4px;
  font-size: 0.875rem;
}

.cart-empty-state small {
  font-size: 0.75rem;
}

/* Footer */
.cart-footer {
  padding: 16px;
  border-top: 1px solid #E5E7EB;
  background: white;
  border-radius: 0 0 8px 8px;
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 16px;
  padding-top: 12px;
  border-top: 1px dashed #E5E7EB;
}

.total-row span:first-child {
  font-weight: 700;
  font-size: 0.875rem;
  color: #1F2937;
}

.total-amount {
  font-size: 1.5rem;
  font-weight: 800;
  color: #871968;
}

.btn-submit {
  width: 100%;
  padding: 12px;
  background-color: #871968;
  color: white;
  border: none;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  margin-bottom: 12px;
  transition: background 0.2s;
}

.btn-submit:hover:not(:disabled) {
  background-color: #6a1450;
}

.btn-submit:disabled {
  background-color: #D1D5DB;
  cursor: not-allowed;
}

.btn-help {
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 1px solid #871968;
  color: #871968;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
}

.btn-help:hover {
  background-color: rgba(135, 25, 104, 0.05);
}

/* =============================================================================
   ERROR MESSAGE STYLES
   ============================================================================= */

.error-message {
  color: #EF4444;
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 6px;
  display: none;
  animation: fadeInError 0.3s ease-in;
}

@keyframes fadeInError {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.error-field {
  border-color: #EF4444 !important;
  animation: shakeError 0.4s ease-in-out;
}

@keyframes shakeError {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

/* Error state for form controls */
.form-control.error-field {
  border-color: #EF4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-control.error-field:focus {
  border-color: #EF4444 !important;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
}

/* Error state for package cards */
#packageCardsGrid.error-field {
  border: 2px solid #EF4444;
  border-radius: 8px;
  padding: 8px;
  animation: shakeError 0.4s ease-in-out;
}

/* =============================================================================
   FLOATING BOOKING BUTTON
   ============================================================================= */

.floating-booking-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  padding: 12px 24px;
  /* width: 120px; */
  /* height: 60px; */
  /* background: linear-gradient(135deg, #871968 0%, #5a1145 100%); */
  background: #871968;
  color: white;
  border: none;
  border-radius: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(135, 25, 104, 0.4);
  transition: all 0.3s ease;
  z-index: 1000;
  font-family: 'Raleway', sans-serif;
}

.floating-booking-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(135, 25, 104, 0.5);
  background: linear-gradient(135deg, #6a1450 0%, #4a0d35 100%);
}

.floating-booking-btn:active {
  transform: translateY(-2px);
}

.floating-booking-btn svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.floating-booking-btn span {
  white-space: nowrap;
}

/* Animation for floating button */
@keyframes floatPulse {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.floating-booking-btn {
  animation: floatPulse 3s ease-in-out infinite;
}

.floating-booking-btn:hover {
  animation: none;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .floating-booking-btn {
    bottom: 20px;
    right: 20px;
    width: 100px;
    height: 50px;
    font-size: 0.85rem;
  }
  
  .floating-booking-btn svg {
    width: 20px;
    height: 20px;
  }
}

/* Hide on very small screens to avoid blocking content */
@media (max-width: 480px) {
  .floating-booking-btn {
    bottom: 15px;
    right: 15px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    padding: 0;
  }
  
  .floating-booking-btn span {
    display: none;
  }
  
  .floating-booking-btn svg {
    margin: 0;
  }
}
