/* F2P layout: sidebar catalog, compact header, mobile category scroll */

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  overflow-x: clip;
  max-width: 100%;
}

.container {
  max-width: 1140px;
}

.f2p-layout-row.row {
  margin-left: 0;
  margin-right: 0;
}

.f2p-page-with-sidebar .container {
  max-width: 1140px;
  padding-left: 12px;
  padding-right: 12px;
}

@media (min-width: 992px) {
  #menu.navbar {
    display: none !important;
  }
}

.f2p-layout-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
}

.f2p-sidebar-col {
  order: 0;
  padding-right: 12px;
  padding-left: 0;
}

.f2p-content {
  order: 1;
  padding-left: 8px;
  padding-right: 0;
}

/* @reason: sidebar ломал вёрстку на information/checkout и др. без f2p-page-with-sidebar */
@media (min-width: 992px) {
  .row:has(.f2p-sidebar-col),
  .f2p-page-with-sidebar .f2p-layout-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    margin-left: 0;
    margin-right: 0;
  }

  .row:has(.f2p-sidebar-col) .f2p-sidebar-col,
  .f2p-page-with-sidebar .f2p-sidebar-col {
    position: sticky;
    top: 96px;
    align-self: flex-start;
    z-index: 2;
    flex: 0 0 240px;
    max-width: 240px;
    width: 240px !important;
    float: none !important;
    padding-right: 12px;
    padding-left: 0;
  }

  .row:has(.f2p-sidebar-col) > #content,
  .f2p-page-with-sidebar .f2p-content,
  .f2p-page-with-sidebar #content.f2p-content {
    flex: 1 1 auto;
    max-width: none;
    width: auto !important;
    float: none !important;
    min-width: 0;
    position: relative;
    z-index: 1;
    padding-left: 8px;
    padding-right: 0;
  }

  .f2p-cat-sidebar {
    background: var(--f2p-surface, #fff);
  }

  #product-category #content,
  #product-search #content,
  #product-special #content {
    overflow: hidden;
  }
}

/* Vertical category sidebar */
.f2p-cat-sidebar {
  background: var(--f2p-surface, #fff);
  border: 1px solid var(--f2p-border, #e7e4dc);
  border-radius: var(--f2p-radius, 16px);
  box-shadow: var(--f2p-shadow, 0 4px 24px rgba(28, 25, 23, 0.06));
  padding: 8px 0 8px;
  margin-bottom: 24px;
}

.f2p-cat-sidebar__head {
  padding: 4px 16px 12px;
  border-bottom: 1px solid var(--f2p-border, #e7e4dc);
  margin-bottom: 6px;
}

.f2p-cat-sidebar__title {
  font-family: var(--f2p-font-display, Georgia, serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--f2p-text, #1c1917);
}

.f2p-cat-sidebar__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.f2p-cat-sidebar__item {
  margin: 0;
}

.f2p-cat-sidebar__name {
  flex: 1;
  line-height: 1.25;
  white-space: normal;
  word-break: break-word;
  min-width: 0;
}

.f2p-cat-sidebar__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  color: var(--f2p-text, #1c1917) !important;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none !important;
  border-radius: 12px;
  margin: 2px 4px;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.f2p-cat-sidebar__link:hover {
  background: rgba(45, 90, 61, 0.06);
  color: var(--f2p-green-dark, #1e3d29) !important;
}

.f2p-cat-sidebar__item.is-active .f2p-cat-sidebar__link {
  background: var(--f2p-green-pale, #e8f0ea);
  color: var(--f2p-green-dark, #1e3d29) !important;
}

.f2p-cat-sidebar__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #f3f4f6;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.85),
    inset 0 -2px 0 rgba(0, 0, 0, 0.04),
    0 3px 10px rgba(28, 25, 23, 0.08);
  transform: translateZ(0);
}

.f2p-cat-sidebar__glyph {
  font-size: 1.15rem;
  line-height: 1;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.5));
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

.f2p-cat-sidebar__icon--pink { background: linear-gradient(145deg, #ffe8ee, #ffd6e0); }
.f2p-cat-sidebar__icon--yellow { background: linear-gradient(145deg, #fff6dc, #ffe9a8); }
.f2p-cat-sidebar__icon--green { background: linear-gradient(145deg, #e6f6ea, #ccefd6); }
.f2p-cat-sidebar__icon--blue { background: linear-gradient(145deg, #e3f0ff, #c9e2ff); }
.f2p-cat-sidebar__icon--neutral { background: linear-gradient(145deg, #f5f5f4, #e7e5e4); }

.f2p-cat-sidebar__empty {
  margin: 0;
  padding: 12px 16px 16px;
  font-size: 13px;
  color: #78716c;
  line-height: 1.45;
}

.f2p-home-wrap {
  padding-top: 8px;
}

.f2p-home-wrap .f2p-hero {
  margin-bottom: 20px;
}

.f2p-home-wrap .f2p-bento,
.f2p-home-wrap .f2p-trust {
  margin-bottom: 20px;
}

.f2p-cat-sidebar__all {
  display: block;
  padding: 10px 16px 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--f2p-green, #2d5a3d) !important;
}

/* Hero bird + eggs */
.f2p-hero--farm .f2p-hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
  z-index: 1;
}

@media (min-width: 768px) {
  .f2p-hero--farm .f2p-hero__grid {
    grid-template-columns: 1.05fr 0.95fr;
    min-height: 320px;
  }
}

.f2p-hero__visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.f2p-hero__scene {
  position: relative;
  width: min(100%, 280px);
  height: 220px;
}

.f2p-hero__bird {
  width: 200px;
  height: auto;
  margin: 0 auto;
  display: block;
  filter: drop-shadow(0 8px 20px rgba(45, 90, 61, 0.15));
  animation: f2p-bird-float 4s ease-in-out infinite;
}

@keyframes f2p-bird-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.f2p-hero__eggs {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 120px;
  height: 70px;
}

.f2p-hero__nest {
  position: absolute;
  bottom: 0;
  left: 10px;
  right: 0;
  height: 28px;
  background: linear-gradient(180deg, #c4a574 0%, #a08050 100%);
  border-radius: 50% 50% 40% 40% / 60% 60% 40% 40%;
  opacity: 0.9;
}

.f2p-hero__egg {
  position: absolute;
  width: 28px;
  height: 36px;
  background: linear-gradient(145deg, #fffef8 0%, #f5e6c8 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  box-shadow: inset -2px -3px 6px rgba(0,0,0,0.06);
  bottom: 18px;
  left: 24px;
}

.f2p-hero__egg--2 {
  left: 48px;
  bottom: 22px;
  transform: rotate(8deg);
  width: 24px;
  height: 32px;
}

.f2p-hero__egg--3 {
  left: 68px;
  bottom: 16px;
  transform: rotate(-5deg);
  width: 26px;
  height: 34px;
}

@media (max-width: 991px) {
  .f2p-sidebar-col {
    order: -1;
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
    padding: 0 15px 8px;
    position: static;
    max-height: none;
  }

  .f2p-home-wrap .f2p-sidebar-col {
    padding-bottom: 4px;
  }

  .f2p-home-wrap .f2p-cat-sidebar {
    border: none;
    box-shadow: none;
    background: transparent;
    margin-bottom: 0;
    padding: 0;
  }

  .f2p-home-wrap .f2p-cat-sidebar__head {
    display: none;
  }

  /* @reason: на мобиле убираем hero-баннер (в т.ч. фоновое фото из кэша CSS) */
  .f2p-home-wrap .f2p-hero--banner,
  .f2p-hero--banner {
    display: none !important;
    background: none !important;
    background-image: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .f2p-cat-sidebar__list {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    gap: 4px;
    padding: 0 4px 8px;
    -webkit-overflow-scrolling: touch;
  }

  .f2p-cat-sidebar__item {
    flex: 0 0 auto;
  }

  .f2p-cat-sidebar__link {
    flex-direction: column;
    gap: 4px;
    min-width: 72px;
    text-align: center;
    font-size: 11px;
    padding: 8px 10px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--f2p-border, #e7e4dc);
  }

  .f2p-cat-sidebar__item.is-active .f2p-cat-sidebar__link {
    border-color: var(--f2p-green, #2d5a3d);
    background: rgba(45, 90, 61, 0.08);
  }

  .f2p-cat-sidebar__all {
    display: none;
  }
}

/* ── Compact header + search pill ── */
header.f2p-site-header {
  padding: 10px 0;
}

.f2p-header-bar {
  display: grid;
  grid-template-columns: auto minmax(200px, 1fr) auto min-content;
  gap: 12px 16px;
  align-items: center;
  max-width: 100%;
}

.f2p-header-bar__logo #logo img {
  max-height: 52px !important;
  max-width: min(148px, 34vw);
  width: auto;
  margin: 0;
}

.f2p-header-bar__logo #logo h1 {
  margin: 0;
  font-size: 1.15rem;
}

.f2p-header-bar__search {
  min-width: 0;
}

.f2p-search {
  margin: 0;
  width: 100%;
  max-width: 400px;
}

#search.f2p-search,
#search.f2p-search.input-group {
  overflow: visible !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.f2p-search__shell {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 4px 4px 4px 12px;
  border-radius: 999px;
  overflow: visible;
  border: 1.5px solid var(--f2p-border, #e7e4dc);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(240, 237, 230, 0.92) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 4px 18px rgba(45, 90, 61, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.f2p-search__shell:focus-within {
  border-color: var(--f2p-green-light, #4a7c59);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 0 0 3px rgba(45, 90, 61, 0.12),
    0 6px 20px rgba(45, 90, 61, 0.1);
}

.f2p-search__icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #e8f0ea, #dce8df);
  color: var(--f2p-green, #2d5a3d);
  font-size: 13px;
}

.f2p-search__input,
#search.f2p-search .form-control.f2p-search__input {
  flex: 1;
  min-width: 0;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  height: 40px;
  padding: 0 10px;
  font-size: 16px !important;
  font-weight: 500;
  color: var(--f2p-text, #1c1917);
}

.f2p-search__input:focus {
  outline: none;
}

.f2p-search__input::placeholder {
  color: #a8a29e;
}

.f2p-search__btn-wrap {
  display: flex;
  flex-shrink: 0;
}

.f2p-search__btn,
#search.f2p-search .f2p-search__btn,
#search.f2p-search .btn.f2p-search__btn {
  border: none !important;
  border-radius: 999px !important;
  height: 40px !important;
  min-width: 76px !important;
  padding: 0 16px !important;
  background: linear-gradient(145deg, #3a6b4a, #2d5a3d) !important;
  color: #fff !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(45, 90, 61, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.f2p-search__btn:hover {
  background: linear-gradient(145deg, #2d5a3d, #1e3d29) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(45, 90, 61, 0.28);
}

.f2p-header-bar__phone .f2p-header-phone__link {
  padding: 6px 12px;
  border-radius: 12px;
}

.f2p-header-bar__phone .f2p-header-phone__number {
  font-size: 14px;
}

.f2p-header-bar__cart {
  min-width: 0;
  position: relative;
}

.f2p-header-bar__cart #cart {
  position: relative;
}

.f2p-header-bar__cart #cart > .btn {
  border-radius: 999px !important;
  padding: 8px 14px !important;
  font-size: 13px !important;
  white-space: nowrap;
  position: relative;
}

.f2p-header-cart-badge {
  display: none;
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--f2p-terra, #c4673a);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  pointer-events: none;
}

.f2p-header-cart-badge.is-visible {
  display: block;
}

.f2p-cart-float {
  display: none !important;
}

@media (max-width: 991px) {
  .f2p-header-bar {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "logo cart"
      "search search";
    gap: 10px 12px;
  }

  .f2p-header-bar__logo { grid-area: logo; }
  .f2p-header-bar__search {
    grid-area: search;
    width: 100%;
    min-width: 0;
    max-width: none;
  }
  .f2p-header-bar__phone { display: none; }
  .f2p-header-bar__cart { grid-area: cart; justify-self: end; }

  .f2p-search {
    margin: 0;
    width: 100%;
    max-width: none;
  }

  .f2p-search__shell {
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
  }

  .f2p-search__btn-wrap {
    flex: 0 0 auto;
    transition: width 0.22s ease, min-width 0.22s ease, opacity 0.18s ease, margin 0.22s ease;
  }

  .f2p-search__btn-text {
    display: inline;
  }

  .f2p-search__btn {
    min-width: 76px !important;
    padding: 0 16px !important;
  }

  .f2p-search__btn .fa-search {
    display: none;
  }

  .f2p-search__shell.is-focused .f2p-search__btn-wrap {
    width: 0 !important;
    min-width: 0 !important;
    margin: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
  }

  .f2p-search__shell.is-focused {
    padding-right: 12px;
  }

  /* @reason: iOS Safari зумит input при font-size < 16px */
  #product-search input.form-control {
    font-size: 16px !important;
  }
}

@media (min-width: 992px) {
  .f2p-search__btn .fa-search {
    display: none;
  }
}
