*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #111;
  color: #f5f5f5;
}

.page-header {
  padding: 1.5rem 1rem;
  text-align: center;
  background: #181818;
  border-bottom: 1px solid #333;
}

.page-header h1 {
  margin: 0;
  font-size: 1.8rem;
}

.page-subtitle {
  margin: 0.3rem 0 0;
  color: #bbb;
  font-size: 0.9rem;
}

main {
  padding: 1rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 140px;
}

.filter-group label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #aaa;
}

.filter-group select {
  background: #181818;
  color: #f5f5f5;
  border-radius: 6px;
  border: 1px solid #333;
  padding: 0.35rem 0.6rem;
  font-size: 0.9rem;
}

.cocktail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.cocktail-card {
  background: #1b1b1b;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease;
  display: flex;
  flex-direction: column;
}

.cocktail-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
  background: #222;
}

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

.cocktail-card-body {
  padding: 0.6rem 0.7rem 0.8rem;
}

.cocktail-card-name {
  margin: 0;
  font-size: 1rem;
}

.cocktail-card-type {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #aaa;
}

.cocktail-card-meta {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  color: #888;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 20;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 30;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.modal[aria-hidden="false"] {
  pointer-events: auto;
  opacity: 1;
}

.modal-content {
  background: #181818;
  border-radius: 10px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 1rem 1.2rem 0.8rem;
}

.modal-close {
  position: absolute;
  top: 0.4rem;
  right: 0.6rem;
  border: none;
  background: transparent;
  color: #888;
  font-size: 1.6rem;
  cursor: pointer;
}

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

.modal-main {
  display: flex;
  gap: 1rem;
  overflow: auto;
}

.modal-image-wrapper {
  flex: 0 0 260px;
  max-width: 260px;
}

.modal-image-wrapper img {
  width: 100%;
  border-radius: 8px;
  display: block;
  background: #000;
}

.modal-body {
  flex: 1;
}

.modal-body h2 {
  margin-top: 0;
  margin-bottom: 0.2rem;
}

.modal-type {
  margin-top: 0;
  color: #ccc;
  font-size: 0.9rem;
}

.modal-body h3 {
  margin-bottom: 0.2rem;
  margin-top: 0.8rem;
}

.modal-body p {
  margin-top: 0;
  white-space: pre-line;
}

.modal-body ul {
  margin: 0;
  padding-left: 1.1rem;
}

.modal-body li {
  margin-bottom: 0.1rem;
}

.modal-nav {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.7rem 0 0.4rem;
  margin-top: 0.4rem;
  border-top: 1px solid #333;
}

.nav-button {
  flex: 1;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #444;
  background: #222;
  color: #eee;
  cursor: pointer;
  font-size: 0.95rem;
}

.nav-button:hover {
  background: #333;
}

@media (max-width: 720px) {
  .modal-main {
    flex-direction: column;
  }

  .modal-image-wrapper {
    max-width: none;
    flex: 0 0 auto;
  }
}

