/* ═══════════════════════════════════════════════════════════════
   Моё Движение · Pilates Booking
   Typography: Cormorant Garamond (display) + Jost (UI)
   Palette:    ivory · sage · dusty rose · warm ink
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* ── Palette ── */
  --cream:       #FAF9F5;
  --cream-2:     #F3F0E8;
  --cream-3:     #EAE5DA;
  --white:       #FFFFFF;

  --sage:        #6B8C73;
  --sage-2:      #8FAF97;
  --sage-pale:   #EBF2EC;

  --rose:        #C4988E;
  --rose-pale:   #F9EFED;

  --ink:         #2C2926;
  --ink-2:       #6B6460;
  --ink-3:       #ADA8A3;
  --ink-4:       #D4CFC9;

  /* ── Typography ── */
  --ff-display:  'Cormorant Garamond', Georgia, serif;
  --ff-body:     'Jost', system-ui, sans-serif;

  /* ── Radii ── */
  --r-sm:  6px;
  --r-md:  12px;
  --r-lg:  20px;
  --r-xl:  28px;
  --r-ful: 9999px;

  /* ── Shadows ── */
  --sh-xs: 0 1px 3px  rgba(44,41,38,.05);
  --sh-sm: 0 2px 8px  rgba(44,41,38,.08);
  --sh-md: 0 4px 20px rgba(44,41,38,.10);

  /* ── Motion ── */
  --t:     .2s ease;
  --t-sl:  .32s cubic-bezier(.34,1.56,.64,1);
}

/* ── Reset ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--ff-body);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink);
  background: var(--cream);
  min-height: 100vh;
}

[x-cloak] { display: none !important; }
.sr-only  { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

button { font-family: var(--ff-body); cursor: pointer; }
input  { font-family: var(--ff-body); }


/* ── Header ───────────────────────────────────────────────────── */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--cream-3);
  padding: .85rem 1.25rem;
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: .7rem;
}
.logo-mark {
  width: 38px;
  height: 38px;
  color: var(--sage);
  flex-shrink: 0;
}
.logo-name {
  font-family: var(--ff-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.1;
}
.logo-sub {
  font-size: .68rem;
  font-weight: 300;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-top: 2px;
}
.price-tag {
  text-align: right;
}
.price-amount {
  display: block;
  font-family: var(--ff-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--sage);
  line-height: 1.1;
}
.price-label {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink-3);
}


/* ── Filters Bar ──────────────────────────────────────────────── */
.filters {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250,249,245,.9);
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--cream-3);
  padding: .55rem 1.25rem;
}
.filters-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: .5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filters-inner::-webkit-scrollbar { display: none; }

.filter-group {
  display: flex;
  align-items: center;
  gap: .3rem;
  flex-shrink: 0;
}

/* Pills */
.pill-label { cursor: pointer; user-select: none; flex-shrink: 0; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  padding: .28rem .7rem;
  border-radius: var(--r-ful);
  border: 1.5px solid var(--cream-3);
  font-size: .78rem;
  font-weight: 400;
  color: var(--ink-2);
  background: var(--white);
  transition: all var(--t);
  white-space: nowrap;
}
.pill:hover { border-color: var(--sage-2); color: var(--sage); }
.pill--on   { background: var(--sage); border-color: var(--sage); color: var(--white); }

.pill-icon { font-size: .72rem; }

/* Date select */
.select-wrap {
  position: relative;
  flex-shrink: 0;
}
.date-select {
  appearance: none;
  -webkit-appearance: none;
  padding: .28rem 1.6rem .28rem .7rem;
  border-radius: var(--r-ful);
  border: 1.5px solid var(--cream-3);
  background: var(--white);
  font-family: var(--ff-body);
  font-size: .78rem;
  color: var(--ink);
  cursor: pointer;
  max-width: 150px;
  transition: border-color var(--t);
  outline: none;
}
.date-select:focus { border-color: var(--sage); }
.select-arrow {
  position: absolute;
  right: .55rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: .65rem;
  color: var(--ink-3);
  pointer-events: none;
}

/* Quick buttons */
.quick-group { margin-left: auto; }

.quick {
  padding: .28rem .62rem;
  border-radius: var(--r-ful);
  border: 1.5px solid var(--cream-3);
  background: var(--white);
  font-size: .74rem;
  font-weight: 500;
  color: var(--ink-2);
  transition: all var(--t);
  white-space: nowrap;
}
.quick:hover        { background: var(--sage-pale); border-color: var(--sage-2); color: var(--sage); }
.quick--clear       { color: var(--rose); border-color: var(--rose-pale); }
.quick--clear:hover { background: var(--rose-pale); border-color: var(--rose); }


/* ── Main Layout ──────────────────────────────────────────────── */
.main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 6rem;
}

@media (min-width: 1024px) {
  .main {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2rem;
    align-items: start;
    padding-bottom: 2.5rem;
  }
}


/* ── State views ──────────────────────────────────────────────── */
.state-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 4.5rem 1rem;
  color: var(--ink-2);
  font-size: .88rem;
  text-align: center;
}

.spinner {
  width: 30px;
  height: 30px;
  border: 2px solid var(--cream-3);
  border-top-color: var(--sage);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-art {
  width: 56px;
  height: 56px;
  color: var(--ink-3);
}

.reset-btn {
  padding: .35rem .9rem;
  border-radius: var(--r-ful);
  border: 1.5px solid var(--sage);
  background: transparent;
  color: var(--sage);
  font-size: .8rem;
  transition: all var(--t);
}
.reset-btn:hover { background: var(--sage); color: var(--white); }


/* ── Slots Grid ───────────────────────────────────────────────── */
.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
  gap: .7rem;
}

@media (min-width: 480px) {
  .slots-grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); }
}


/* ── Slot Card ────────────────────────────────────────────────── */
.slot {
  display: flex;
  flex-direction: column;
  gap: .38rem;
  padding: .85rem .9rem;
  background: var(--white);
  border-radius: var(--r-md);
  border: 1.5px solid var(--cream-3);
  box-shadow: var(--sh-xs);
  text-align: left;
  color: var(--ink);
  transition: border-color var(--t), box-shadow var(--t), transform var(--t), background var(--t);
  position: relative;
  overflow: hidden;
  animation: fadeUp .28s ease both;
}

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

.slot:hover:not(:disabled) {
  border-color: var(--sage-2);
  box-shadow: var(--sh-sm);
  transform: translateY(-1px);
}

/* Selected */
.slot--on {
  border-color: var(--sage) !important;
  background: var(--sage-pale);
  box-shadow: 0 0 0 3px rgba(107,140,115,.12), var(--sh-sm);
}
.slot--on::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--sage);
  border-radius: var(--r-sm) var(--r-sm) 0 0;
}

/* Full */
.slot--full {
  opacity: .5;
  cursor: not-allowed;
  background: var(--cream-2);
  border-color: var(--cream-3);
}
.slot--full:hover { transform: none; box-shadow: var(--sh-xs); border-color: var(--cream-3); }

.slot-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.slot-wd {
  font-size: .62rem;
  font-weight: 500;
  letter-spacing: .1em;
  color: var(--ink-3);
}
.slot-check {
  width: 18px;
  height: 18px;
  background: var(--sage);
  color: var(--white);
  border-radius: 50%;
  font-size: .6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}

.slot-date {
  font-family: var(--ff-display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
}

.slot-time {
  font-size: 1.55rem;
  font-weight: 300;
  letter-spacing: -.02em;
  color: var(--ink);
  line-height: 1;
}

.slot-seats {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 2px;
}
.seats-track {
  height: 3px;
  background: var(--cream-3);
  border-radius: 2px;
  overflow: hidden;
}
.seats-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sage-2), var(--rose));
  border-radius: 2px;
  transition: width .5s ease;
}
.seats-label {
  font-size: .68rem;
  color: var(--ink-3);
}


/* ── Summary Panel (Desktop) ──────────────────────────────────── */
.summary { display: none; }

@media (min-width: 1024px) {
  .summary { display: block; }
}

.summary-box {
  position: sticky;
  top: 74px;   /* filters height */
  background: var(--white);
  border: 1px solid var(--cream-3);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-md);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 100px);
  overflow: hidden;
}

.summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.25rem .9rem;
  border-bottom: 1px solid var(--cream-3);
  flex-shrink: 0;
}
.summary-title {
  font-family: var(--ff-display);
  font-size: 1.25rem;
  font-weight: 600;
}
.summary-badge {
  background: var(--sage);
  color: var(--white);
  font-size: .72rem;
  font-weight: 500;
  padding: .12rem .5rem;
  border-radius: var(--r-ful);
  min-width: 22px;
  text-align: center;
}

.summary-empty {
  padding: 2.5rem 1.25rem;
  text-align: center;
  color: var(--ink-2);
  font-size: .84rem;
  line-height: 1.6;
}
.empty-icon {
  width: 52px;
  height: 52px;
  color: var(--ink-3);
  display: block;
  margin: 0 auto 1rem;
}

/* ── Selected list ────────────────────────────────────────────── */
.sel-list {
  overflow-y: auto;
  padding: .4rem 1.25rem;
  flex: 1;
  min-height: 0;
}

.sel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .55rem 0;
  border-bottom: 1px solid var(--cream-3);
  animation: slideIn .18s ease both;
}
.sel-row:last-child { border-bottom: none; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}

.sel-info {
  display: flex;
  align-items: center;
  gap: .3rem;
  font-size: .8rem;
}
.sel-date  { font-weight: 500; }
.sel-dot   { color: var(--ink-4); }
.sel-time  { color: var(--ink-2); }
.sel-right { display: flex; align-items: center; gap: .45rem; }
.sel-price { font-size: .8rem; font-weight: 500; color: var(--sage); white-space: nowrap; }

.sel-del {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--cream-3);
  background: transparent;
  color: var(--ink-3);
  font-size: .95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all var(--t);
  flex-shrink: 0;
}
.sel-del:hover { background: var(--rose-pale); border-color: var(--rose); color: var(--rose); }


/* ── Booking Form ─────────────────────────────────────────────── */
.booking-form {
  padding: .9rem 1.25rem 1.2rem;
  border-top: 1px solid var(--cream-3);
  display: flex;
  flex-direction: column;
  gap: .6rem;
  flex-shrink: 0;
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.total-label { font-size: .82rem; color: var(--ink-2); }
.total-sum {
  font-family: var(--ff-display);
  font-size: 1.55rem;
  font-weight: 600;
  color: var(--ink);
}

.f-input {
  width: 100%;
  padding: .6rem .8rem;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--cream-3);
  font-size: .84rem;
  color: var(--ink);
  background: var(--cream);
  outline: none;
  transition: border-color var(--t), background var(--t);
}
.f-input::placeholder { color: var(--ink-3); }
.f-input:focus        { border-color: var(--sage); background: var(--white); }

.pay-btn {
  width: 100%;
  padding: .8rem;
  border-radius: var(--r-md);
  border: none;
  background: linear-gradient(135deg, var(--sage), #527A59);
  color: var(--white);
  font-size: .88rem;
  font-weight: 500;
  letter-spacing: .02em;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  transition: transform var(--t), box-shadow var(--t), opacity var(--t);
  position: relative;
  overflow: hidden;
}
.pay-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 50%, rgba(255,255,255,.08));
}
.pay-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(107,140,115,.32);
}
.pay-btn:disabled  { opacity: .38; cursor: not-allowed; }
.pay-btn--wait     { opacity: .6; cursor: wait; }

/* Loading dots */
.dots { display: flex; gap: 4px; }
.dots i {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.8);
  animation: blink 1.1s infinite both;
}
.dots i:nth-child(2) { animation-delay: .18s; }
.dots i:nth-child(3) { animation-delay: .36s; }

@keyframes blink {
  0%, 80%, 100% { opacity: .25; transform: scale(.85); }
  40%           { opacity: 1;   transform: scale(1);   }
}


/* ── Mobile Bottom Bar ────────────────────────────────────────── */
.mob-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--white);
  border-top: 1px solid var(--cream-3);
  box-shadow: 0 -3px 16px rgba(44,41,38,.08);
  padding: .8rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  transform: translateY(100%);
  transition: transform var(--t-sl);
  padding-bottom: calc(.8rem + env(safe-area-inset-bottom, 0px));
}
.mob-bar--show { transform: translateY(0); }

.mob-bar-left {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .88rem;
  color: var(--ink-2);
}
.mob-sep { color: var(--ink-4); }

.mob-bar-btn {
  padding: .6rem 1.15rem;
  border-radius: var(--r-ful);
  border: none;
  background: var(--sage);
  color: var(--white);
  font-size: .84rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background var(--t), transform var(--t);
}
.mob-bar-btn:hover { background: #527A59; transform: scale(1.02); }

@media (min-width: 1024px) {
  .mob-bar { display: none; }
}


/* ── Mobile Drawer ────────────────────────────────────────────── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(44,41,38,0);
  z-index: 200;
  transition: background .25s ease;
}
.overlay--show { background: rgba(44,41,38,.4); }

@media (max-width: 1023px) {
  .overlay { display: block; }
}

.drawer {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: var(--white);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform var(--t-sl);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.drawer--open { transform: translateY(0); }

.drawer-handle {
  width: 34px;
  height: 4px;
  background: var(--cream-3);
  border-radius: 2px;
  margin: .7rem auto .3rem;
  flex-shrink: 0;
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .6rem 1.25rem .8rem;
  border-bottom: 1px solid var(--cream-3);
  flex-shrink: 0;
}
.drawer-title {
  font-family: var(--ff-display);
  font-size: 1.18rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.drawer-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--cream-3);
  background: transparent;
  color: var(--ink-2);
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t);
}
.drawer-close:hover { background: var(--cream-2); }

.drawer-body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.drawer-body .sel-list    { padding: .3rem 1.25rem; }
.drawer-body .booking-form { padding: .9rem 1.25rem 1.5rem; border-top: 1px solid var(--cream-3); }
