:root {
  --food-accent: #e76f2e;
  --food-accent-dark: #b94a18;
  --food-cream: #fffaf2;
  --food-border: #f0dfca;
  --food-text: #2d2926;
  --food-muted: #756c64;
}

.single-food .ab-search-bar,
.ab-page[data-food-view="write"] .ab-search-bar {
  display: none;
}

.food-write-fab {
  position: fixed;
  right: 22px;
  bottom: 24px;
  z-index: 50;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--food-accent);
  box-shadow: 0 9px 24px rgba(185, 74, 24, 0.32);
  color: #fff;
  font-size: 30px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
}

.food-write-fab:hover {
  background: var(--food-accent-dark);
  color: #fff;
}

.anabada-food-page,
.food-single-page {
  min-height: calc(100vh - 100px);
  background: linear-gradient(180deg, #fff5e7 0, var(--food-cream) 240px, #fff 100%);
  color: var(--food-text);
}

.anabada-food-page {
  padding: 0 24px 72px;
}

.food-category-tabs-shell,
.food-content-shell,
.food-results-header,
.food-pagination,
.food-empty {
  width: min(1180px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.food-category-tabs {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  overflow-x: auto;
  padding: 12px 0 11px;
  border-bottom: 1px solid #f0dfca;
  scrollbar-width: none;
}

.food-category-tabs-shell {
  position: relative;
}

.food-category-all-wrap,
.food-category-group {
  flex: 0 0 auto;
  display: grid;
  gap: 5px;
}

.food-category-group-label {
  min-height: 13px;
  color: #8a776a;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: none;
  transform: translateY(-2px);
}

.food-category-group-tabs {
  display: flex;
  gap: 5px;
}

.food-category-group--recipe .food-category-group-label {
  color: #bd5a22;
}

.food-category-group--restaurant .food-category-group-label {
  color: #a9443c;
}

.food-category-group--market .food-category-group-label {
  color: #23766d;
}

.food-category-tabs-shell .category-scroll-prev,
.food-category-tabs-shell .category-scroll-next {
  display: none;
}

.food-category-tabs::-webkit-scrollbar {
  display: none;
}

.food-category-tab {
  flex: 0 0 auto;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #f7efe6;
  color: var(--food-text);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.food-category-tab:hover,
.food-category-tab.active {
  border-color: var(--food-accent);
  background: var(--food-accent);
  color: #fff;
}

.food-category-group--recipe .food-category-tab {
  background: #fff0e3;
  color: #8d431d;
}

.food-category-group--recipe .food-category-tab:hover,
.food-category-group--recipe .food-category-tab.active {
  border-color: #e76f2e;
  background: #e76f2e;
  color: #fff;
}

.food-category-group--restaurant .food-category-tab {
  background: #fff0ee;
  color: #8e3e38;
}

.food-category-group--restaurant .food-category-tab:hover,
.food-category-group--restaurant .food-category-tab.active {
  border-color: #c95d52;
  background: #c95d52;
  color: #fff;
}

.food-category-group--market .food-category-tab {
  background: #eaf7f4;
  color: #21675f;
}

.food-category-group--market .food-category-tab:hover,
.food-category-group--market .food-category-tab.active {
  border-color: #318b80;
  background: #318b80;
  color: #fff;
}

.food-content-shell {
  width: min(1400px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 28px;
  padding-top: 24px;
}

.food-content-main {
  min-width: 0;
}

.food-right-rail {
  width: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 120px;
  align-self: start;
}

.food-right-rail > * {
  flex: 0 0 auto;
}

.food-ad-placeholder {
  width: 200px;
  min-height: 300px;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  border: 1px dashed #cfc7bf;
  border-radius: 16px;
  background: #f7f7f7;
  color: #777;
  font-size: 13px;
}

.food-results-header {
  margin-bottom: 17px;
}

.food-results-header h1 {
  margin: 0;
  font-size: 21px;
}

.food-term-description {
  margin-top: 5px;
  color: var(--food-muted);
  font-size: 13px;
}

.food-card-grid {
  display: grid;
  grid-template-columns: repeat(5, 200px);
  gap: 20px;
  justify-content: center;
}

.food-card {
  width: 200px;
  max-width: 200px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #f0e6da;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 8px 26px rgba(82, 51, 30, 0.07);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.food-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 13px 32px rgba(82, 51, 30, 0.12);
}

.food-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.food-card-image {
  width: 100%;
  height: 260px;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #f6eee4;
}

.food-card-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.food-card:hover .food-card-image img {
  transform: scale(1.025);
}

.food-card-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  gap: 5px;
  text-align: center;
  color: #9b8170;
}

.food-card-placeholder span {
  font-size: 34px;
}

.food-card-placeholder small {
  font-size: 11px;
}

.food-card-body {
  padding: 10px;
}

.food-card-title {
  min-height: 0;
  margin: 0 0 7px;
  overflow: hidden;
  color: var(--food-text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.food-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--food-muted);
  font-size: 12px;
}

.food-card-author {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.food-card-meta time {
  flex: 0 0 auto;
}

.food-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--food-muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.food-card-stats span:nth-child(2) {
  text-align: center;
}

.food-card-stats span:last-child {
  text-align: right;
}

.food-pagination {
  margin-top: 34px;
  text-align: center;
}

.food-pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.food-pagination a,
.food-pagination span {
  padding: 7px 11px;
  border: 1px solid var(--food-border);
  border-radius: 9px;
  background: #fff;
  color: var(--food-accent-dark);
  text-decoration: none;
}

.food-pagination .current {
  border-color: var(--food-accent);
  background: var(--food-accent);
  color: #fff;
}

.food-empty {
  padding: 70px 20px;
  border: 1px dashed var(--food-border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.75);
  text-align: center;
  color: var(--food-muted);
}

.food-empty-icon {
  margin-bottom: 8px;
  font-size: 42px;
}

.food-empty h2 {
  margin: 0 0 6px;
  color: var(--food-text);
}

.food-empty p {
  margin: 0;
}

.food-single-page {
  padding: 48px 20px 76px;
}

.food-single-card {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: clamp(22px, 5vw, 44px);
  border: 1px solid var(--food-border);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(82, 51, 30, 0.09);
}

.food-back-link {
  display: inline-block;
  margin-bottom: 22px;
  color: var(--food-muted);
  font-size: 13px;
  text-decoration: none;
}

.food-back-link:hover {
  color: var(--food-accent);
}

.food-single-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}

.food-single-categories a {
  padding: 5px 10px;
  border-radius: 999px;
  background: #fff1df;
  color: var(--food-accent-dark);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.food-single-header h1 {
  margin: 0;
  color: var(--food-text);
  font-size: clamp(27px, 5vw, 42px);
  line-height: 1.2;
  overflow-wrap: break-word;
}

.food-single-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
  color: var(--food-muted);
  font-size: 13px;
}

.food-edit-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin-top: 16px;
  padding: 0 15px;
  border: 1px solid var(--food-accent);
  border-radius: 999px;
  color: var(--food-accent-dark);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.food-edit-link:hover {
  background: var(--food-accent);
  color: #fff;
}

.food-single-image {
  margin: 30px 0;
  overflow: hidden;
  border-radius: 18px;
  background: #f6eee4;
}

.food-single-image img {
  width: 100%;
  height: auto;
  display: block;
}

.food-single-content {
  color: #37312d;
  font-size: 15px;
  line-height: 1.85;
  overflow-wrap: break-word;
}

.food-single-content > :first-child {
  margin-top: 0;
}

.food-single-content img {
  max-width: 100%;
  height: auto;
  border-radius: 14px;
}

.food-single-content ul,
.food-single-content ol {
  padding-left: 26px;
}

.food-like-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--food-border);
}

.food-like-count {
  color: var(--food-text);
  font-size: 14px;
  font-weight: 800;
}

.food-like-button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid #d8c7b7;
  border-radius: 999px;
  background: #fff;
  color: var(--food-accent-dark);
  cursor: pointer;
  font-weight: 800;
}

.food-like-button.liked {
  background: #fff4df;
  border-color: var(--food-accent);
}

.food-comments {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--food-border);
}

.food-comments h2 {
  margin: 0 0 18px;
  font-size: 20px;
}

.food-comment-list {
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.food-comment-list li {
  margin: 0 0 18px;
}

.food-comment-list .children {
  margin: 18px 0 0 50px;
  padding: 0 0 0 16px;
  border-left: 2px solid #eee;
  list-style: none;
}

.food-comments .comment-body {
  display: flex;
  flex-direction: column;
  padding: 14px 18px;
  border: 1px solid #eee;
  border-radius: 14px;
  background: #f8faff;
}

.food-comments .comment-author {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.food-comments .comment-author img {
  border-radius: 50%;
}

.food-comments .comment-author strong {
  color: #111;
  font-size: 14px;
  font-weight: 700;
}

.food-comments .comment-meta {
  margin-top: 4px;
  color: #888;
  font-size: 12px;
}

.food-comments .comment-content {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.6;
}

.food-comments .comment-content p {
  margin: 0;
}

.food-comments .ab-comment-edit-textarea {
  width: 100%;
  min-height: 80px;
  box-sizing: border-box;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font: inherit;
  line-height: 1.5;
  resize: vertical;
}

.food-comments .ab-comment-edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.food-comments .ab-comment-edit-actions button {
  min-height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.food-comments .ab-comment-save {
  background: #2563eb;
  color: #fff;
}

.food-comments .ab-comment-cancel {
  background: #f3f4f6;
  color: #374151;
}

.food-comments .reply {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: #9ca3af;
  font-size: 11px;
}

.food-comments .reply a,
.food-comments #cancel-comment-reply-link {
  color: #2563eb;
  font-size: 11px;
  text-decoration: none;
}

.food-comments .reply a:hover,
.food-comments #cancel-comment-reply-link:hover {
  text-decoration: underline;
}

.food-comments textarea {
  width: 100%;
  min-height: 110px;
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid var(--food-border);
  border-radius: 12px;
  font: inherit;
  resize: vertical;
}

.food-comments .submit,
.food-comment-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: var(--food-accent);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}

.food-comments #respond {
  margin-top: 30px;
}

.food-comments #respond .comment-reply-title {
  margin: 0 0 16px;
  color: #2563eb;
  font-size: 15px;
  font-weight: 700;
}

.food-comments .comment-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.food-comments .comment-form-comment {
  margin: 0;
}

.food-comments .comment-form textarea {
  width: 100%;
  min-height: 150px;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid #d6e4ff;
  border-radius: 10px;
  background: #fafbff;
  font: inherit;
  font-size: 14px;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.food-comments .comment-form textarea:focus {
  border-color: #2563eb;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.food-comments .form-submit {
  display: flex;
  width: 100%;
  justify-content: center;
  margin: 16px 0 0;
}

.food-comments .form-submit .submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 24px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.25);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.food-comments .form-submit .submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.35);
}

@media (min-width: 1101px) and (max-width: 1400px) {
  .food-card-grid {
    grid-template-columns: repeat(4, 200px);
  }
}

@media (max-width: 1100px) {
  .food-content-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .food-right-rail {
    display: none;
  }

  .food-card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-content: initial;
  }

  .food-card {
    width: 100%;
    max-width: none;
  }

  .food-card-image {
    height: auto;
  }
}

@media (max-width: 768px) {
  .anabada-food-page {
    padding: 0 12px 54px;
  }

  .food-category-tabs {
    gap: 13px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .food-category-tabs-shell {
    width: calc(100% + 24px);
    max-width: none;
    margin-left: -12px;
    margin-right: -12px;
  }

  .food-category-tabs-shell .category-scroll-prev,
  .food-category-tabs-shell .category-scroll-next {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 30px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    background: linear-gradient(90deg, rgba(255, 250, 247, 0), #fffaf2 45%);
    color: #ff7a00;
    cursor: pointer;
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
    transform: translateY(-50%);
    touch-action: manipulation;
    transition: opacity 0.18s ease;
  }

  .food-category-tabs-shell .category-scroll-prev {
    left: 3px;
    background: linear-gradient(270deg, rgba(255, 250, 247, 0), #fffaf2 45%);
  }

  .food-category-tabs-shell .category-scroll-next {
    right: 3px;
  }

  .food-category-tabs-shell.category-scroll-start .category-scroll-prev,
  .food-category-tabs-shell.category-scroll-end .category-scroll-next,
  .food-category-tabs-shell.category-no-overflow .category-scroll-prev,
  .food-category-tabs-shell.category-no-overflow .category-scroll-next {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .food-category-tab {
    min-height: 32px;
    padding: 0 13px;
    font-size: 12px;
  }

  .food-content-shell {
    padding-top: 16px;
  }

  .food-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .food-card-grid > .post-card,
  .food-card-grid > .ab-ad-card,
  .food-card-grid > .ab-adsense-slot {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
  }

  .food-card-body {
    padding: 10px;
  }

  .food-single-page {
    padding: 24px 10px 50px;
  }

  .food-single-card {
    border-radius: 16px;
  }
}

@media (max-width: 380px) {
  .food-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
}
