/* Agora Kitchen V81 — consistent sauce photography and browser-safe ordering */

.sauce-photo-option {
  display: grid !important;
  grid-template-columns: 108px minmax(0, 1fr) !important;
  grid-template-rows: 1fr 1fr !important;
  justify-content: stretch !important;
  align-items: center !important;
  column-gap: 13px !important;
  row-gap: 2px !important;
  width: 100% !important;
  min-height: 128px !important;
  padding: 10px !important;
}

.sauce-photo-option .modifier-photo-frame {
  grid-column: 1 !important;
  grid-row: 1 / 3 !important;
  display: block !important;
  width: 108px !important;
  height: 108px !important;
  min-width: 108px !important;
  overflow: hidden !important;
  border-radius: 11px !important;
}

.sauce-photo-option .modifier-photo-frame img,
.sauce-photo-option:not(.sauce-reference) .modifier-photo-frame img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  margin: 0 !important;
  border-radius: 0 !important;
  transform: none !important;
}

.sauce-photo-option .modifier-photo-frame + span {
  grid-column: 2 !important;
  grid-row: 1 !important;
  align-self: end !important;
  min-width: 0;
}

.sauce-photo-option > small {
  grid-column: 2 !important;
  grid-row: 2 !important;
  align-self: start !important;
}

#collection {
  scroll-margin-top: 84px;
}

.custom-title {
  min-width: 0;
}

.custom-item-description {
  max-width: 650px;
  margin: 4px 0 0;
  color: #667a80;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.custom-head > .close {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
}

@media (max-width: 600px) {
  .sauce-photo-option {
    grid-template-columns: 96px minmax(0, 1fr) !important;
    min-height: 116px !important;
  }

  .sauce-photo-option .modifier-photo-frame {
    width: 96px !important;
    height: 96px !important;
    min-width: 96px !important;
  }

  #collection {
    scroll-margin-top: calc(72px + env(safe-area-inset-top));
  }

  .customiser {
    min-height: 100dvh !important;
    align-items: flex-start !important;
    padding: max(12px, env(safe-area-inset-top)) 0 max(12px, env(safe-area-inset-bottom)) !important;
  }

  .custom-card {
    width: 100% !important;
    max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
    border-radius: 22px !important;
  }

  .custom-head {
    top: 0 !important;
    padding: 14px 16px 12px !important;
    align-items: flex-start !important;
  }

  .custom-head h2 {
    margin: 0 0 3px !important;
    font-size: 23px !important;
    line-height: 1.12 !important;
  }

  .custom-item-description {
    margin-top: 5px;
    font-size: 13px;
    line-height: 1.35;
  }

  #menu .menu-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
  }

  #menu .menu-grid > .menu-item-card.with-photo {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: stretch !important;
    width: 100% !important;
    min-height: 168px !important;
    height: auto !important;
    max-height: none !important;
    overflow: hidden !important;
    border-radius: 16px !important;
  }

  #menu .menu-grid > .menu-item-card.with-photo > .menu-item-media {
    display: block !important;
    flex: 0 0 40% !important;
    width: 40% !important;
    max-width: 40% !important;
    min-width: 0 !important;
    min-height: 168px !important;
    height: auto !important;
    align-self: stretch !important;
    aspect-ratio: auto !important;
  }

  #menu .menu-grid > .menu-item-card.with-photo > .menu-item-media > img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 168px !important;
    object-fit: cover !important;
    object-position: center !important;
  }

  #menu .menu-grid > .menu-item-card.with-photo > .menu-item-details {
    display: flex !important;
    flex: 1 1 60% !important;
    flex-direction: column !important;
    width: 60% !important;
    max-width: 60% !important;
    min-width: 0 !important;
    min-height: 168px !important;
    height: auto !important;
    padding: 13px 12px !important;
    overflow: hidden !important;
  }

  #menu .menu-item-details h3 {
    display: block !important;
    width: 100% !important;
    margin: 0 0 5px !important;
    font-size: 17px !important;
    line-height: 1.15 !important;
    overflow-wrap: anywhere !important;
  }

  #menu .menu-item-description {
    display: -webkit-box !important;
    width: 100% !important;
    margin: 0 0 6px !important;
    overflow: hidden !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    font-size: 12px !important;
    line-height: 1.25 !important;
  }

  #menu .menu-item-actions {
    display: flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 6px !important;
    width: 100% !important;
    margin-top: auto !important;
  }

  #menu .menu-item-price {
    display: block !important;
    min-width: 0 !important;
    font-size: 14px !important;
    line-height: 1.15 !important;
    white-space: normal !important;
  }

  #menu .menu-item-choose {
    display: block !important;
    flex: 0 0 auto !important;
    min-width: 68px !important;
    height: 38px !important;
    padding: 0 9px !important;
    font-size: 13px !important;
  }

  #menu .menu-grid > .menu-item-card.without-photo {
    display: block !important;
    width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
  }

  #menu .menu-grid > .menu-item-card.without-photo > .menu-item-details {
    display: flex !important;
    width: 100% !important;
    min-height: 118px !important;
    padding: 13px 14px !important;
  }
}
