/* Shared gutters keep section headings, categories and cards aligned. */
.vg-home .homepage_section,
.vg-search .section_search {
  box-sizing: border-box;
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

.vg-home .homepage_section > .row,
.vg-search .section_search > .row {
  margin-left: 0;
  margin-right: 0;
}

.vg-home .homepage_section > .row > [class*="col-"],
.vg-search .section_search > .row > [class*="col-"] {
  padding-left: 0;
  padding-right: 0;
}

.vg-home .title-area {
  width: 100%;
  padding: 0 0 16px;
}

/* Owl owns carousel item widths; result-grid minimum widths must not apply. */
.vg-home .owl-carousel .restaurants {
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
}

.vg-home .owl-carousel .restaurant-status {
  left: 0 !important;
}

.vg-home .owl-carousel .post-title h5 {
  min-height: 48px;
  overflow-wrap: anywhere;
}

.vg-home .owl-carousel .owl-nav.disabled {
  display: none !important;
}

/* Controls stay below the cards rather than overlapping long section titles. */
.vg-home .homepage_section .owl-carousel .owl-nav {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.vg-home .homepage_section .owl-carousel .owl-nav button.owl-prev,
.vg-home .homepage_section .owl-carousel .owl-nav button.owl-next {
  position: static;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0 !important;
}

.listing-card-logo {
  position: absolute;
  left: 50%;
  top: 30%;
  width: 90px;
  height: 90px;
  padding: 5px;
  transform: translateX(-50%);
}

/* A nested Bootstrap container must also fit inside the cover's own gutters. */
.vg-listing-cover,
.vg-listing-cover * {
  box-sizing: border-box;
}

.vg-listing-cover > .container {
  max-width: 100%;
}

.vg-listing-cover .food-place-main {
  margin-left: 0;
  margin-right: 0;
}

.vg-listing-cover .business-card,
.vg-listing-cover .place-descr {
  max-width: 100%;
  min-width: 0;
}

/* Search results fill the available row without fixed card minimum widths. */
.vg-search .listing.classic-grid > ul.row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 24px;
  margin: 0 15px;
  padding: 0;
}

.vg-search .listing.classic-grid > ul.row::before,
.vg-search .listing.classic-grid > ul.row::after {
  display: none;
}

.vg-search .listing.classic-grid > ul.row > .restaurants {
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
}

.vg-search .listing.classic-grid .post-title h5 {
  overflow-wrap: anywhere;
}

@media (max-width: 991px) {
  .vg-search .listing.classic-grid > ul.row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .vg-home .homepage_section,
  .vg-search .section_search {
    padding-left: 16px;
    padding-right: 16px;
  }

  .vg-home .listing-main-search,
  .vg-search .listing-main-search {
    width: 100%;
  }

  .vg-search .listing.classic-grid > ul.row {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Keep the menu and logo in their own row on narrow screens. */
@media (max-width: 980px) {
  #header.court .main-header {
    padding: 12px 16px;
  }

  #header.court .main-header > .wide {
    width: 100%;
  }

  #header.court .main-header > .wide > .row {
    display: grid !important;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    width: 100%;
    margin: 0;
  }

  #header.court .main-header > .wide > .row::before,
  #header.court .main-header > .wide > .row::after {
    display: none;
  }

  #header.court .main-header .mobile-menu,
  #header.court .main-header .sliding-nav {
    width: 44px;
    min-width: 0;
    height: 44px;
  }

  #header.court .main-header .menu-toggle {
    margin-top: 0;
  }

  #header.court .main-header .logo {
    width: auto !important;
    min-width: 0 !important;
    float: none;
    justify-content: flex-start;
  }

  #header.court .main-header .figure {
    padding: 0 !important;
  }

  #header.court .main-header .login-option {
    grid-column: 1 / -1;
    min-width: 0 !important;
    float: none !important;
    justify-content: stretch !important;
  }

  #header.court .main-header .search-box {
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    padding: 0;
  }

  #header.court .main-header .search-li form {
    position: relative;
  }

  #header.court .main-header .search-li input[type="text"] {
    box-sizing: border-box;
    width: 100%;
    height: 44px !important;
    min-height: 44px;
    padding: 0 48px 0 16px;
    font-size: 16px !important;
  }

  #header.court .main-header .search-li a {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
  }

  #header.court .main-header .search-li a .restaurant-element-search-btn {
    position: static;
    width: auto;
    height: auto;
    line-height: 1;
  }

  #header.court:not(.has-header-search) .login-option {
    display: none;
  }
}
