/* ── Pickup Scheduler ─────────────────────────────────────────────
 * Compact inline calendar + time-slot selector for pickup scheduling.
 * Scoped palette so scheduler changes do not affect the global store theme.
 * ──────────────────────────────────────────────────────────────── */

.pickup-scheduler {
  --pickup-accent: #1D9E75;
  --pickup-accent-light: #E1F5EE;
  --pickup-accent-dark: #0F6E56;
  --pickup-today: #0F6E56;
  --pickup-dot-high: #1D9E75;
  --pickup-dot-low: #9FE1CB;
  --pickup-border: #D0D5DD;
  --pickup-border-strong: #98A2B3;
  --pickup-surface: #FFFFFF;
  --pickup-surface-muted: #F8FAFC;
  --pickup-radius-md: 8px;
  --pickup-radius-lg: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.pickup-section-label {
  display: block;
  margin: 0;
  color: #475467;
  font-size: var(--text-xs, 0.85rem);
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ────────────────────────────── CALENDAR ────────────────────────────── */

.pickup-calendar {
  width: 100%;
  max-width: none;
  padding: 6px;
  border: 1px solid rgba(208, 213, 221, 0.9);
  border-radius: var(--pickup-radius-lg);
  background: var(--pickup-surface);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  user-select: none;
  margin: 0;
}

.pickup-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.pickup-cal-nav__title {
  color: var(--text, #101828);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: capitalize;
}

.pickup-cal-nav__actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pickup-cal-nav__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  padding: 0;
  border: 0.5px solid var(--pickup-border);
  border-radius: var(--pickup-radius-md);
  background: transparent;
  color: #344054;
  font-family: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.pickup-cal-nav__btn:hover:not([disabled]) {
  border-color: var(--pickup-accent);
  background: var(--pickup-accent-light);
  color: var(--pickup-accent-dark);
}

.pickup-cal-nav__btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pickup-cal-nav__btn:focus-visible {
  outline: 2px solid var(--pickup-accent);
  outline-offset: 2px;
}

.pickup-cal-header,
.pickup-cal-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.pickup-cal-header {
  gap: 3px;
  margin-bottom: 2px;
}

.pickup-cal-header__day {
  padding: 1px 0;
  color: var(--muted, #667085);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.pickup-cal-grid {
  gap: 2px;
  align-content: start;
}

.pickup-day {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 32px;
  width: min(100%, 32px);
  max-width: 32px;
  aspect-ratio: 1;
  min-height: 32px;
  max-height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--pickup-radius-md);
  background: transparent;
  color: var(--text, #101828);
  box-sizing: border-box;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  justify-self: center;
}

.pickup-day__number {
  font-size: 12px;
  font-weight: 500;
}

.pickup-day__dot {
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: transparent;
}

.pickup-day__dot--high {
  background: var(--pickup-dot-high);
}

.pickup-day__dot--low {
  background: var(--pickup-dot-low);
}

.pickup-day__dot.is-hidden {
  visibility: hidden;
}

.pickup-day:hover:not([disabled]):not(.is-selected) {
  border-color: rgba(29, 158, 117, 0.35);
  background: rgba(225, 245, 238, 0.55);
}

.pickup-day.is-selected {
  min-width: 32px;
  width: 32px;
  max-width: 32px;
  min-height: 32px;
  height: 32px;
  max-height: 32px;
  padding: 0;
  border-radius: var(--pickup-radius-md);
  border-color: var(--pickup-accent);
  background: var(--pickup-accent);
  color: #FFFFFF;
  transform: none;
  box-shadow: none;
}

.pickup-day.is-selected .pickup-day__number {
  color: #FFFFFF;
  font-weight: 600;
}

.pickup-day.is-selected .pickup-day__dot {
  visibility: hidden;
}

.pickup-day.is-today:not(.is-selected) .pickup-day__number {
  color: var(--pickup-today);
  font-weight: 600;
}

.pickup-day.is-past .pickup-day__number,
.pickup-day.is-unavailable .pickup-day__number {
  opacity: 0.35;
}

.pickup-day.is-holiday .pickup-day__number,
.pickup-day.is-closed .pickup-day__number,
.pickup-day.is-full .pickup-day__number,
.pickup-day.is-out-of-range .pickup-day__number {
  color: var(--muted, #98A2B3);
}

.pickup-day.is-unavailable,
.pickup-day:disabled {
  cursor: not-allowed;
}

.pickup-day.pickup-day--empty {
  pointer-events: none;
  cursor: default;
}

.pickup-day:focus-visible {
  outline: 2px solid var(--pickup-accent);
  outline-offset: 2px;
}

/* ────────────────────────────── SLOT GRID ────────────────────────────── */

.pickup-slots {
  min-height: 0;
  margin: 0;
  padding: 0;
}

.pickup-slots-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 0 0 4px;
}

.pickup-slots-label {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: var(--text, #101828);
  font-size: 12px;
  font-weight: 500;
  min-width: 0;
}

.pickup-slots-label::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--pickup-dot-high);
  flex-shrink: 0;
}

.pickup-slots-label__date {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: lowercase;
}

.pickup-slots-count {
  color: var(--muted, #667085);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.pickup-slots-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.pickup-slot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid var(--pickup-border);
  border-radius: var(--pickup-radius-md);
  background: var(--pickup-surface);
  color: var(--text, #101828);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.pickup-slot[data-stagger] {
  opacity: 0;
  transform: translateY(4px);
  animation: pickupSlotIn 0.22s ease forwards;
}

@keyframes pickupSlotIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pickup-slot:hover:not([disabled]),
.pickup-slot.pickup-slot--selected {
  border-color: var(--pickup-accent);
  background: var(--pickup-accent-light);
}

.pickup-slot__time {
  color: currentColor;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.05;
}

.pickup-slot__remaining {
  color: var(--muted, #667085);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.05;
}

.pickup-slot--selected .pickup-slot__time,
.pickup-slot--selected .pickup-slot__remaining,
.pickup-slot--limited .pickup-slot__remaining {
  color: var(--pickup-accent-dark);
}

.pickup-slot--unavailable,
.pickup-slot:disabled,
.pickup-slot[disabled] {
  background: var(--pickup-surface-muted);
  border-color: #E4E7EC;
  color: #98A2B3;
  cursor: not-allowed;
}

.pickup-slot--unavailable .pickup-slot__remaining,
.pickup-slot:disabled .pickup-slot__remaining,
.pickup-slot[disabled] .pickup-slot__remaining {
  color: #98A2B3;
}

.pickup-slot:focus-visible {
  outline: 2px solid var(--pickup-accent);
  outline-offset: 2px;
}

.pickup-slot-skeleton {
  min-height: 36px;
  border-radius: var(--pickup-radius-md);
  background: linear-gradient(90deg, #F2F4F7 25%, #EAECF0 50%, #F2F4F7 75%);
  background-size: 200% 100%;
  animation: pickup-shimmer 1.2s ease-in-out infinite;
}

@keyframes pickup-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.pickup-slots-empty {
  padding: 16px 8px;
  color: var(--muted, #667085);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.pickup-slots-empty a {
  color: var(--pickup-accent-dark);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.pickup-slots-empty a:hover {
  text-decoration: underline;
}

/* ────────────────────────────── SUMMARY BAR ────────────────────────── */

.pickup-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(29, 158, 117, 0.16);
  border-radius: var(--pickup-radius-lg);
  background: var(--pickup-accent-light);
  color: var(--text, #101828);
  animation: pickup-summary-in 0.22s ease;
}

.pickup-summary[hidden],
.pickup-error[hidden] {
  display: none !important;
}

.pickup-summary__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--pickup-radius-md);
  background: rgba(29, 158, 117, 0.12);
  color: var(--pickup-accent-dark);
  flex-shrink: 0;
}

.pickup-summary__icon svg {
  width: 15px;
  height: 15px;
}

.pickup-summary__text {
  color: var(--text, #101828);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.pickup-summary__sep {
  margin: 0 3px;
  color: var(--muted, #98A2B3);
  font-weight: 400;
}

.pickup-summary__change {
  margin-left: auto;
  padding: 4px 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--pickup-accent-dark);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.pickup-summary__change:hover {
  background: rgba(29, 158, 117, 0.08);
}

.pickup-summary__change:focus-visible {
  outline: 2px solid var(--pickup-accent);
  outline-offset: 2px;
}

@keyframes pickup-summary-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ────────────────────────────── ERROR DISPLAY ────────────────────────── */

.pickup-error {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--pickup-radius-lg);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.pickup-error--user {
  border: 1px solid rgba(245, 158, 11, 0.18);
  background: rgba(255, 244, 229, 0.95);
  color: #92400E;
}

.pickup-error--user::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #F59E0B;
  flex-shrink: 0;
}

.pickup-error--system {
  border: 1px solid rgba(239, 68, 68, 0.16);
  background: rgba(254, 243, 242, 0.95);
  color: #B42318;
}

.pickup-error--system::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #EF4444;
  flex-shrink: 0;
}

/* ────────────────────────────── RESPONSIVE ────────────────────────── */

@media (min-width: 600px) {
  .pickup-slots-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .pickup-slot-skeleton {
    animation: none;
  }

  .pickup-summary {
    animation: none;
  }

  .pickup-slot[data-stagger] {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .pickup-day,
  .pickup-slot,
  .pickup-cal-nav__btn {
    transition: none;
  }
}
