/**
 * Fostore Standardized Modals & Input Design System
 * Cohesive glassmorphism, responsive sheet for mobile, unified inputs and tokenized z-index layers.
 */

:root {
  /* Z-Index Hierarchy Tokens */
  --z-base: 1;
  --z-sticky: 30;
  --z-drawer: 40;
  --z-dropdown: 50;
  --z-modal-backdrop: 9990;
  --z-modal-container: 9995;
  --z-toast-layer: 99999;

  /* Modal Colors & Radius */
  --fm-bg: #ffffff;
  --fm-bg-glass: rgba(255, 255, 255, 0.95);
  --fm-border: #e2e8f0;
  --fm-border-focus: #4f46e5;
  --fm-backdrop: rgba(15, 23, 42, 0.6);
  --fm-radius: 24px;
  --fm-radius-sm: 14px;
  --fm-radius-input: 16px;
  --fm-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  --fm-font: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Input Tokens */
  --fm-input-bg: #f8fafc;
  --fm-input-bg-focus: #ffffff;
  --fm-input-border: #e2e8f0;
  --fm-input-text: #0f172a;
  --fm-input-placeholder: #94a3b8;
  --fm-input-ring: rgba(79, 70, 229, 0.15);
}

/* Prevent body scroll when modal is active */
body.fostore-modal-open {
  overflow: hidden !important;
  touch-action: none;
}

/* ==========================================================================
   MODAL BACKDROP & WRAPPER
   ========================================================================== */
.fostore-modal-wrapper {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background-color: var(--fm-backdrop);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s;
}

.fostore-modal-wrapper.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ==========================================================================
   MODAL DIALOG CARD
   ========================================================================== */
.fostore-modal-dialog {
  position: relative;
  z-index: var(--z-modal-container);
  width: 100%;
  background: var(--fm-bg-glass);
  border: 1px solid var(--fm-border);
  border-radius: var(--fm-radius);
  box-shadow: var(--fm-shadow);
  font-family: var(--fm-font);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 3rem);
  transform: scale(0.95) translateY(16px);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.25s ease-out;
}

.fostore-modal-wrapper.active .fostore-modal-dialog {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Modal Sizes */
.fostore-modal-sm { max-width: 420px; }
.fostore-modal-md { max-width: 540px; }
.fostore-modal-lg { max-width: 720px; }
.fostore-modal-xl { max-width: 960px; }
.fostore-modal-2xl { max-width: 1180px; }
.fostore-modal-full { max-width: calc(100vw - 2.5rem); height: calc(100vh - 2.5rem); }

/* ==========================================================================
   MODAL HEADER, BODY & FOOTER
   ========================================================================== */
.fostore-modal-header {
  padding: 1.5rem 1.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--fm-border);
  background: transparent;
  flex-shrink: 0;
}

.fostore-modal-title-area {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.fostore-modal-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.fostore-modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.fostore-modal-subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.875rem;
  color: #64748b;
  font-weight: 500;
}

.fostore-modal-close {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--fm-border);
  background: rgba(241, 245, 249, 0.7);
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.fostore-modal-close:hover {
  background: #f1f5f9;
  color: #0f172a;
  transform: rotate(90deg) scale(1.05);
}

.fostore-modal-body {
  padding: 1.75rem;
  overflow-y: auto;
  flex: 1 1 auto;
  overscroll-behavior: contain;
}

/* Custom Slim Scrollbar for Modal Body */
.fostore-modal-body::-webkit-scrollbar {
  width: 6px;
}
.fostore-modal-body::-webkit-scrollbar-track {
  background: transparent;
}
.fostore-modal-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}
.fostore-modal-body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.fostore-modal-footer {
  padding: 1.25rem 1.75rem;
  border-top: 1px solid var(--fm-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background: rgba(248, 250, 252, 0.6);
  flex-shrink: 0;
}

/* ==========================================================================
   STANDARDIZED FORM CONTROLS & INPUTS
   ========================================================================== */
.fostore-form-group {
  margin-bottom: 1.25rem;
}

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

.fostore-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
  margin-bottom: 0.5rem;
  margin-left: 0.25rem;
}

.fostore-label .required-indicator {
  color: #ef4444;
  margin-left: 0.2rem;
}

.fostore-input-container {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.fostore-input,
.fostore-select,
.fostore-textarea {
  width: 100%;
  font-family: var(--fm-font);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--fm-input-text);
  background-color: var(--fm-input-bg);
  border: 1.5px solid var(--fm-input-border);
  border-radius: var(--fm-radius-input);
  padding: 0.8125rem 1.125rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
  box-sizing: border-box;
}

/* Enhanced Native Select with Custom SVG Arrow and Option Styles */
.fostore-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.125rem center;
  background-size: 0.95rem;
  padding-right: 2.875rem;
  cursor: pointer;
}

.fostore-select option {
  background-color: #ffffff;
  color: #0f172a;
  padding: 0.875rem 1.125rem;
  font-family: var(--fm-font);
  font-size: 0.9375rem;
  font-weight: 500;
}

.fostore-select option:checked {
  background-color: #eef2ff;
  color: #4f46e5;
  font-weight: 700;
}

.fostore-input::placeholder,
.fostore-textarea::placeholder {
  color: var(--fm-input-placeholder);
  font-weight: 400;
}

.fostore-input:focus,
.fostore-select:focus,
.fostore-textarea:focus {
  background-color: var(--fm-input-bg-focus);
  border-color: var(--fm-border-focus);
  box-shadow: 0 0 0 4px var(--fm-input-ring), 0 2px 4px rgba(0, 0, 0, 0.04);
}

.fostore-input:disabled,
.fostore-select:disabled,
.fostore-textarea:disabled {
  opacity: 0.55;
  background-color: #f1f5f9;
  cursor: not-allowed;
}

/* ==========================================================================
   CUSTOM SELECT DROPDOWN COMPONENT (.fostore-custom-select)
   ========================================================================== */
.fostore-custom-select {
  position: relative;
  width: 100%;
  font-family: var(--fm-font);
}

.fostore-custom-select.open {
  z-index: 100;
}

.fostore-custom-select.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.fostore-custom-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8125rem 1.125rem;
  background-color: var(--fm-input-bg);
  border: 1.5px solid var(--fm-input-border);
  border-radius: var(--fm-radius-input);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--fm-input-text);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  text-align: left;
  user-select: none;
  outline: none;
}

.fostore-custom-select-trigger:hover {
  background-color: #ffffff;
  border-color: #cbd5e1;
}

.fostore-custom-select.open .fostore-custom-select-trigger,
.fostore-custom-select-trigger:focus {
  background-color: var(--fm-input-bg-focus);
  border-color: var(--fm-border-focus);
  box-shadow: 0 0 0 4px var(--fm-input-ring), 0 2px 4px rgba(0, 0, 0, 0.04);
}

.fostore-custom-select-trigger .selected-content {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
  flex: 1;
}

.fostore-custom-select-trigger .trigger-icon {
  color: #64748b;
  font-size: 0.9375rem;
  flex-shrink: 0;
}

.fostore-custom-select-trigger .selected-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

.fostore-custom-select-trigger .chevron-icon {
  color: #64748b;
  font-size: 0.8125rem;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  margin-left: 0.75rem;
}

.fostore-custom-select.open .chevron-icon {
  transform: rotate(180deg);
  color: #4f46e5;
}

/* Compact / Small Select Variant (Ideal for table cells and toolbars) */
.fostore-custom-select-sm .fostore-custom-select-trigger {
  padding: 0.375rem 0.65rem;
  font-size: 0.8125rem;
  font-weight: 700;
  border-radius: 12px;
  min-height: 34px;
}

.fostore-custom-select-sm .fostore-custom-select-trigger .selected-text {
  font-size: 0.8125rem;
  font-weight: 700;
}

.fostore-custom-select-sm .fostore-custom-select-trigger .chevron-icon {
  font-size: 0.6875rem;
  margin-left: 0.375rem;
}

.fostore-custom-select-sm .fostore-custom-select-menu {
  min-width: 170px;
  font-size: 0.8125rem;
}

.fostore-custom-select-sm .fostore-custom-select-option {
  padding: 0.45rem 0.65rem;
}

.fostore-custom-select-sm .fostore-custom-select-option .option-title {
  font-size: 0.8125rem;
}

/* Dropdown Menu Container */
.fostore-custom-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 18px;
  box-shadow: 0 20px 45px -4px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.04);
  z-index: 99999 !important;
  padding: 0.375rem;
  max-height: 280px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.98);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.fostore-custom-select.open .fostore-custom-select-menu,
.fostore-custom-select-menu.is-open {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateY(0) scale(1) !important;
}

/* Card and filter containers that hold selects must not clip popups */
.filters-card,
.filters-premium,
.filter-container,
.fostore-filters-card,
.card-filter {
  position: relative !important;
  z-index: 30;
  overflow: visible !important;
}

.table-section-premium,
.admin-table-card,
.results-card {
  position: relative !important;
  z-index: 10;
}

/* Stacking context elevation when select is active */
.fostore-has-open-select,
.filters-card:has(.fostore-custom-select.open),
.filters-premium:has(.fostore-custom-select.open),
.filter-container:has(.fostore-custom-select.open) {
  position: relative !important;
  z-index: 9999 !important;
}

.fostore-custom-select-search-wrap {
  position: relative;
  margin: 0.25rem 0.25rem 0.5rem;
}

.fostore-custom-select-search-wrap .search-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.75rem;
}

.fostore-custom-select-search-input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-family: var(--fm-font);
  font-size: 0.8125rem;
  color: #0f172a;
  outline: none;
  box-sizing: border-box;
}

.fostore-custom-select-search-input:focus {
  border-color: #4f46e5;
  background: #ffffff;
}

.fostore-custom-select-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.fostore-custom-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.875rem;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.fostore-custom-select-option:hover,
.fostore-custom-select-option.highlighted {
  background-color: #f1f5f9;
  color: #0f172a;
}

.fostore-custom-select-option.selected {
  background-color: #eef2ff;
  color: #4f46e5;
  font-weight: 700;
}

.fostore-custom-select-option .option-label-wrap {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
}

.fostore-custom-select-option .option-icon {
  font-size: 0.9375rem;
  color: #64748b;
  flex-shrink: 0;
}

.fostore-custom-select-option.selected .option-icon {
  color: #4f46e5;
}

.fostore-custom-select-option .option-title {
  display: block;
  font-size: 0.875rem;
}

.fostore-custom-select-option .option-desc {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 400;
  margin-top: 0.1rem;
}

.fostore-custom-select-option .option-check {
  font-size: 0.75rem;
  color: #4f46e5;
  opacity: 0;
  transition: opacity 0.15s ease;
  flex-shrink: 0;
  margin-left: 0.5rem;
}

.fostore-custom-select-option.selected .option-check {
  opacity: 1;
}

/* Input with Prefix / Suffix Icons */
.fostore-input-container .fostore-input-icon-left {
  position: absolute;
  left: 1.125rem;
  color: #94a3b8;
  pointer-events: none;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fostore-input-container.has-icon-left .fostore-input {
  padding-left: 2.75rem;
}

.fostore-input-container .fostore-input-icon-right {
  position: absolute;
  right: 1.125rem;
  color: #94a3b8;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fostore-input-container.has-icon-right .fostore-input {
  padding-right: 2.75rem;
}

/* Helper text & validation errors */
.fostore-hint {
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 0.375rem;
  margin-left: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.fostore-error-msg {
  font-size: 0.8125rem;
  color: #ef4444;
  font-weight: 600;
  margin-top: 0.375rem;
  margin-left: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.fostore-form-group.has-error .fostore-input,
.fostore-form-group.has-error .fostore-select,
.fostore-form-group.has-error .fostore-textarea {
  border-color: #ef4444;
  background-color: #fef2f2;
}
.fostore-form-group.has-error .fostore-input:focus {
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
}

/* ==========================================================================
   STANDARDIZED TOGGLE SWITCH
   ========================================================================== */
.fostore-toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--fm-input-bg);
  border: 1.5px solid var(--fm-input-border);
  border-radius: var(--fm-radius-input);
  cursor: pointer;
  transition: all 0.2s ease;
}

.fostore-toggle-card:hover {
  border-color: #cbd5e1;
  background: #ffffff;
}

.fostore-switch {
  position: relative;
  width: 48px;
  height: 26px;
  display: inline-block;
  flex-shrink: 0;
}

.fostore-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.fostore-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5e1;
  border-radius: 999px;
  transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.fostore-switch-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.fostore-switch input:checked + .fostore-switch-slider {
  background-color: #4f46e5;
}

.fostore-switch input:checked + .fostore-switch-slider:before {
  transform: translateX(22px);
}

/* ==========================================================================
   STANDARDIZED DROPZONE / FILE UPLOADER
   ========================================================================== */
.fostore-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--fm-radius-input);
  padding: 2rem 1.5rem;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.fostore-dropzone:hover,
.fostore-dropzone.dragover {
  border-color: #4f46e5;
  background: rgba(238, 242, 255, 0.5);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.fostore-dropzone-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: #eef2ff;
  color: #4f46e5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.875rem;
  font-size: 1.5rem;
  transition: transform 0.25s ease;
}

.fostore-dropzone:hover .fostore-dropzone-icon {
  transform: translateY(-3px) scale(1.05);
}

/* ==========================================================================
   MOBILE BOTTOM-SHEET BEHAVIOR (< 640px)
   ========================================================================== */
@media (max-width: 639.98px) {
  .fostore-modal-wrapper {
    padding: 0;
    align-items: flex-end;
  }

  .fostore-modal-wrapper .fostore-modal-dialog {
    max-width: 100% !important;
    width: 100%;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: 28px;
    border-top-right-radius: 28px;
    max-height: 90vh;
    transform: translateY(100%);
  }

  .fostore-modal-wrapper.active .fostore-modal-dialog {
    transform: translateY(0);
  }

  .fostore-modal-wrapper .fostore-modal-dialog::before {
    content: "";
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 5px;
    background: #cbd5e1;
    border-radius: 999px;
    z-index: 10;
  }

  .fostore-modal-wrapper .fostore-modal-header {
    padding-top: 2rem;
  }

  .fostore-modal-wrapper .fostore-modal-footer {
    flex-direction: column-reverse;
    gap: 0.5rem;
  }

  .fostore-modal-wrapper .fostore-modal-footer > * {
    width: 100%;
  }
}

.fostore-modal-wrapper.force-sheet {
  padding: 0 !important;
  align-items: flex-end !important;
}

.fostore-modal-wrapper.force-sheet .fostore-modal-dialog {
  max-width: 100% !important;
  width: 100% !important;
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  border-top-left-radius: 28px !important;
  border-top-right-radius: 28px !important;
  max-height: 90vh !important;
  transform: translateY(100%) !important;
}

.fostore-modal-wrapper.force-sheet.active .fostore-modal-dialog {
  transform: translateY(0) !important;
}

.fostore-modal-wrapper.force-sheet .fostore-modal-dialog::before {
  content: "" !important;
  position: absolute !important;
  top: 10px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 44px !important;
  height: 5px !important;
  background: #cbd5e1 !important;
  border-radius: 999px !important;
  z-index: 10 !important;
}

.fostore-modal-wrapper.force-sheet .fostore-modal-header {
  padding-top: 2rem !important;
}

.fostore-modal-wrapper.force-sheet .fostore-modal-footer {
  flex-direction: column-reverse !important;
  gap: 0.5rem !important;
}

.fostore-modal-wrapper.force-sheet .fostore-modal-footer > * {
  width: 100% !important;
}

/* ==========================================================================
   STANDARDIZED DATE, DATETIME & TIME PICKERS
   ========================================================================== */
.fostore-date-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.fostore-date-input {
  font-family: var(--fm-font);
  color: #0f172a;
  font-weight: 500;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.fostore-date-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
  padding: 4px;
  border-radius: 8px;
  transition: all 0.2s ease;
  margin-right: 0.25rem;
}

.fostore-date-input::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  background-color: #f1f5f9;
}

/* Clear button on date inputs */
.fostore-date-clear-btn {
  position: absolute;
  right: 2.25rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.8125rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  z-index: 2;
}

.fostore-date-clear-btn:hover {
  color: #ef4444;
  background-color: #fee2e2;
}

/* Size variants */
.fostore-date-sm .fostore-date-input {
  height: 36px;
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
  padding-left: 2.35rem;
  font-size: 0.8125rem;
  border-radius: 12px;
}

.fostore-date-sm .fostore-input-icon-left {
  left: 0.75rem;
  font-size: 0.875rem;
}

.fostore-date-sm .fostore-date-clear-btn {
  right: 1.85rem;
  font-size: 0.75rem;
}

.fostore-date-lg .fostore-date-input {
  height: 52px;
  font-size: 1rem;
  padding-left: 3rem;
  border-radius: 18px;
}

.fostore-date-lg .fostore-input-icon-left {
  left: 1.25rem;
  font-size: 1.125rem;
}

/* Shortcuts Toolbar */
.fostore-date-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.375rem;
}

.fostore-date-shortcut-pill,
.fostore-date-preset-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--fm-font);
  user-select: none;
}

.fostore-date-shortcut-pill:hover,
.fostore-date-preset-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.fostore-date-shortcut-pill:active,
.fostore-date-preset-btn:active {
  transform: translateY(0);
}

/* ==========================================================================
   FOSTORE INTERACTIVE CUSTOM CALENDAR & DATEPICKER ENGINE
   ========================================================================== */
.fostore-datepicker-wrapper {
  position: relative;
  width: 100%;
}

.fostore-datepicker-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 46px;
  padding: 0.625rem 1rem;
  background-color: var(--fm-input-bg);
  border: 1.5px solid var(--fm-input-border);
  border-radius: var(--fm-radius-input);
  font-family: var(--fm-font);
  font-size: 0.875rem;
  color: var(--fm-input-text);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  box-sizing: border-box;
}

.fostore-datepicker-trigger:hover {
  background-color: var(--fm-input-bg-focus);
  border-color: #cbd5e1;
}

.fostore-datepicker-wrapper.is-open .fostore-datepicker-trigger {
  border-color: var(--fm-border-focus);
  background-color: var(--fm-input-bg-focus);
  box-shadow: 0 0 0 4px var(--fm-input-ring);
}

.fostore-datepicker-trigger .trigger-content {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
  flex: 1;
}

.fostore-datepicker-trigger .trigger-icon {
  color: #6366f1;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.fostore-datepicker-trigger .selected-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fostore-datepicker-trigger .trigger-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  margin-left: 0.5rem;
}

.fostore-datepicker-trigger .clear-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
}

.fostore-datepicker-trigger .clear-btn:hover {
  background: #fee2e2;
  color: #ef4444;
}

/* Compact size */
.fostore-datepicker-sm .fostore-datepicker-trigger {
  height: 36px;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: 12px;
}

/* CALENDAR POPUP MODAL / POPUP */
.fostore-calendar-popup {
  position: fixed;
  z-index: 999999;
  width: 320px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  font-family: var(--fm-font);
  padding: 1.125rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.98);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s;
  pointer-events: none;
  user-select: none;
}

.fostore-calendar-popup.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Calendar Header */
.fostore-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.875rem;
}

.fostore-cal-title-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9375rem;
  font-weight: 800;
  color: #0f172a;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.35rem 0.6rem;
  border-radius: 10px;
  transition: all 0.15s;
}

.fostore-cal-title-btn:hover {
  background: #f1f5f9;
  color: #4f46e5;
}

.fostore-cal-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.75rem;
}

.fostore-cal-nav-btn:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #4f46e5;
}

/* Weekdays */
.fostore-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
  margin-bottom: 0.5rem;
}

.fostore-cal-weekday {
  font-size: 0.6875rem;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0;
}

/* Days Grid */
.fostore-cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.fostore-cal-day {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  width: 36px;
  margin: 0 auto;
  border-radius: 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  background: transparent;
  border: 1.5px solid transparent;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.fostore-cal-day:hover {
  background-color: #f1f5f9;
  color: #0f172a;
  transform: scale(1.08);
}

.fostore-cal-day.other-month {
  color: #cbd5e1;
  font-weight: 400;
}

.fostore-cal-day.today {
  border-color: #6366f1;
  color: #4f46e5;
  font-weight: 800;
}

.fostore-cal-day.selected {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%) !important;
  color: #ffffff !important;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
  transform: scale(1.05);
}

.fostore-cal-day.in-range {
  background-color: #eef2ff;
  color: #4338ca;
  border-radius: 4px;
}

.fostore-cal-day.disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* Time Picker Extension in Popup */
.fostore-cal-time-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.875rem;
  padding-top: 0.875rem;
  border-top: 1px solid #e2e8f0;
}

.fostore-cal-time-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.fostore-cal-time-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.fostore-cal-time-input {
  width: 44px;
  height: 32px;
  text-align: center;
  font-family: var(--fm-font);
  font-size: 0.875rem;
  font-weight: 700;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  outline: none;
}

.fostore-cal-time-input:focus {
  border-color: #4f46e5;
  background: #ffffff;
}

.fostore-cal-time-ampm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 800;
  background: #eef2ff;
  color: #4f46e5;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  cursor: pointer;
}

/* Footer & Preset Toolbar */
.fostore-cal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.875rem;
  padding-top: 0.875rem;
  border-top: 1px solid #e2e8f0;
  gap: 0.5rem;
}

.fostore-cal-presets {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.fostore-cal-preset-pill {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
}

.fostore-cal-preset-pill:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #4f46e5;
}

.fostore-cal-apply-btn {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.35rem 0.75rem;
  border-radius: 10px;
  background: #4f46e5;
  color: #ffffff;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}

.fostore-cal-apply-btn:hover {
  background: #4338ca;
}


