/* ==========================================================================
   A-Market — мягкие улучшения поверх темы Farmart.
   Каждое правило проверено на живой странице. Подключается после style.css
   (platform/themes/farmart/config.php → amarket-css).
   ========================================================================== */

/* 1. Категории на главной: название целиком, без «Канцелярия офис…» */
.product-category-item .category__text {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  line-height: 1.3;
  min-height: 2.6em;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-category-item .category-item-body {
  border-radius: 12px;
  transition: box-shadow .2s;
}
.product-category-item .category-item-body:hover {
  box-shadow: 0 6px 18px rgba(20, 33, 61, .08);
}

/* 2. Карточки товаров: светлее рамки, без пустых звёзд «(0)» */
.product-inner { border-color: #e6e9ef !important; }
.product-inner .star-rating-wrapper { display: none !important; }
.product-inner .product__title a { color: #1f2937; }

/* 3. Кнопка WhatsApp справа, не закрывает товары; «наверх» — над ней */
.whats-app {
  left: auto !important;
  right: 20px !important;
  bottom: 96px !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
}
#back2top { bottom: 166px !important; }
@media (max-width: 991.98px) {
  .whats-app { right: 16px !important; bottom: 84px !important; }
  #back2top { bottom: 148px !important; right: 20px !important; }
}

/* 4. Меню навигации в шапке: синяя полоса с градиентом, жёлтая кнопка
      «Каталог товаров» с бликом, пункты-«таблетки» с иконками, анимации */
.header-bottom { background: #fff; padding: 10px 0; }
.header.header--sticky .header-bottom { padding: 8px 0 !important; box-shadow: 0 6px 18px rgba(20, 33, 61, .10); }
.i_menu_catalog_cont {
  background: linear-gradient(100deg, #23397A 0%, #314C9C 45%, #3E5FBF 100%) !important;
  border-radius: 16px;
  box-shadow: 0 10px 24px -10px rgba(35, 57, 122, .55);
  position: relative;
  overflow: visible;
}
.i_menu_catalog_cont::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  pointer-events: none;
  background: radial-gradient(600px 120px at 85% -40%, rgba(255, 255, 255, .18), transparent 60%);
}
.i_menu_catalog_cont > div, .i_top_categories { background: transparent !important; }

/* кнопка «Каталог товаров» */
.i_vp_title {
  top: -50px !important;
  left: 8px;
  margin-top: 8px;
  height: 44px !important;
  width: 238px !important;
  border-radius: 12px;
  background: #FFD84D !important;
  box-shadow: 0 6px 14px -4px rgba(255, 190, 0, .6);
  padding: 0 18px !important;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.i_vp_title:hover { transform: translateY(-1px); box-shadow: 0 10px 18px -6px rgba(255, 190, 0, .75); background: #FFD84D !important; }
.i_vp_title::after {
  content: "";
  position: absolute;
  top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .6), transparent);
  transform: skewX(-20deg);
  animation: amShine 4.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes amShine { 0%, 70% { left: -60%; } 100% { left: 130%; } }
.i_vp_title .i_vpt_x { filter: brightness(0) saturate(100%) opacity(.85); }
.i_vp_title .menu__toggle-title { color: #14213D !important; text-transform: none !important; font-size: 15px !important; font-weight: 700 !important; letter-spacing: 0; margin-left: 12px !important; }
.i_vp_menu .i_vp_li > a.i_vp_link:hover { background: #EEF2FB !important; color: #314C9C !important; }

/* пункты меню */
.i_top_categories { padding-left: 262px !important; align-items: center; gap: 6px; height: 60px; }
.i_top_categories > .i_top_category { flex-grow: 0 !important; border: 0 !important; position: relative; }
.i_top_categories > .i_top_category > a {
  color: #fff !important;
  background: transparent !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  padding: 0 16px !important;
  height: 42px !important;
  border-radius: 999px;
  white-space: nowrap;
  gap: 8px;
  transition: background-color .25s, color .25s, transform .25s;
}
.i_top_categories > .i_top_category > a:hover { background: #fff !important; color: #314C9C !important; transform: translateY(-1px); }
.i_top_categories > .i_top_category > a .sub-toggle svg { color: currentColor !important; width: 11px; height: 11px; transition: transform .25s; }
.i_top_categories > .i_top_category:hover > a .sub-toggle svg { transform: rotate(180deg); }

/* «Скачать прайс» справа, стрелка «скачивания» пружинит при наведении */
.i_top_categories > .i_top_category:last-child { margin-left: auto; margin-right: 10px; }
.i_top_categories > .i_top_category:last-child > a { border: 1.5px solid rgba(255, 255, 255, .55); font-weight: 600 !important; }
.i_top_categories > .i_top_category:last-child > a:hover::before { animation: amBounce .6s ease-in-out infinite; transform: none; }
@keyframes amBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }

/* подменю «Компания» */
.i_top_categories .sub-menu {
  top: 56px !important;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(20, 33, 61, .18);
  padding: 8px !important;
  border: 0;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.i_top_categories .i_top_category:hover > .sub-menu { transform: translateY(0); }
.i_top_categories .sub-menu .i_top_category { border: 0 !important; }
.i_top_categories .sub-menu a { color: #14213D !important; background: transparent !important; justify-content: flex-start !important; height: auto !important; border-radius: 9px; padding: 10px 12px !important; font-size: 14px; text-transform: none !important; transition: background-color .2s, padding .2s; }
.i_top_categories .sub-menu a:hover { background: #EEF2FB !important; color: #314C9C !important; padding-left: 16px !important; }

/* иконки пунктов (по адресу ссылки — меню можно править в админке) */
.i_top_categories > .i_top_category > a::before {
  content: "";
  width: 18px; height: 18px; flex: none;
  background-color: currentColor;
  -webkit-mask: var(--am-ic) center / contain no-repeat;
  mask: var(--am-ic) center / contain no-repeat;
  transition: transform .25s;
}
.i_top_categories > .i_top_category > a:hover::before { transform: scale(1.15) rotate(-6deg); }
.i_top_categories > .i_top_category > a:not([href*='/products']):not([href*='contact']):not([href*='blog']):not([href$='.xlsx'])::before { display: none; }
.i_top_categories > .i_top_category.menu-item-has-children > a::before { display: block !important; }
.i_top_categories > .i_top_category > a[href*='/products'] { --am-ic: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.9%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M4%204h6.5v6.5H4zM13.5%204H20v6.5h-6.5zM4%2013.5h6.5V20H4zM13.5%2013.5H20V20h-6.5z%27%2F%3E%3C%2Fsvg%3E"); }
.i_top_categories > .i_top_category > a[href*='contact'] { --am-ic: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.9%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M12%2021s-6.5-5.6-6.5-11a6.5%206.5%200%200%201%2013%200c0%205.4-6.5%2011-6.5%2011z%27%2F%3E%3Ccircle%20cx%3D%2712%27%20cy%3D%2710%27%20r%3D%272.3%27%2F%3E%3C%2Fsvg%3E"); }
.i_top_categories > .i_top_category > a[href*='blog'] { --am-ic: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.9%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M5%204h11l3%203v13H5z%27%2F%3E%3Cpath%20d%3D%27M8.5%2010h7M8.5%2013.5h7M8.5%2017h4%27%2F%3E%3C%2Fsvg%3E"); }
.i_top_categories > .i_top_category.menu-item-has-children > a { --am-ic: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.9%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M4%2020V8l8-4%208%204v12%27%2F%3E%3Cpath%20d%3D%27M9%2020v-6h6v6%27%2F%3E%3C%2Fsvg%3E"); }
.i_top_categories > .i_top_category > a[href$='.xlsx'] { --am-ic: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.9%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M12%204v11M7.5%2010.5L12%2015l4.5-4.5%27%2F%3E%3Cpath%20d%3D%27M5%2019h14%27%2F%3E%3C%2Fsvg%3E"); }
.i_top_categories > .i_top_category > a[href$='.xlsx'] i { display: none; }

@media (prefers-reduced-motion: reduce) {
  .i_vp_title::after, .i_top_categories > .i_top_category:last-child > a:hover::before { animation: none; }
}

/* 5. Заглушка вместо фото товара (partials/ecommerce/product-item.blade.php) */
.img-fluid-eq__wrap { position: relative; }
.am-noimg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F4F6FA;
  color: #A3AEC4;
  border-radius: 10px;
}
.am-noimg svg { width: 38%; height: 38%; }
.am-noimg--lg { border-radius: 16px; }
.am-noimg--lg svg { width: 26%; height: 26%; }
/* Заглушка в миниатюре шапки товара (views/ecommerce/product.blade.php) */
.am-noimg--sticky {
  position: static;
  width: 60px;
  height: 60px;
  border-radius: 10px;
}

/* 6. «Купить сейчас»: вместо чёрной — фирменная синяя рамка */
.btn.btn-primary.btn-black {
  background-color: #fff !important;
  color: var(--primary-color) !important;
  border: 1.5px solid var(--primary-color) !important;
}
.btn.btn-primary.btn-black:hover {
  background-color: var(--primary-color) !important;
  color: #fff !important;
}
