/* ============================================
   MENU SECTION — editorial photo-grid layout
   Matches design: title + desc above, 3-col auto-reflow grid,
   image square + underlined link title below.
   Cards are deletable from admin; grid always reflows cleanly.
   ============================================ */

.menu-section {
  max-width: 1200px;
  margin: 48px auto 60px;
  padding: 0 24px;
}

.menu-section-header {
  margin-bottom: 40px;
}

.menu-section-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 14px;
  letter-spacing: -0.5px;
}

.menu-section-desc {
  font-size: 1rem;
  color: #444;
  max-width: 540px;
  line-height: 1.65;
  margin: 0;
}

/* Auto-reflow grid: fills left-to-right, no fixed rows */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 28px;
  /* Override any Bootstrap container constraints */
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  /* Remove old transform scaling */
  transform: none !important;
}

/* Arrangementer page background */
body,
main.flex-grow-1 {
  background-color: #fff5ee !important;
}

.menu-grid-item {
  display: flex;
  flex-direction: column;
}

/* When only 4 cards are visible (both test menus off), use 4 columns in one row */
.menu-grid.grid-4-cols {
  grid-template-columns: repeat(4, 1fr);
  gap: 40px 28px;
}

/* The clickable link wrapping image + title */
.menu-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* Square image area */
.menu-card-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #e8e0d4;
  transition: opacity 0.25s ease;
}

.menu-card-link:hover .menu-card-img {
  opacity: 0.88;
}

/* Title below image — underlined, like in the screenshot */
.menu-card-title {
  display: inline-block;
  margin-top: 12px;
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: #1a1a1a;
  line-height: 1.4;
  transition: color 0.2s ease;
}

.menu-card-link:hover .menu-card-title {
  color: #bf6d4b;
  text-decoration-color: #bf6d4b;
}

/* ── Responsive breakpoints ── */

/* Tablet: 2 columns */
@media (max-width: 900px) {
  .menu-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px 20px;
  }

  /* Override 4-column layout on tablet */
  .menu-grid.grid-4-cols {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile: 1 column */
@media (max-width: 540px) {
  .menu-section {
    padding: 0 16px;
    margin-top: 32px;
  }

  .menu-section-title {
    font-size: 1.75rem;
  }

  .menu-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  /* Override 4-column layout on mobile */
  .menu-grid.grid-4-cols {
    grid-template-columns: 1fr;
  }

  .menu-card-img {
    aspect-ratio: 4 / 3;
  }
}

/* Kill old card scaling on all screen sizes */
@media (min-width: 1920px) and (max-width: 2560px) {

  .arr-cards-container,
  .menu-cards,
  .people-step-split {
    transform: none !important;
  }
}

@media (min-width: 1600px) and (max-width: 1919px) {

  .arr-cards-container,
  .menu-cards,
  .people-step-split {
    transform: none !important;
  }
}

@media (min-width: 1200px) and (max-width: 1599px) {

  .arr-cards-container,
  .menu-cards,
  .people-step-split {
    transform: none !important;
  }
}

@media (min-width: 992px) and (max-width: 1199px) {

  .arr-cards-container,
  .menu-cards,
  .people-step-split {
    transform: none !important;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {

  .arr-cards-container,
  .menu-cards,
  .people-step-split {
    transform: none !important;
  }
}


@media (max-width: 991.98px) {

  /* Remove padding from body on mobile for arrangementer page */
  body {
    padding: 0 !important;
  }

  /* Remove padding from navbar container on mobile */
  .navbar .container {
    padding-right: 0 !important;
    padding-top: 12px !important;
    padding-bottom: 11px !important;
    padding-left: 12px !important;
  }

  /* Remove padding from navbar on mobile */
  .navbar {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  /* Navbar cart square padding and height */
  .navbar-cart-square {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    height: 60px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Mobile menu positioning - close to navbar without overlap */
  .offcanvas-body {
    padding-top: 0 !important;
    margin-top: 0 !important;
  }

  /* Fix navbar sticky behavior */
  .navbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1050 !important;
  }

  /* Remove mobile gap under navbar */
  body {
    padding-top: 0 !important;
  }
}

/* ── Mobile responsive fixes for arrangementer page ── */

/* ── Background images are now inline on .menu-card-img ── */

.course-step {
  margin-bottom: 2rem;
  display: block !important;
  visibility: visible !important;
}

.course-step.active {
  display: block !important;
  visibility: visible !important;
}

/* Single page layout for all menu items */
.menu-items-single-page {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.menu-category {
  background: transparent;
  padding: 1.5rem;
}

.menu-category h4 {
  display: none !important;
}

.items-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.item {
  background: #fff;
  padding: 1rem;
  transition: all 0.3s ease;
  cursor: pointer;
  width: 100%;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  margin-bottom: 0.5rem;
}

.item:hover {
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
}

.item.selected {
  background: transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-bottom: 2px solid #b3ba8e;
}

/* Desktop only underline for selected menu items */
@media (min-width: 768px) {
  .item.selected {
    border-bottom: 2px solid #b3ba8e;
  }
}

.item.disabled {
  cursor: not-allowed;
}

.count-badge {
  background: transparent;
  border: none;
  color: black;
  font-weight: normal;
}

/* Complete Order Button */
.complete-order-btn {
  background: transparent;
  border: 2px solid #bf6d4b;
  color: #bf6d4b;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 0;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.complete-order-btn:hover {
  background: #bf6d4b;
  color: #fff;
}

.complete-order-btn:active {
  background: #bf6d4b;
  color: #fff;
}

.complete-order-btn:disabled {
  background: #6c757d;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Menu Header */
.menu-header {
  background: transparent;
  padding: 2rem;
  margin-bottom: 2rem;
}

.menu-title {
  color: var(--bs-primary);
  font-weight: 700;
  font-size: 2rem;
}

.menu-price {
  font-size: 1.5rem;
  font-weight: 600;
}

.menu-description {
  font-size: 1.1rem;
  font-style: italic;
}

.course-step h4 {
  color: var(--bs-primary);
  margin-bottom: 1rem;
}

.item {
  margin-bottom: 1rem;
}

.item .card {
  transition: all 0.3s ease;
  border: 1px solid #dee2e6;
  background: #fff;
}

.item .card:hover {
  border-color: var(--bs-primary);
  transform: translateY(-2px);
}

.item.selected .card {
  border-color: var(--bs-primary);
  background-color: rgba(13, 110, 253, 0.1);
}

.item.disabled {
  pointer-events: none;
}

.btn-select-item {
  transition: all 0.3s ease;
}

.item.selected .btn-select-item {
  background-color: var(--bs-primary);
  color: white;
}

.progress {
  height: 8px;
  border-radius: 4px;
}

.progress-bar {
  transition: width 0.3s ease;
}

/* ── Menu card selected/hover states ── */

.fit-cover {
  object-fit: cover;
}

.extra-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid #dee2e6;
}

.extra-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.extra-card {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.extra-card .card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.extra-card .card-text {
  font-size: 0.9rem;
  color: #6c757d;
  margin-bottom: 1rem;
}

.extra-card .price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--bs-primary);
  margin-top: auto;
}

/* Size Options */
.size-options {
  margin-bottom: 16px !important;
  padding: 0 12px;
}

.size-option {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 12px 0;
  transform: none !important;
  position: relative;
  box-sizing: border-box;
  z-index: 6;
}

.size-option.active,
.size-option:hover {
  transform: none !important;
}

/* Accordion Styles */
.accordion .accordion-button {
  background-color: #f5e1d9;
  border: 0;
  color: #495057;
  border-radius: 0;
  box-shadow: none;
  padding: 12px 0;
}

.accordion .accordion-button:not(.collapsed) {
  background-color: #fcf8f2;
  color: #495057;
  box-shadow: none;
}

.accordion .accordion-button::after {
  filter: invert(35%);
}

.accordion .accordion-header {
  border-bottom: 1px solid #be6d4c;
}

/* Ensure item titles are visible */
.item-title {
  color: #333;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.item-allergens {
  color: #6c757d;
  font-size: 0.875rem;
}

/* Hide hero sections when hvor mange is visible on mobile */
@media (max-width: 991.98px) {

  #people-step-arr:not([style*="display: none"])~.hero-section,
  #people-step-arr:not([style*="display: none"])~section[style*="background: linear-gradient"],
  #people-step-arr:not([style*="display: none"])~.menu-hero,
  #people-step-arr:not([style*="display: none"])~section.menu-hero,
  #people-step-arr:not([style*="display: none"])~section[class*="menu-hero"] {
    display: none !important;
  }

  /* Hide all hero sections when people-step is visible */
  body:has(#people-step-arr:not([style*="display: none"])) .menu-hero,
  body:has(#people-step-arr:not([style*="display: none"])) section[class*="menu-hero"],
  body:has(#people-step-arr:not([style*="display: none"])) section[style*="background: linear-gradient"] {
    display: none !important;
  }

  /* Force hide hero sections when people-step is visible on mobile */
  #people-step-arr:not([style*="display: none"])~* .menu-hero,
  #people-step-arr:not([style*="display: none"])~* section[class*="menu-hero"],
  #people-step-arr:not([style*="display: none"])~* section[style*="background: linear-gradient"] {
    display: none !important;
  }

  /* Hide hero sections when people-step is visible - more specific selectors */
  #people-step-arr:not([style*="display: none"])~.hero-section,
  #people-step-arr:not([style*="display: none"])~section[style*="background: linear-gradient"],
  #people-step-arr:not([style*="display: none"])~.menu-hero,
  #people-step-arr:not([style*="display: none"])~section.menu-hero,
  #people-step-arr:not([style*="display: none"])~section[class*="menu-hero"],
  #people-step-arr:not([style*="display: none"])~* .menu-hero,
  #people-step-arr:not([style*="display: none"])~* section[class*="menu-hero"],
  #people-step-arr:not([style*="display: none"])~* section[style*="background: linear-gradient"] {
    display: none !important;
  }
}