/* ---------- Carousel: ready-to-paste ---------- */
:root {
  --carousel-gap: 22px;
}

/* Container that hides overflow */
.carousel-scroll {
  overflow: hidden;
  position: relative;
  margin: 20px 0;
  width: 100%;
  box-sizing: border-box;
}

/* Track that will be translated by JS */
.carousel-track {
  display: flex;
  gap: var(--carousel-gap);
  transition: transform 0.5s ease;
  will-change: transform;
  width: 1200px;
  box-sizing: border-box;
  /* no overflow here — parent hides overflow */
}

/* Base card: exactly 6 per row (accounting for 5 gaps) */
.recipe-card {
  box-sizing: border-box;
  min-width: 0; /* important to allow shrinking inside flex */
  flex: 0 0 calc((100% - (var(--carousel-gap) * 5)) / 6);
  max-width: calc((100% - (var(--carousel-gap) * 5)) / 6);
  height: 230px;
  padding: 8px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.recipe-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

.recipe-card img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
}

/* Info section */
.recipe-info {
  text-align: center;
  padding: 4px;
  flex-grow: 1;
}

.recipe-info h3 {
  font-size: 13px;
  margin: 3px 0;
  font-weight: 600;
  color: #333;
}

.recipe-info p {
  font-size: 11px;
  margin: 2px 0;
  color: #666;
  line-height: 1.2;
}

/* Button */
.carousel-order-btn {
  background: #ff9100;
  color: white;
  border: none;
  padding: 6px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 11px;
  margin-top: 5px;
  transition: background 0.3s ease;
  width: 100%;
}

.carousel-order-btn:hover {
  background: #ffb95d;
}

/* Header + nav */
.carousel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.carousel-header h2 {
  font-size: 18px;
  margin: 0;
  color: #333;
}

.carousel-nav button {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  padding: 5px 9px;
  border-radius: 50%;
  cursor: pointer;
  margin-left: 5px;
  font-size: 12px;
  transition: all 0.3s;
}

.carousel-nav button:hover {
  background: #e9ecef;
}

/* Responsive: fewer columns per row, accounting for gaps */
/* 4 columns */
@media (max-width: 1200px) {
  .recipe-card {
    flex: 0 0 calc((100% - (var(--carousel-gap) * 3)) / 4);
    max-width: calc((100% - (var(--carousel-gap) * 3)) / 4);
    height: 210px;
  }
  .recipe-card img { height: 70px; }
}

/* 3 columns */
@media (max-width: 900px) {
  .recipe-card {
    flex: 0 0 calc((100% - (var(--carousel-gap) * 2)) / 3);
    max-width: calc((100% - (var(--carousel-gap) * 2)) / 3);
    height: 190px;
  }
  .recipe-card img { height: 65px; }
}

/* 2 columns */
@media (max-width: 600px) {
  .recipe-card {
    flex: 0 0 calc((100% - var(--carousel-gap)) / 2);
    max-width: calc((100% - var(--carousel-gap)) / 2);
    height: 170px;
    padding: 6px;
  }
  .recipe-card img { height: 60px; }
  .recipe-info h3 { font-size: 11px; }
  .recipe-info p { font-size: 9px; }
  .carousel-order-btn { font-size: 10px; padding: 5px; }
}

/* Loading / empty states */
.loading-spinner, .no-recipes {
  text-align: center;
  padding: 20px;
  color: #666;
  font-style: italic;
  font-size: 14px;
}

.carousel-container {
  min-height: 180px;
}
