/* ===== Cocktails-side – matcher mainstyles.css (sort / guld) ===== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* --- Søgning og filtre --- */
.filter-section {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.search-box {
  flex: 1 1 300px;
}

.filter-box {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  flex: 1 1 300px;
}

.filter-box select {
  flex: 1 1 140px;
}

.filter-section input,
.filter-section select {
  width: 100%;
  padding: 12px 14px;
  background: #1a1a1a;
  color: #fff;
  border: 1px solid #444;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
}

.filter-section input::placeholder {
  color: #888;
}

.filter-section input:focus,
.filter-section select:focus {
  outline: none;
  border-color: #ffd166;
  box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.25);
}

/* --- Grid med kort --- */
.drinks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  align-items: start;
}

/* --- Vendekort (flip card) --- */
.flip-hint {
  margin: -8px 0 16px;
  color: #888;
  font-size: 0.9rem;
}

.flip-card {
  height: 460px;
  transition: height 0.4s ease;
  perspective: 1200px;
  cursor: pointer;
  border-radius: 10px;
  outline: none;
}

.flip-card:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 209, 102, 0.6);
}

.flip-inner {
  position: relative;
  -webkit-transform-style: preserve-3d;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
}

.flip-card.flipped .flip-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 10px;
  border: 1px solid #333;
  border-top: 3px solid #ffd166;
  background: #1a1a1a;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

/* Forside */
.card-front {
  display: flex;
  align-items: flex-end;
  transform: rotateY(0deg); /* nødvendig for iPhone/Safari */
  transition: box-shadow 0.2s ease, visibility 0s linear 0.35s;
}

/* iPhone/Safari: skjul den side der vender væk midt i vendingen,
   så tekst og mærkater ikke skinner spejlvendt igennem */
.card-face * {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.flip-card.flipped .card-front {
  visibility: hidden;
}

.flip-card:hover .card-front {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6), 0 0 14px rgba(255, 209, 102, 0.2);
}

.drink-illustration,
.drink-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.drink-illustration svg {
  width: 100%;
  height: 100%;
  display: block;
  transition: transform 0.4s ease;
}

.drink-photo {
  object-fit: cover;
  transition: transform 0.4s ease;
}

.flip-card:hover .drink-illustration svg,
.flip-card:hover .drink-photo {
  transform: scale(1.04);
}

.card-front .badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
}

.front-title {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 50px 20px 18px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 30%, rgba(0, 0, 0, 0));
}

.front-title h2 {
  margin: 0;
  font-size: 1.6rem;
  color: #ffd166;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.front-sub {
  display: block;
  margin-top: 2px;
  font-size: 0.9rem;
  color: #ccc;
}

.flip-icon {
  position: absolute;
  top: 12px;
  left: 14px;
  z-index: 2;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 209, 102, 0.6);
  color: #ffd166;
  font-size: 1.1rem;
}

/* Bagside */
.flip-card.flipped .card-back {
  visibility: visible;
}

.card-back {
  transform: rotateY(180deg);
  visibility: hidden;
  transition: visibility 0s linear 0.35s;
  display: flex;
  flex-direction: column;
  padding: 18px 20px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #444 transparent;
}

.flip-back-hint {
  display: block;
  margin-top: 10px;
  font-size: 0.8rem;
  color: #888;
  text-align: right;
}

@media (prefers-reduced-motion: reduce) {
  .flip-card,
  .flip-inner,
  .card-front,
  .card-back { transition: none; }
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.card-header h2 {
  margin: 0;
  font-size: 1.35rem;
  color: #ffd166;
}

.badge {
  flex-shrink: 0;
  background: #ffd166;
  color: #000;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 20px;
}

.meta-info {
  font-size: 0.9rem;
  color: #ccc;
  padding-bottom: 10px;
  border-bottom: 1px solid #333;
}

.meta-info p {
  margin: 3px 0;
}

.meta-info strong {
  color: #fff;
}

.section-title {
  margin: 14px 0 6px;
  font-size: 0.8rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #ffd166;
}

.ingredients-list,
.instructions-list {
  margin: 0;
  padding-left: 20px;
  line-height: 1.5;
  font-size: 0.95rem;
}

.ingredients-list li::marker {
  color: #ffd166;
}

.instructions-list li {
  margin-bottom: 4px;
}

.garnish-info {
  margin-top: 14px;
  padding: 8px 12px;
  background: #2b2b2b;
  border-left: 3px solid #ffd166;
  border-radius: 4px;
  font-size: 0.9rem;
}

.card-footer {
  margin-top: auto;
  padding-top: 14px;
}

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 0.78rem;
  color: #aaa;
  background: #0d0d0d;
  border: 1px solid #333;
  padding: 3px 8px;
  border-radius: 12px;
}

/* --- Beskeder --- */
.no-results,
.error-msg {
  grid-column: 1 / -1;
  text-align: center;
  padding: 30px;
  background: #1a1a1a;
  border: 1px dashed #444;
  border-radius: 10px;
  color: #ccc;
}

.error-msg code {
  color: #ffd166;
}

/* --- Mobil --- */
@media (max-width: 768px) {
  .container {
    padding: 14px;
  }

  .topbar h1 {
    font-size: 1rem;
  }

  .drinks-grid {
    grid-template-columns: 1fr;
  }

  .flip-card {
    height: 440px;
    width: 92%;
    justify-self: center;
  }
}
