* { box-sizing:border-box; margin:0; padding:0; }
body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #0f0f0f;
  color: #e0e0e0;
  line-height: 1.5;
}

header {
  background: #1a1a1a;
  padding: 1.2rem;
  text-align: center;
  border-bottom: 1px solid #333;
}

h1 {
  font-size: 2.1rem;
  color: #d4af37;
  letter-spacing: 1px;
}

main { padding: 1.5rem; max-width: 1100px; margin: 0 auto; }

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
  align-items: stretch;          /* ← карточки в ряду одинаковой высоты */
}

.card {
  background: #1a1a1a;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #333;
  transition: all 0.18s ease;
  display: flex;                 /* ← flex-контейнер */
  flex-direction: column;        /* ← вертикальное расположение */
  height: 100%;                  /* ← растягиваем на всю высоту ячейки грида */
}

.card:hover {
  transform: translateY(-6px);
  border-color: #d4af37;
  box-shadow: 0 12px 32px rgba(212,175,55,0.12);
}

.card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.card-content {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;                  /* ← занимает всё оставшееся пространство */
}

.card-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: #fff;
  flex-grow: 1;                  /* ← заголовок растягивается, толкает кнопку вниз */
  line-height: 1.35;
  min-height: 3.2em;             /* ← минимальная высота для выравнивания длинных/коротких заголовков */
}

.price-duration {
  color: #d4af37;
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0.4rem 0 1.2rem 0;
}

.btn-book {
  background: #d4af37;
  color: #111;
  border: none;
  padding: 0.9rem;
  width: 100%;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
  margin-top: auto;              /* ← кнопка всегда прижата к низу карточки */
}

.btn-book:hover {
  background: #e6c56b;
}

/* Модальное окно */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-content {
  background: #1a1a1a;
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  border: 1px solid #444;
}

.modal-header {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title { font-size: 1.4rem; color: #d4af37; }

.close-btn {
  background: none;
  border: none;
  color: #aaa;
  font-size: 1.8rem;
  cursor: pointer;
}

.close-btn:hover { color: #fff; }

.modal-body { padding: 1.5rem; }

.days-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: 0.8rem;
  margin: 1rem 0;
}

.day-btn {
  padding: 0.9rem 0.4rem;
  text-align: center;
  border: 1px solid #444;
  border-radius: 10px;
  cursor: pointer;
  background: #222;
  transition: all 0.15s;
}

.day-btn input { display: none; }

.day-btn.active,
.day-btn:hover {
  background: #d4af37;
  color: #111;
  border-color: #d4af37;
}

.times-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 0.8rem;
  margin: 1.2rem 0 1.8rem;
}

.time-btn {
  padding: 0.9rem;
  border: 1px solid #444;
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  background: #222;
}

.time-btn input { display: none; }

.time-btn:hover,
.time-btn.active {
  background: #444;
  border-color: #d4af37;
  color: #d4af37;
}

.btn-continue {
  background: #d4af37;
  color: #111;
  border: none;
  padding: 1.1rem;
  width: 100%;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1rem;
}

.btn-continue:disabled {
  background: #555;
  cursor: not-allowed;
}

.delete-btn {
  background: none;
  border: none;
  color: #888;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  transition: all 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  width: 32px;
  height: 32px;
}

/* Диалог подтверждения удаления */
.confirm-dialog {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.confirm-dialog.active {
  display: flex;
}

.confirm-content {
  background: #1a1a1a;
  border-radius: 16px;
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  border: 1px solid #444;
  text-align: center;
  position: relative;
  margin: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.confirm-title {
  color: #d4af37;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.confirm-text {
  color: #ccc;
  margin-bottom: 2rem;
  font-size: 1.1rem;
  line-height: 1.5;
}

.confirm-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.confirm-btn {
  padding: 0.8rem 2rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
  font-size: 1rem;
  min-width: 120px;
}

.confirm-btn-yes {
  background: #ff5555;
  color: #fff;
}

.confirm-btn-yes:hover {
  background: #ff7777;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 85, 85, 0.3);
}

.confirm-btn-no {
  background: #444;
  color: #ccc;
  border: none;
}

.confirm-btn-no:hover {
  background: #555;
  transform: translateY(-2px);
}

/* Адаптив */
@media (max-width: 480px) {
  .services-grid { grid-template-columns: 1fr; }
  .modal-content { max-width: 96%; }
  .card-title { min-height: 3.6em; } /* чуть больше на мобильных */
}