/* =============================================================
   Fooppers Delivery Slots – Frontend Styles v1.1
   ============================================================= */

/* ── Wrapper ─────────────────────────────────────────────────── */
#fds-checkout-fields.fds-wrap {
  background    : #fff;
  border        : 1.5px solid #e5e7eb;
  border-radius : 12px;
  padding       : 24px;
  margin        : 18px 0;
  box-shadow    : 0 2px 12px rgba(0,0,0,.07);
}

.fds-title {
  display       : flex;
  align-items   : center;
  gap           : 10px;
  font-size     : 17px;
  font-weight   : 700;
  color         : #1a1a1a;
  margin        : 0 0 20px;
  padding-bottom: 14px;
  border-bottom : 2px solid #e63329;
}
.fds-title-icon { font-size: 20px; }

/* ── Cut-off banner ──────────────────────────────────────────── */
.fds-cutoff-banner {
  display       : flex;
  align-items   : center;
  gap           : 10px;
  background    : #fffbeb;
  border        : 1.5px solid #fcd34d;
  border-left   : 4px solid #f59e0b;
  border-radius : 8px;
  padding       : 10px 16px;
  margin-bottom : 18px;
  font-size     : 14px;
  font-weight   : 600;
  color         : #92400e;
}
.fds-cutoff-banner__icon { font-size: 18px; flex-shrink: 0; }

/* ── Field groups ────────────────────────────────────────────── */
.fds-field-group { margin-bottom: 20px; }

.fds-label {
  display     : block;
  font-weight : 600;
  font-size   : 14px;
  color       : #1a1a1a;
  margin-bottom: 8px;
}
.fds-label abbr { color: #e63329; text-decoration: none; margin-left: 2px; }

/* ── Date picker: trigger + calendar ─────────────────────────
   Themes love to repaint bare <button> elements (gradients, uppercase,
   min-height). Everything below is scoped and uses !important on the
   handful of properties themes actually fight us over, so the control
   looks identical on any theme. ------------------------------------- */
.fds-date-picker-wrap{
  --fds-brand:#e63329;
  --fds-brand-ink:#b8241c;
  --fds-brand-wash:#fff1f0;
  --fds-ink:#111827;
  --fds-muted:#6b7280;
  --fds-line:#e5e7eb;
  --fds-surface:#fff;
  --fds-ok:#15803d;
  --fds-ok-wash:#f0fdf4;
  --fds-ease:cubic-bezier(.22,1,.36,1);
  --fds-z-panel:10000;
  position:relative;
}

/* ── Trigger ─────────────────────────────────────────────────── */
.fds-date-picker-wrap button.fds-date-btn{
  display:flex !important;
  align-items:center;
  gap:12px;
  width:100%;
  box-sizing:border-box;
  margin:0 !important;
  padding:12px 14px !important;
  background:var(--fds-surface) !important;
  background-image:none !important;
  border:1.5px solid var(--fds-line) !important;
  border-radius:14px !important;
  box-shadow:0 1px 2px rgba(16,24,40,.04) !important;
  color:var(--fds-ink) !important;
  font-family:inherit !important;
  font-size:15px !important;
  font-weight:600 !important;
  line-height:1.25 !important;
  text-align:left !important;
  text-transform:none !important;
  letter-spacing:0 !important;
  min-height:0 !important;
  cursor:pointer;
  user-select:none;
  transition:border-color .2s var(--fds-ease),box-shadow .2s var(--fds-ease),background .2s var(--fds-ease);
}
.fds-date-picker-wrap button.fds-date-btn:hover{
  border-color:#cbd5e1 !important;
  box-shadow:0 2px 8px rgba(16,24,40,.07) !important;
}
.fds-date-picker-wrap button.fds-date-btn:focus-visible{
  outline:none !important;
  border-color:var(--fds-brand) !important;
  box-shadow:0 0 0 4px rgba(230,51,41,.16) !important;
}
.fds-date-picker-wrap button.fds-date-btn.fds-date-btn--open{
  border-color:var(--fds-brand) !important;
  box-shadow:0 0 0 4px rgba(230,51,41,.13) !important;
}

.fds-date-btn__icon{
  flex:0 0 auto;
  display:grid;
  place-items:center;
  width:38px;height:38px;
  border-radius:11px;
  background:var(--fds-brand-wash);
  color:var(--fds-brand);
  transition:background .2s var(--fds-ease),color .2s var(--fds-ease);
}
.fds-date-btn__icon svg{width:20px;height:20px;display:block;}

.fds-date-btn__body{
  flex:1 1 auto;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:2px;
}
.fds-date-btn__hint{
  font-size:11px;
  font-weight:700;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--fds-muted);
}
.fds-date-btn__text{
  font-size:15.5px;
  font-weight:700;
  color:var(--fds-ink);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.fds-date-picker-wrap button.fds-date-btn:not(.fds-date-btn--chosen) .fds-date-btn__text{
  color:var(--fds-muted);
  font-weight:600;
}

/* Chosen: quiet green confirmation, not a full repaint. */
.fds-date-picker-wrap button.fds-date-btn--chosen{
  border-color:#bbf7d0 !important;
  background:var(--fds-ok-wash) !important;
}
.fds-date-btn--chosen .fds-date-btn__icon{background:#dcfce7;color:var(--fds-ok);}
.fds-date-btn--chosen .fds-date-btn__text{color:#14532d;}
/* Reopening an already-chosen date: keep the confirmation green rather
   than mixing a red ring over a green field. */
.fds-date-picker-wrap button.fds-date-btn--chosen.fds-date-btn--open{
  border-color:#4ade80 !important;
  box-shadow:0 0 0 4px rgba(34,197,94,.16) !important;
}
.fds-date-btn--chosen.fds-date-btn--open .fds-date-btn__chevron{color:var(--fds-ok);}

.fds-date-btn__chevron{
  flex:0 0 auto;
  display:grid;place-items:center;
  width:20px;height:20px;
  color:#9ca3af;
  transition:transform .25s var(--fds-ease),color .2s var(--fds-ease);
}
.fds-date-btn__chevron svg{width:16px;height:16px;display:block;}
.fds-date-btn--open .fds-date-btn__chevron{transform:rotate(180deg);color:var(--fds-brand);}

/* ── Panel shell ─────────────────────────────────────────────── */
.fds-calendar-panel{
  position:absolute;
  top:calc(100% + 10px);
  left:0;
  z-index:var(--fds-z-panel);
}
.fds-cal-backdrop{display:none;}

.fds-cal{
  width:330px;
  background:var(--fds-surface);
  border:1px solid var(--fds-line);
  border-radius:20px;
  box-shadow:0 18px 44px -12px rgba(16,24,40,.28),0 4px 12px rgba(16,24,40,.06);
  overflow:hidden;
  font-size:14px;
  transform-origin:top left;
  animation:fds-cal-in .22s var(--fds-ease) both;
}
@keyframes fds-cal-in{
  from{opacity:0;transform:translateY(-6px) scale(.985);}
  to  {opacity:1;transform:none;}
}
.fds-cal-grabber{display:none;}

/* ── Month header ────────────────────────────────────────────── */
.fds-cal-header{
  display:flex;align-items:center;justify-content:space-between;
  gap:8px;
  padding:16px 16px 10px;
}
.fds-cal-month{
  font-size:16px;
  font-weight:800;
  letter-spacing:-.01em;
  color:var(--fds-ink);
}
.fds-date-picker-wrap button.fds-cal-nav{
  flex:0 0 auto;
  display:grid !important;
  place-items:center;
  width:34px !important;height:34px !important;
  min-height:0 !important;
  margin:0 !important;padding:0 !important;
  background:#f3f4f6 !important;
  background-image:none !important;
  border:0 !important;
  border-radius:50% !important;
  box-shadow:none !important;
  color:#374151 !important;
  cursor:pointer;
  transition:background .18s var(--fds-ease),color .18s var(--fds-ease),transform .18s var(--fds-ease);
}
.fds-date-picker-wrap button.fds-cal-nav svg{width:17px;height:17px;display:block;}
.fds-date-picker-wrap button.fds-cal-nav:hover:not(:disabled){
  background:var(--fds-brand-wash) !important;
  color:var(--fds-brand) !important;
}
.fds-date-picker-wrap button.fds-cal-nav:active:not(:disabled){transform:scale(.92);}
.fds-date-picker-wrap button.fds-cal-nav:disabled{
  opacity:.4;cursor:not-allowed;
  background:#f9fafb !important;color:#9ca3af !important;
}

/* ── Weekday row ─────────────────────────────────────────────── */
.fds-cal-dow{
  display:grid;grid-template-columns:repeat(7,1fr);
  padding:0 10px 4px;
}
.fds-cal-dow span{
  text-align:center;
  padding:6px 0;
  font-size:11px;font-weight:700;
  color:var(--fds-muted);
  text-transform:uppercase;
  letter-spacing:.06em;
}

/* ── Day grid ────────────────────────────────────────────────── */
.fds-cal-grid{
  display:grid;grid-template-columns:repeat(7,1fr);
  gap:4px;
  padding:2px 10px 10px;
}
.fds-cal-day{
  display:flex;align-items:center;justify-content:center;
  aspect-ratio:1/1;
  min-height:38px;
  border-radius:12px;
  font-size:14px;font-weight:600;
  color:var(--fds-ink);
  position:relative;
  cursor:default;
  transition:background .16s var(--fds-ease),color .16s var(--fds-ease),transform .16s var(--fds-ease);
}
.fds-cal-day--past,
.fds-cal-day--off{color:#cbd5e1;font-weight:500;}

.fds-cal-day--ok{cursor:pointer;font-weight:700;}
.fds-cal-day--ok:hover{background:var(--fds-brand-wash);color:var(--fds-brand-ink);}
.fds-cal-day--ok:active{transform:scale(.93);}
.fds-cal-day--ok:focus-visible{
  outline:2px solid var(--fds-brand);
  outline-offset:2px;
}
/* Available days get a subtle dot so "bookable" reads at a glance. */
.fds-cal-day--ok::after{
  content:"";
  position:absolute;bottom:5px;left:50%;
  width:4px;height:4px;margin-left:-2px;
  border-radius:50%;
  background:var(--fds-brand);
  opacity:.35;
  transition:opacity .16s var(--fds-ease),background .16s var(--fds-ease);
}
.fds-cal-day--ok:hover::after{opacity:.7;}

.fds-cal-day--today{box-shadow:inset 0 0 0 1.5px var(--fds-brand);color:var(--fds-brand);}

.fds-cal-day--sel,
.fds-cal-day--sel.fds-cal-day--today{
  background:var(--fds-brand) !important;
  color:#fff !important;
  box-shadow:0 4px 12px -2px rgba(230,51,41,.5) !important;
  font-weight:800;
}
.fds-cal-day--sel::after{background:#fff !important;opacity:.9 !important;}

/* ── Legend / footer ─────────────────────────────────────────── */
.fds-cal-legend{
  display:flex;align-items:center;gap:14px;
  padding:10px 16px 13px;
  border-top:1px solid #f1f2f4;
  font-size:11.5px;font-weight:600;
  color:var(--fds-muted);
}
.fds-cal-legend__item{display:inline-flex;align-items:center;gap:6px;}
.fds-cal-key{width:9px;height:9px;border-radius:50%;display:inline-block;}
.fds-cal-key--today{box-shadow:inset 0 0 0 1.5px var(--fds-brand);}
.fds-cal-key--off{background:#dfe3e8;}
.fds-date-picker-wrap button.fds-cal-done{
  display:none !important;
  margin-left:auto !important;
  padding:8px 18px !important;
  min-height:0 !important;
  background:var(--fds-brand) !important;
  background-image:none !important;
  border:0 !important;border-radius:10px !important;
  box-shadow:none !important;
  color:#fff !important;
  font-family:inherit !important;
  font-size:14px !important;font-weight:700 !important;
  text-transform:none !important;letter-spacing:0 !important;
  cursor:pointer;
}

/* ── Mobile: bottom sheet instead of a clipped dropdown ──────── */
@media (max-width:600px){
  .fds-calendar-panel{
    position:fixed;
    inset:0;
    top:0;left:0;
    z-index:var(--fds-z-panel);
  }
  .fds-cal-backdrop{
    display:block;
    position:fixed;inset:0;
    background:rgba(15,23,42,.5);
    -webkit-backdrop-filter:blur(2px);
            backdrop-filter:blur(2px);
    animation:fds-fade-in .2s var(--fds-ease) both;
  }
  @keyframes fds-fade-in{from{opacity:0;}to{opacity:1;}}

  .fds-cal{
    position:fixed;
    left:0;right:0;bottom:0;
    width:auto;
    border-radius:24px 24px 0 0;
    border:0;
    padding-bottom:max(10px,env(safe-area-inset-bottom));
    box-shadow:0 -10px 40px rgba(15,23,42,.25);
    transform-origin:bottom center;
    animation:fds-sheet-up .3s var(--fds-ease) both;
  }
  @keyframes fds-sheet-up{
    from{transform:translateY(100%);}
    to  {transform:translateY(0);}
  }
  .fds-cal-grabber{
    display:block;
    width:40px;height:4px;
    margin:9px auto 2px;
    border-radius:999px;
    background:#dfe3e8;
  }
  .fds-cal-header{padding:12px 18px 10px;}
  .fds-cal-month{font-size:17px;}
  .fds-cal-dow{padding:0 12px 4px;}
  .fds-cal-grid{padding:2px 12px 12px;gap:5px;}
  .fds-cal-day{min-height:44px;font-size:15px;border-radius:13px;}
  .fds-cal-legend{padding:12px 18px 6px;}
  .fds-date-picker-wrap button.fds-cal-done{display:inline-block !important;}
}

/* Lock background scrolling while the sheet is open. */
@media (max-width:600px){
  html.fds-cal-locked,
  html.fds-cal-locked body{overflow:hidden !important;}
}

@media (prefers-reduced-motion:reduce){
  .fds-cal,.fds-cal-backdrop{animation:none !important;}
  .fds-date-picker-wrap *,
  .fds-date-picker-wrap *::after{transition:none !important;}
}

/* ── Slot dropdown ───────────────────────────────────────────── */
.fds-select-wrap { position: relative; }
.fds-select-wrap::after {
  content        : '▾';
  position       : absolute;
  right          : 14px;
  top            : 50%;
  transform      : translateY(-50%);
  pointer-events : none;
  color          : #9ca3af;
  font-size      : 15px;
}

.fds-slot-select {
  width          : 100%;
  max-width      : 380px;
  padding        : 11px 38px 11px 14px;
  border         : 1.5px solid #d1d5db;
  border-radius  : 9px;
  font-size      : 15px;
  font-weight    : 500;
  color          : #1a1a1a;
  background     : #f9fafb;
  appearance     : none;
  -webkit-appearance: none;
  cursor         : pointer;
  outline        : none;
  transition     : border-color .18s, box-shadow .18s;
}
.fds-slot-select:focus {
  border-color : #e63329;
  box-shadow   : 0 0 0 3px rgba(230,51,41,.12);
  background   : #fff;
}

/* No-slots / info messages */
.fds-no-slots-msg {
  color        : #dc2626;
  font-size    : 14px;
  margin       : 8px 0 0;
  padding      : 8px 12px;
  background   : #fef2f2;
  border-radius: 7px;
  border       : 1px solid #fecaca;
}
.fds-slot-info {
  font-size    : 13px;
  color        : #6b7280;
  margin-top   : 6px;
}

/* ── Hint text ───────────────────────────────────────────────── */
.fds-hint { font-size: 12px; color: #6b7280; margin: 8px 0 0; }

/* ── Slot notice callout (speech-bubble style) ──────────────────── */
.fds-slot-notice {
  position      : relative;
  display       : flex;
  align-items   : flex-start;
  gap           : 12px;
  margin-top    : 16px;
  padding       : 14px 18px;
  background    : linear-gradient(135deg, #eef6df 0%, #f8fbf0 100%);
  border        : 1px solid #cfe0ab;
  border-radius : 14px;
  box-shadow    : 0 2px 8px rgba(0,0,0,0.06);
}
.fds-slot-notice::before {
  content       : "";
  position      : absolute;
  top           : -8px;
  left          : 30px;
  width         : 16px;
  height        : 16px;
  background    : #eef6df;
  border-left   : 1px solid #cfe0ab;
  border-top    : 1px solid #cfe0ab;
  border-radius : 3px 0 0 0;
  transform     : rotate(45deg);
}
.fds-slot-notice__icon {
  flex-shrink : 0;
  font-size   : 22px;
  line-height : 1;
  margin-top  : 2px;
}
.fds-slot-notice__text {
  font-size   : 14.5px;
  line-height : 1.45;
  color       : #52525b;
}

/* ── Summary bar ─────────────────────────────────────────────── */
.fds-summary {
  display      : flex;
  align-items  : center;
  gap          : 8px;
  background   : #f0fdf4;
  border       : 1px solid #bbf7d0;
  border-radius: 8px;
  padding      : 11px 16px;
  font-size    : 14px;
  font-weight  : 600;
  color        : #15803d;
  margin-top   : 8px;
}
.fds-summary__check { font-size: 16px; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 480px) {
  .fds-slot-select { max-width: 100%; }
}

/* ── Slot loading indicator (v2.0) ──────────────────────────────── */
.fds-slot-loading {
  display      : flex;
  align-items  : center;
  gap          : 10px;
  padding      : 14px 16px;
  background   : #f8fafc;
  border       : 1.5px solid #e2e8f0;
  border-radius: 9px;
  font-size    : 14px;
  font-weight  : 500;
  color        : #64748b;
}

.fds-spinner {
  width           : 18px;
  height          : 18px;
  border          : 2px solid #e2e8f0;
  border-top-color: #e63329;
  border-radius   : 50%;
  display         : inline-block;
  animation       : fds-spin .7s linear infinite;
  flex-shrink     : 0;
}

@keyframes fds-spin {
  to { transform: rotate(360deg); }
}

.fds-no-slots-msg {
  padding      : 12px 16px;
  background   : #fef2f2;
  border       : 1.5px solid #fecaca;
  border-radius: 9px;
  color        : #dc2626;
  font-size    : 14px;
  margin       : 0;
}







/* ── Delivery Time Notice (single source of truth) ─────────────── */
.fooppers-delivery-notice {
  margin        : 12px 0 0;
  padding       : 14px 16px;
  background    : #fefce8;
  border        : 1px solid #fde68a;
  border-left   : 4px solid #f59e0b;
  border-radius : 8px;
}

.fooppers-delivery-notice__header {
  display       : flex;
  align-items   : center;
  gap           : 8px;
  margin-bottom : 8px;
  font-size     : 14px;
  color         : #92400e;
}

.fooppers-delivery-notice__icon {
  font-size     : 16px;
  flex-shrink   : 0;
}

.fooppers-delivery-notice p {
  margin        : 0 0 8px;
  font-size     : 12px;
  color         : #78350f;
  line-height   : 1.6;
}

.fooppers-delivery-notice ul {
  margin        : 4px 0 8px 16px;
  padding       : 0;
  font-size     : 12px;
  color         : #78350f;
  line-height   : 1.8;
}

.fooppers-delivery-notice li {
  list-style    : disc;
}

.fooppers-delivery-notice__footer {
  margin-top    : 8px !important;
  font-style    : italic;
  opacity       : .85;
}
