/* ==========================================================================
   Recipe Grid & Cards Layout (FOODEAT Mockup Style)
   ========================================================================== */

.recipes-results-section {
  padding: 50px 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 12px;
}

.results-heading {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-primary);
}

.heading-with-count {
  display: flex;
  align-items: center;
  gap: 12px;
}

.results-count-badge {
  background: var(--accent-primary);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  margin-top: 6px;
}

.results-filter-info {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.results-filter-info span {
  color: var(--accent-primary);
  font-weight: 700;
}

/* Grid Layout */
.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 35px;
}

/* Carousel / Sliding View Layout */
.carousel-wrapper {
  position: relative;
  width: 100%;
  margin: 0 auto;
}

.carousel-track-container {
  overflow: hidden;
  width: 100%;
  padding: 10px 0 25px 0; /* Padding for card hover scale and shadows */
}

.carousel-track {
  display: flex;
  gap: 30px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;  /* IE/Edge */
  padding: 0 10px;
  align-items: stretch; /* Stretch cards to equal height */
}

.carousel-track::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.carousel-track .recipe-card {
  flex: 0 0 calc(33.333% - 20px);
  min-width: 320px;
  scroll-snap-align: start;
  height: auto; /* Let flexbox stretch control card height */
}

/* Carousel Navigation Buttons */
.carousel-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 54px;
  height: 54px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  z-index: 10;
  transition: all var(--transition-fast);
}

.carousel-nav-btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.5px;
}

.carousel-nav-btn:hover {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
  transform: translateY(-50%) scale(1.08);
}

.carousel-nav-btn.prev {
  left: -27px;
}

.carousel-nav-btn.next {
  right: -27px;
}

.carousel-nav-btn.disabled {
  opacity: 0;
  pointer-events: none;
}

/* Responsive Overrides */
@media (max-width: 1024px) {
  .carousel-track .recipe-card {
    flex: 0 0 calc(50% - 15px);
  }
}

@media (max-width: 768px) {
  .carousel-track .recipe-card {
    flex: 0 0 100%;
  }
  .carousel-nav-btn {
    width: 44px;
    height: 44px;
  }
  .carousel-nav-btn.prev {
    left: -10px;
  }
  .carousel-nav-btn.next {
    right: -10px;
  }
}

/* Card Styling (Highly Rounded Cream Box) */
.recipe-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
  position: relative;
  padding: 24px;
}

.recipe-card:hover {
  transform: translateY(-5px);
  border-color: rgba(231, 111, 81, 0.2);
  box-shadow: var(--shadow-md);
}

/* Card Image Area (Circle Bowl Plate style) */
.card-image-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  height: 200px;
  align-items: center;
}

.card-circle-plate-wrapper {
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: var(--radius-full);
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(62, 39, 35, 0.15), 0 2px 5px rgba(62, 39, 35, 0.08);
  border: 12px solid #ffffff; /* Thick white plate rim */
  background-color: #ffffff;
  transition: transform var(--transition-slow);
}

.card-circle-plate-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  /* Inset shadow to create a 3D plate depth over the food image */
  box-shadow: inset 0 8px 12px rgba(0, 0, 0, 0.15), inset 0 -4px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(62, 39, 35, 0.08); /* Rim divider line */
  pointer-events: none;
}

.card-circle-plate-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recipe-card:hover .card-circle-plate-wrapper {
  transform: scale(1.05) rotate(4deg);
}

/* Category Badge Overlay */
.card-category-badge {
  position: absolute;
  top: 0;
  left: 0;
  background: var(--bg-glass);
  backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(231, 111, 81, 0.15);
  color: var(--accent-primary);
  padding: 4px 14px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Matching Status Badges */
.card-match-badge {
  position: absolute;
  top: 0;
  right: 0;
  backdrop-filter: var(--glass-blur);
  padding: 4px 14px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  border: 1px solid transparent;
}

.match-perfect {
  background: rgba(77, 124, 91, 0.1);
  color: #2A5A3B;
  border-color: rgba(77, 124, 91, 0.2);
}

.match-partial {
  background: rgba(244, 162, 97, 0.1);
  color: #B25E2B;
  border-color: rgba(244, 162, 97, 0.2);
}

.match-low {
  background: rgba(141, 110, 99, 0.1);
  color: #5D4037;
  border-color: rgba(141, 110, 99, 0.2);
}

/* Card Body Content */
.card-body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* Title & Rating Inline Row */
.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-primary);
}

.card-rating-badge {
  color: var(--accent-primary);
  font-weight: 800;
  font-size: 1.15rem;
  white-space: nowrap;
}

.card-desc {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Stars & Price Row (Mockup style) */
.card-stars-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(62, 39, 35, 0.04);
  padding-bottom: 12px;
}

.card-stars-container {
  display: flex;
  gap: 4px;
}

.star-svg-filled {
  color: var(--accent-primary);
  display: inline-flex;
  align-items: center;
}

.star-svg-filled svg {
  width: 15px;
  height: 15px;
}

.star-svg-empty {
  color: #D7CCC8;
  display: inline-flex;
  align-items: center;
}

.star-svg-empty svg {
  width: 15px;
  height: 15px;
}

.card-price-label {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* Card Metadata (Clock and Fire SVGs) */
.card-meta {
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 20px;
}

.card-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.meta-icon {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
}

.meta-icon svg {
  width: 14px;
  height: 14px;
}

/* Card Actions */
.card-actions {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 10px;
  margin-top: auto;
}

.btn-card-primary {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 12px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  transition: var(--transition-fast);
  color: var(--text-primary);
}

.btn-card-primary:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
}

.btn-card-secondary {
  background: rgba(231, 111, 81, 0.05);
  border: 1px solid rgba(231, 111, 81, 0.15);
  color: var(--accent-primary);
  padding: 12px 12px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.btn-card-secondary:hover {
  background: rgba(231, 111, 81, 0.12);
  border-color: var(--accent-primary);
}

.btn-action-icon {
  display: inline-flex;
  align-items: center;
}

.btn-action-icon svg {
  width: 14px;
  height: 14px;
}

/* Empty State */
.recipes-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-secondary);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
}

.recipes-empty-state .empty-icon {
  margin-bottom: 16px;
  display: inline-flex;
  color: var(--text-muted);
}

.recipes-empty-state .empty-icon svg {
  width: 48px;
  height: 48px;
}

.recipes-empty-state h4 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.recipes-empty-state p {
  color: var(--text-secondary);
  max-width: 400px;
  margin: 0 auto;
}

.btn-action-icon-svg {
  display: inline-flex;
  align-items: center;
}

.btn-action-icon-svg svg {
  width: 15px;
  height: 15px;
}

/* Card Floating Actions (Save and Delete) */
.card-float-actions {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
}

.card-float-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
  padding: 0;
}

.card-float-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.2px;
}

.card-float-btn:hover {
  transform: scale(1.1);
  background: var(--bg-tertiary);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.card-float-btn.btn-save-recipe.saved {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

.card-float-btn.btn-save-recipe.saved svg {
  fill: #fff;
}

.card-float-btn.btn-save-recipe.saved:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.card-float-btn.btn-delete-default:hover,
.card-float-btn.btn-delete-saved:hover {
  background: #fdf2f2;
  color: #c53030;
  border-color: #feb2b2;
}
