:root {
  --background-color: #dfb96e; /* Warm grey background */
  --foreground-color: #000000; /* Dark grey foreground */
  --selected-color: #ffffff; /* Dark grey foreground */
  --border-radius: 6px;
}

.order-type-container {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0 0.75rem 0.75rem;
  background-color: var(--background-color);
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  z-index: 1000;
}

.toggle-container {
  display: flex;
  background-color: white;
  padding: 0;
  border-radius: var(--border-radius);
  border: 2px solid var(--foreground-color);
  overflow: hidden;
}

.toggle-btn {
  border: none;
  background: var(--background-color);
  padding: 0.1875rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground-color);
  border-radius: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.toggle-btn:first-child {
  border-right: 1px solid var(--foreground-color);
}

.toggle-btn:last-child {
  border-left: 1px solid var(--foreground-color);
}

.toggle-btn.active {
  background-color: var(--foreground-color);
  color: white;
}

.input-container {
  flex-grow: 1;
  position: relative;
}

.input-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  position: relative;
  z-index: 1051;
}

.form-control {
  flex-grow: 1;
  padding: 0.1875rem 0;
  font-size: 0.875rem;
  background: none;
  color: var(--foreground-color);
  border-radius: 0 !important;
  height: 24px; /* Standardize height */
  line-height: 1.5;
  margin: 0;
}

/* Style for datetime and address inputs */
input.form-control {
  border: none;
  border-bottom: 2px solid var(--foreground-color);
  outline: none;
  border-radius: 0;
  font-size: 0.875rem; /* Match font size */
  height: 24px; /* Match height */
  padding: 0.1875rem 0;
  margin: 0;
}

/* Style for ASAP text */
.asap-text.form-control {
  border: none;
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
  padding: 0.1875rem 0;
  height: 24px;
  font-size: 0.875rem;
  line-height: 1.5;
  flex: 1;
  margin: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.edit-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 8px;
  color: var(--foreground-color);
  cursor: pointer;
  min-width: 44px; /* Minimum touch target size */
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.edit-btn:hover {
  opacity: 0.7;
}

.asap-state {
  display: flex;
  flex-grow: 1;
}

.time-state {
  display: none;
  flex-grow: 1;
}

.delivery-input {
  display: none;
}

.custom-time-picker {
  flex-grow: 1;
  display: none;
}

.day-selector {
  display: flex;
  gap: 1px;
  margin-bottom: 4px;
}

.day-option {
  flex: 1;
  text-align: center;
  padding: 0.1875rem 0.5rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  color: var(--foreground-color);
  font-size: 0.875rem;
}

.day-option.selected {
  border-bottom-color: var(--foreground-color);
}

.time-input {
  border: none;
  border-bottom: 2px solid var(--foreground-color);
  outline: none;
  width: 100%;
  padding: 0.1875rem 0;
  font-size: 0.875rem;
  background: none;
  color: var(--foreground-color);
  cursor: pointer;
}

/* TimePicki customization */
.timepicker_wrap {
  padding: 0;
  background: var(--background-color);
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 998;
  display: flex;
  flex-direction: row;
  gap: 2px;
  align-items: flex-start;
  justify-content: flex-start;
  width: auto;
}

/* Base styles for all control containers */
.timepicker_wrap > div {
  width: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  padding: 0;
  float: left !important;
}

/* Add some spacing between controls */
.timepicker_wrap > div:not(:last-child) {
  margin-right: 2px !important;
}

/* Control order */
.timepicker_wrap .day { 
  order: 1;
  float: left !important;
}
.timepicker_wrap .time { 
  order: 2;
  float: left !important;
}
.timepicker_wrap .mins { 
  order: 3;
  float: left !important;
}
.timepicker_wrap .meridian { 
  order: 4;
  float: left !important;
}

/* Style for control value containers */
.day_tx,
.ti_tx,
.mi_tx,
.mer_tx {
  width: 100%;
  text-align: center;
  padding: 4px 0;
  background: none;
  margin: 0;
  color: var(--foreground-color);
}

/* Style for control inputs */
.day_tx input,
.ti_tx input,
.mi_tx input,
.mer_tx input {
  width: 100%;
  text-align: center;
  border: none;
  background: none !important;
  color: var(--foreground-color);
  font-size: 0.875rem;
  padding: 0;
  margin: 0;
  height: auto !important;
  box-shadow: none !important;
}

/* Remove any white backgrounds from time controls */
.time,
.mins,
.meridian {
  background: none !important;
}

/* Style for up/down buttons */
.timepicker_wrap .prev,
.timepicker_wrap .next {
  width: 36px !important;
  background-color: transparent !important;
  border: 2px solid var(--foreground-color) !important;
  color: var(--foreground-color) !important;
  height: 36px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0;
  padding: 0;
}

/* Style for arrows */
.timepicker_wrap .prev:before,
.timepicker_wrap .next:before {
  color: var(--foreground-color) !important;
  border-color: var(--foreground-color) !important;
}

/* Remove any hover effects that might change colors */
.timepicker_wrap .prev:hover,
.timepicker_wrap .next:hover {
  background-color: transparent !important;
  color: var(--foreground-color) !important;
  border-color: var(--foreground-color) !important;
}

/* Remove any backgrounds from buttons */
.timepicker_wrap .action-next,
.timepicker_wrap .action-prev {
  background: none !important;
  width: 36px !important;
  height: 36px !important;
}

/* Remove any default TimePicki backgrounds */
.timepicker_wrap input {
  background: none !important;
}

/* Remove any borders or outlines */
.timepicker_wrap input:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* Remove arrow_top element */
.arrow_top {
  display: none;
}

/* Time input styling */
.time-input.form-control {
  border: none;
  border-bottom: 2px solid var(--foreground-color);
  border-radius: 0;
  padding: 0.1875rem 0;
  flex-grow: 1;
  width: calc(100% - 40px);
}

/* Override TimePicki default padding */
.timepicker_wrap .time,
.timepicker_wrap .mins,
.timepicker_wrap .meridian,
.timepicker_wrap .day {
  padding: 0 !important;
  margin: 0 !important;
}

/* Override TimePicki input containers */
.timepicker_wrap .ti_tx,
.timepicker_wrap .mi_tx,
.timepicker_wrap .mer_tx,
.timepicker_wrap .day_tx {
  margin: 0 !important;
  padding: 4px 0 !important;
}

.address-wrapper {
    position: relative;
    width: 100%;
}

.address-input {
    width: calc(100% - 12px);
    transition: border-color 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    font-size: 0.875rem !important; /* Force consistent font size */
    height: 24px !important; /* Force consistent height */
    padding: 0.1875rem 0 !important;
    margin: 0 12px 0 0 !important;
}

.address-input.invalid {
    border-bottom-color: #dc3545 !important;
}

.address-input.valid {
    border-bottom-color: #198754 !important;
}

.address-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.dropdown-item {
    padding: 12px 16px; /* Larger touch targets */
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-height: 44px; /* Minimum touch target size */
    display: flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
}

.dropdown-item:active {
    background-color: #e9ecef;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item:not(:last-child) {
    border-bottom: 1px solid #dee2e6;
}

.dropdown-item.valid-address {
    color: #198754;
}

.dropdown-item.invalid-address {
    color: #dc3545;
}

.geo-error-banner {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #dc3545;
    color: white;
    padding: 12px 16px;
    border-radius: var(--border-radius);
    margin-top: 4px;
    font-size: 0.875rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    .address-dropdown {
        max-height: 250px; /* Larger on mobile */
    }

    .dropdown-item {
        padding: 14px 16px; /* Even larger touch targets on mobile */
    }
}

/* Time Selection Modal */
.time-selection-modal {
    position: absolute;
    top: 55px;
    left: 0;
    width: 100%;
    z-index: 1050;
    background: var(--background-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    max-height: 280px;
    overflow: hidden;
}

.pickup-input {
    position: relative;
    z-index: 1050;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-content {
    position: relative;
    width: 100%;
    background-color: var(--background-color);
    padding: 8px;
    max-height: 280px;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 0 4px 8px;
}

.instruction-text {
    font-size: 13px;
    font-weight: 500;
    color: #000;
}

.time-columns {
    display: flex;
    gap: 4px;
    padding: 0;
    height: 220px;
}

.time-column {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    padding: 4px;
}

.column-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.time-pill {
    padding: 4px 8px;
    border-radius: 4px;
    background-color: var(--background-color);
    color: #000;
    text-align: center;
    cursor: pointer;
    font-size: 13px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease;
    border: 2px solid #000;
}

.time-pill.active {
    background-color: #000;
    color: white;
    border: 2px solid #000;
    outline: 2px solid #000;
}

.time-pill:hover:not(.active) {
    background-color: rgba(0,0,0,0.1);
}

/* Scrollbar styling for the columns */
.time-column::-webkit-scrollbar {
    width: 4px;
}

.time-column::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.time-column::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.time-column::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    .time-selection-modal {
        max-height: 260px;
    }

    .time-pill {
        min-height: 32px;
    }

    .time-columns {
        gap: 4px;
    }
}

/* Header with close button */
.modal-header {
    position: relative;
}

.modal-header .close-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #000;
    font-weight: 500;
}

.pickup-input .edit-btn.time-edit-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 8px;
    color: var(--foreground-color);
    cursor: pointer;
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    .time-wrapper .edit-btn.time-edit-btn {
        padding: 12px !important;  /* Larger touch target on mobile */
        min-width: 48px !important;  /* Slightly larger minimum width */
        height: 48px !important;  /* Slightly larger height */
        right: 8px !important;  /* Keep consistent with desktop */
    }

    .asap-text.form-control {
        padding-right: 3rem;  /* Make more room for the button on mobile */
    }

    .time-wrapper {
        position: relative;
        width: 100%;
        display: flex;
        align-items: center;
        touch-action: manipulation;  /* Optimize touch behavior */
    }
}

.time-edit-btn:hover {
    opacity: 0.7;
}

/* Add active state for touch devices */
.time-edit-btn:active {
    opacity: 0.5;
}

/* Ensure the modal is above other elements */
.pickup-input {
    position: relative;
    z-index: 1050;
}

/* Area Back Button */
.area-back-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 10px 0.75rem 3px 0.75rem;
    background-color: var(--background-color);
    color: var(--foreground-color);
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.area-back-button i {
    font-size: 1rem;
    color: var(--foreground-color);
}

.back-text {
    font-weight: bold;
    font-size: 0.875rem;
    color: var(--foreground-color);
}



/* Toggle Switch Container */
.area-toggle-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    justify-content: center;
    background-color: #f5f5f5;
    border-top: 1px solid #ddd;
    margin-top: 1rem;
}

.toggle-label {
    font-size: 0.875rem;
    color: #333;
    font-weight: 500;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--foreground-color);
}

input:checked + .slider:before {
    transform: translateX(24px);
} 