/* =========================================================
   Clean Nordic Pharmacy UI (Finland) — unified
   Drop-in override stylesheet. Connect AFTER old CSS.
   ========================================================= */

/* ---------- Fonts (оставляю твои) ---------- */
@font-face {
  font-family: "ProximaNova";
  src: url("fonts/ProximaNova-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "OProximaNova";
  src: url("fonts/ProximaNova-Bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Montserrat";
  src: url("fonts/Montserrat-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
  --bg: #f7f9fb;
  --surface: #ffffff;
  --text: #1f2d3d;
  --muted: rgba(31, 45, 61, 0.72);

  --primary: #1f4e79;
  --primary-2: #2a7abf;

  --border-light: #e6edf3;
  --border-base: #d8e1ea;
  --border-strong: #c5d2df;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;

  --shadow-1: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-2: 0 6px 18px rgba(16, 24, 40, 0.08);

  --focus: 0 0 0 3px rgba(42, 122, 191, 0.25);
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }

body {
  background: var(--bg) !important;
  color: var(--text) !important;
  font-family: "ProximaNova", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif !important;
  font-size: 16.5px !important;
  line-height: 1.7 !important;
}

* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  box-sizing: border-box;
}

/* ---------- Typography ---------- */
h1 {
  font-size: clamp(1.7rem, 2.4vw, 2.25rem);
  line-height: 1.2;
  margin: 0 0 0.75rem;
  font-weight: 700;
  color: var(--text);
}
h2 {
  font-size: clamp(1.25rem, 1.8vw, 1.55rem);
  line-height: 1.25;
  margin: 2rem 0 0.75rem;
  font-weight: 700;
  color: var(--text);
}
h3 {
  font-size: 1.05rem;
  line-height: 1.35;
  margin: 1.2rem 0 0.4rem;
  font-weight: 700;
  color: var(--text);
}

/* Hero title — убираем градиенты */
h1.head_h {
  background: none !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: initial !important;
  color: var(--text) !important;

  font-weight: 700 !important;
  max-width: 56ch !important;
  margin: 56px 0 18px 0 !important;
  line-height: 1.15 !important;
  font-size: clamp(1.8rem, 3.2vw, 2.6rem) !important;
  position: relative;
}
p.head_txt {
  color: var(--muted) !important;
  font-size: 1rem !important;
  max-width: 70ch !important;
}

/* ---------- Links & focus ---------- */
a:link,
a:visited {
  color: var(--primary-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}
a:hover {
  color: var(--primary);
  text-decoration: underline;
}
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none !important;
  box-shadow: var(--focus) !important;
  border-radius: 8px;
}

/* ---------- Surfaces ---------- */
.contentbg,
.main_content,
.sidebar,
.category-products,
.medical-disclaimer,
.medical-note,
.breadcrumbs,
.bcrumbs,
.footer {
  background: var(--surface) !important;
  border: 1px solid var(--border-light) !important;
  border-radius: var(--r-lg) !important;
}

.contentbg { padding: 18px !important; }
.main_content { border-color: var(--border-light) !important; }

/* ---------- Header ---------- */
.top_header { background: none !important; }

.top_line {
  color: var(--muted) !important;
  min-height: 56px !important;
  line-height: 56px !important;
}
.top_line svg { fill: rgba(31, 45, 61, 0.65) !important; }

/* ---------- Navigation (compact) ---------- */
.c_menu,
.navbar {
  min-height: 48px !important;
}

ul.main_menu { margin: 0 !important; }

ul.main_menu li { line-height: 1 !important; }

ul.main_menu li a {
  color: var(--primary-2) !important;
  text-decoration: none !important;
  font-weight: 600;
  border-radius: 8px;
  padding: 5px 8px !important;
  font-size: 14px !important;
  transition: background 0.15s ease, color 0.15s ease;
}
ul.main_menu li a:hover {
  color: var(--primary) !important;
  background: rgba(31, 78, 121, 0.06) !important;
}

/* linkprod — НЕ кнопка (чтобы не красило dropdown) */
ul.main_menu li.linkprod,
ul.main_menu li.linkprod.open,
ul.main_menu li.linkprod:hover {
  background: transparent !important;
  outline: none !important;
}
ul.main_menu li.linkprod a {
  background: transparent !important;
  color: var(--primary-2) !important;
  border: none !important;
}
ul.main_menu li.linkprod a:hover {
  background: rgba(31, 78, 121, 0.06) !important;
  color: var(--primary) !important;
}

/* ---------- Dropdown menu (single final version, compact, 2 cols desktop) ---------- */
ul.dropdown-menu {
  background: #ffffff !important;
  border: 1px solid var(--border-light) !important;
  border-radius: 12px !important;
  box-shadow: 0 14px 40px rgba(16, 24, 40, 0.08) !important;

  padding: 6px 8px !important;
  min-width: 480px !important;
}

.dropdown-menu.show,
ul.dropdown-menu.show {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
}

ul.dropdown-menu li {
  width: calc(50% - 3px) !important;
  margin: 0 !important;
  border: none !important;
  background: transparent !important;
}

ul.dropdown-menu li a {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;

  padding: 6px 8px !important;
  line-height: 1.2 !important;
  font-size: 13.5px !important;

  border-radius: 8px !important;
  background: #f7f9fb !important;
  border: 1px solid #e6edf3 !important;

  color: #1f2d3d !important;
  font-weight: 600 !important;
  text-decoration: none !important;

  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
ul.dropdown-menu li a:hover {
  background: #eef4f9 !important;
  border-color: #d8e1ea !important;
  color: #1f4e79 !important;
}

ul.dropdown-menu li a img {
  width: 18px !important;
  height: 18px !important;
  object-fit: contain;
  border-radius: 6px !important;
  background: #ffffff !important;
  border: 1px solid #e6edf3 !important;
}

@media (max-width: 992px) {
  ul.dropdown-menu {
    min-width: 100% !important;
  }
  .dropdown-menu.show,
  ul.dropdown-menu.show {
    display: block !important;
  }
  ul.dropdown-menu li {
    width: 100% !important;
  }
}

/* ---------- Search ---------- */
.searchform input[type="text"] {
  border: 1px solid var(--border-base) !important;
  border-radius: var(--r-md) !important;
  height: 42px !important;
  font-size: 14px !important;
  padding: 0 12px !important;
  background: #fff !important;
}
.searchform button { top: 9px !important; right: 10px !important; }
.searchform svg { fill: rgba(31, 45, 61, 0.65) !important; }
.searchform svg:hover { fill: var(--primary-2) !important; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs,
.bcrumbs {
  font-size: 12px !important;
  color: rgba(31, 45, 61, 0.7) !important;
  border-radius: var(--r-md) !important;
}
.bcrumbs a { color: var(--primary-2) !important; }

/* ---------- Generic cards (product blocks etc.) ---------- */
.item_block,
.product_item,
.main_products .itemblock,
.category-list li,
ul.home-medicines-list li a {
  background: var(--surface) !important;
  border: 1px solid var(--border-base) !important;
  border-radius: var(--r-lg) !important;
  box-shadow: var(--shadow-1) !important;
  transition: box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.item_block:hover,
.product_item:hover,
.main_products .itemblock:hover,
.category-list li:hover,
ul.home-medicines-list li a:hover {
  border-color: var(--border-strong) !important;
  box-shadow: var(--shadow-2) !important;
  background: #fff !important;
}

/* Images (generic, НЕ трогаем category-products здесь) */
.item_block img,
.product_item img,
.main_products .itemblock img,
ul.home-medicines-list img {
  border: 1px solid var(--border-light) !important;
  border-radius: 12px !important;
  background: #fff !important;
}

/* ---------- Content lists (общие точки в контенте оставляем) ---------- */
.content-area ul li:before { color: var(--primary-2) !important; }

/* =========================================================
   CATEGORY PRODUCTS — single final version (fix left pull + right padding)
   ========================================================= */

.category-products {
  /* общий внутренний отступ блока, чтобы “не липло” к краям */
  padding: 16px 18px !important;
}

/* Сбрасываем любые чужие отступы ul, которые тянут влево */
.category-products ul {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;

  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
  gap: 14px !important;

  /* важно: даём общий правый “воздух”, даже если контейнер шириной впритык */
  padding-right: 12px !important;
}

/* Убираем декоративные точки/псевдоэлементы внутри карточек */
.category-products li,
.category-products li::before {
  list-style: none !important;
}
.category-products li::before {
  content: none !important;
  display: none !important;
}

/* Карточка: делаем рамку на <a>, чтобы не было “двойных” рамок */
.category-products li {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Сама карточка — это ссылка */
.category-products li a {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;

  width: 100% !important;
  padding: 12px 16px !important;          /* <-- тут и есть нормальный правый отступ */
  border-radius: 14px !important;

  background: #ffffff !important;
  border: 1px solid var(--border-light) !important;
  box-shadow: var(--shadow-1) !important;

  text-decoration: none !important;
}

/* Hover */
.category-products li a:hover {
  border-color: var(--border-base) !important;
  box-shadow: var(--shadow-2) !important;
}

/* Картинка */
.category-products li img {
  width: 56px !important;
  height: 56px !important;
  object-fit: contain;

  border-radius: 10px !important;
  border: 1px solid var(--border-light) !important;
  background: #fff !important;

  flex-shrink: 0;
  margin: 0 !important;
}

/* Текст */
.category-products li a > span {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;

  font-size: 14px !important;
  font-weight: 600 !important;
  color: var(--text) !important;
}

/* Цена (внутренний span) */
.category-products li a > span span {
  font-weight: 700 !important;
  font-size: 13px !important;
  color: var(--primary) !important;
}

/* ---------- Sidebar ---------- */
.sidebar { padding: 12px 14px !important; }

.sidebar li a {
  color: var(--text) !important;
  text-transform: none !important;
  font-size: 14px !important;
  text-decoration: none !important;
  font-weight: 600;
}
.sidebar li a:hover {
  margin-left: 0 !important;
  text-decoration: underline !important;
}
.sidebar li a:before { content: "" !important; }

/* ---------- Footer ---------- */
.footer {
  margin-top: 18px !important;
  padding: 18px 0 !important;
}
.footer li a { color: var(--text) !important; }
.footer li a:hover { color: var(--primary) !important; }
.footer .paysis img {
  border: 1px solid var(--border-light) !important;
  border-radius: var(--r-md) !important;
  opacity: 0.95 !important;
}
.footer span.copy { color: rgba(31, 45, 61, 0.72) !important; }

/* ---------- Medical blocks ---------- */
.medical-disclaimer,
.medical-note {
  border: 1px solid var(--border-light) !important;
  background: rgba(31, 78, 121, 0.04) !important;
}
.medical-disclaimer p,
.medical-note { color: rgba(31, 45, 61, 0.85) !important; }

/* ---------- Mobile adjustments ---------- */
@media (max-width: 992px) {
  .top_header { background: none !important; }
  h1.head_h {
    margin: 12px 0 10px 0 !important;
    max-width: 100% !important;
  }
  ul.main_menu {
    border: 1px solid var(--border-light) !important;
    border-radius: var(--r-lg) !important;
    box-shadow: var(--shadow-1) !important;
  }
  .category-products { padding: 14px !important; }
}
@media (max-width: 600px) {
  body { font-size: 16px !important; }
  .contentbg { padding: 14px !important; }
  .category-products ul { grid-template-columns: 1fr !important; }
}