/* Каталог сантехники «Атмосфера» — фирменный стиль */
:root {
  --accent: #1ABC9C;
  --amber: #FFB518;
  --head: #444444;
  --text: #555555;
  --muted: #999999;
  --bg: #ffffff;
  --bg-light: #F8F9FA;
  --dark: #282828;
  --radius: 20px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: Roboto, Arial, sans-serif; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3, h4 { color: var(--head); font-family: 'Playfair Display', serif; }
h1 { font-size: 32px; margin: 26px 0 8px; }
h2 { font-size: 26px; margin: 34px 0 14px; }
.muted { color: var(--muted); font-size: 14px; }

/* Шапка */
.top { border-bottom: 1px solid #eee; background: #fff; position: sticky; top: 0; z-index: 50; }
.top-in { display: flex; align-items: center; gap: 26px; padding: 14px 20px; }
.logo { display: flex; flex-direction: column; line-height: 1.15; }
.logo-word { font-weight: 700; font-size: 30px; color: var(--amber); letter-spacing: 1px; font-family: 'Playfair Display', serif; white-space: nowrap; }
.logo-sub { font-size: 11px; text-transform: uppercase; letter-spacing: 3px; color: var(--muted); white-space: nowrap; }
.search { flex: 1; display: flex; max-width: 520px; min-width: 160px; }
.search input { flex: 1; min-width: 60px; border: 2px solid #e5e5e5; border-right: 0; border-radius: 26px 0 0 26px; padding: 11px 20px; font-size: 15px; outline: none; font-family: inherit; }
.search input:focus { border-color: var(--accent); }
.search button { border: 0; background: var(--accent); color: #fff; border-radius: 0 26px 26px 0; padding: 0 26px; font-size: 15px; cursor: pointer; font-family: inherit; }
.search button:hover { background: #16a085; }
.phone { font-size: 19px; font-weight: 700; color: var(--head); white-space: nowrap; }
.phone:hover { color: var(--accent); }

/* Меню: одна строка + выпадающий каталог */
.menu { background: var(--bg-light); border-top: 1px solid #eee; }
.menu-in { display: flex; align-items: center; gap: 6px; padding: 7px 20px; flex-wrap: nowrap; overflow: visible; }
.menu-in > a, .drop-btn { display: flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 18px; color: var(--head); font-size: 14.5px; font-weight: 500; background: none; border: 0; cursor: pointer; font-family: inherit; white-space: nowrap; line-height: 1.3; }
.menu-in > a:hover, .drop-btn:hover { background: #fff; color: var(--accent); }
.menu-in > a.act { background: var(--accent); color: #fff; }
.menu-phone { margin-left: auto; font-weight: 600; }
.menu-phone:hover { background: #fff; }

.drop { position: relative; }
.drop.open .drop-btn, .drop:hover .drop-btn { background: #fff; color: var(--accent); border-radius: 18px 18px 0 0; }
.drop-btn svg { transition: transform .2s; }
.drop:hover .drop-btn svg, .drop.open .drop-btn svg { transform: rotate(180deg); }
.drop-panel { display: none; position: absolute; top: 100%; left: 0; padding-top: 8px; z-index: 60; }
.drop-panel::before { content: ''; display: block; position: absolute; top: 0; left: 0; right: 0; height: 8px; }
.drop-panel-in { background: #fff; border: 1px solid #eee; border-top: 2px solid var(--accent); border-radius: 0 var(--radius) var(--radius) var(--radius); box-shadow: 0 18px 50px rgba(0,0,0,.14); padding: 14px; width: 560px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 18px; }
.drop:hover .drop-panel, .drop:focus-within .drop-panel, .drop.open .drop-panel { display: block; }
.drop-panel a { padding: 9px 14px; border-radius: 14px; color: var(--head); font-size: 14.5px; display: flex; align-items: center; }
.drop-panel a:hover { background: var(--bg-light); color: var(--accent); }
.drop-panel a.act { background: var(--accent); color: #fff; }

/* Бургер (только мобильный) */
.burger { display: none; flex-direction: column; gap: 5px; background: none; border: 0; padding: 6px; cursor: pointer; }
.burger span { display: block; width: 24px; height: 2.5px; background: var(--head); border-radius: 2px; }

/* Хлебные крошки */
.crumbs { margin: 16px 0 4px; font-size: 13.5px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs-sep { margin: 0 6px; color: #ccc; }
.crumbs-cur { color: var(--head); }

/* SEO-текст */
.seo-text { margin: 36px 0 50px; padding: 24px 28px; background: var(--bg-light); border-radius: var(--radius); }
.seo-text h2 { font-size: 22px; margin-top: 0; margin-bottom: 12px; }
.seo-text p { font-size: 15px; line-height: 1.6; color: var(--text); margin-bottom: 8px; }
.seo-text p:last-child { margin-bottom: 0; }

/* Раскладка каталога */
.catalog-layout { display: grid; grid-template-columns: 260px 1fr; gap: 30px; margin: 18px 0 50px; }
.filters { background: var(--bg-light); border-radius: var(--radius); padding: 20px; align-self: start; position: sticky; top: 130px; }
.filters h3 { font-size: 17px; margin-bottom: 10px; font-family: Roboto, sans-serif; }
.fgroup { margin-bottom: 16px; }
.fgroup .flabel { font-weight: 500; color: var(--head); margin-bottom: 6px; font-size: 14.5px; }
.fgroup label { display: block; font-size: 14px; padding: 3px 0; cursor: pointer; color: var(--text); }
.fgroup label:hover { color: var(--accent); }
.fgroup input[type="checkbox"] { accent-color: var(--accent); margin-right: 7px; }
.freset { display: inline-block; margin-top: 6px; font-size: 14px; }

/* Сетка товаров */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 6px 0 16px; flex-wrap: wrap; }
.toolbar .cnt { color: var(--muted); font-size: 14.5px; }
.toolbar select { border: 2px solid #e5e5e5; border-radius: 20px; padding: 8px 14px; font-family: inherit; font-size: 14px; color: var(--head); outline: none; background: #fff; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }

/* Карточка товара */
.card { display: flex; flex-direction: column; background: #fff; border: 1px solid #eee; border-radius: var(--radius); overflow: hidden; transition: box-shadow .25s, transform .25s, border-color .25s; color: var(--text); position: relative; }
.card:hover { box-shadow: 0 10px 30px rgba(0,0,0,.09); transform: translateY(-3px); border-color: #e0e0e0; }
.card-img { position: relative; aspect-ratio: 1/1; background: var(--bg-light); display: flex; align-items: center; justify-content: center; }
.card-img img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.noimg { color: #ccc; font-size: 14px; }
.badge { position: absolute; top: 12px; left: 12px; border-radius: 12px; padding: 3px 12px; font-size: 12px; font-weight: 600; color: #fff; }
.badge-red { background: #e74c3c; }
.badge-amber { background: var(--amber); color: #5d4200; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-brand { font-size: 11.5px; letter-spacing: 1.5px; color: var(--muted); text-transform: uppercase; font-weight: 600; }
.card-name { font-size: 15px; color: var(--head); font-weight: 500; line-height: 1.35; min-height: 40px; }
.card-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 7px; }
.price { font-size: 19px; font-weight: 700; color: var(--head); }
.stock { font-size: 13px; font-weight: 500; color: #8a8a8a; }
.stock.in { color: #1e8e5a; }
.card.out .card-img { opacity: .75; }

/* Главная */
.hero { background: linear-gradient(120deg, #fdf6ec 0%, #fff 55%, #eafaf7 100%); border-radius: var(--radius); padding: 52px 56px; margin: 28px 0 10px; }
.hero h1 { font-size: 40px; margin: 0 0 10px; }
.hero p { max-width: 640px; font-size: 17px; }
.hero .stats { display: flex; gap: 40px; margin-top: 26px; flex-wrap: wrap; }
.hero .stat b { display: block; font-size: 28px; color: var(--accent); font-family: 'Playfair Display', serif; }
.hero .stat span { color: var(--muted); font-size: 14px; }
.cats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; margin: 26px 0 40px; }
.brands-tiles { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.cat-tile { background: var(--bg-light); border-radius: var(--radius); overflow: hidden; color: var(--head); display: flex; flex-direction: column; transition: background .25s, transform .25s, box-shadow .25s; }
.cat-tile:hover { background: #fff; box-shadow: 0 8px 26px rgba(0,0,0,.08); transform: translateY(-2px); }
.cat-tile .ct-img { display: block; aspect-ratio: 1 / 1; width: 100%; background: #f3f3f3; overflow: hidden; position: relative; }
.cat-tile .ct-img img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; transition: transform .35s; }
.cat-tile:hover .ct-img img { transform: scale(1.04); }
.cat-tile .ct-img-empty { display: flex; align-items: center; justify-content: center; color: #ccc; font-size: 14px; background: linear-gradient(135deg, #f7f7f7 0%, #ececec 100%); }
.cat-tile .ct-icon { display: flex; align-items: center; justify-content: center; height: 70px; color: var(--accent); background: linear-gradient(135deg, #eafaf7 0%, #f5fcfb 100%); }
.cat-tile .ct-icon svg { width: 36px; height: 36px; }
.cat-tile.brand-tile .ct-icon { color: var(--amber); background: linear-gradient(135deg, #fff7e2 0%, #fffaeb 100%); }
.cat-tile .ct-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.cat-tile .ct-name { font-family: 'Playfair Display', serif; font-size: 18px; font-weight: 700; line-height: 1.2; color: var(--head); }
.cat-tile .ct-cnt { color: var(--muted); font-size: 13.5px; }
@media (max-width: 460px) {
  .cat-tile .ct-icon { height: 56px; }
  .cat-tile .ct-icon svg { width: 28px; height: 28px; }
}

/* Карточка товара (страница) */
.pd { display: grid; grid-template-columns: minmax(0,5fr) minmax(0,4fr); gap: 40px; margin: 10px 0 30px; }
.pd-gallery { display: flex; flex-direction: column; gap: 12px; }
.pd-main-img { border-radius: var(--radius); border: 1px solid #eee; aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; background: var(--bg-light); overflow: hidden; }
.pd-main-img img { max-height: 100%; object-fit: contain; }
.pd-thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.pd-thumbs img { width: 74px; height: 74px; object-fit: contain; border-radius: 12px; border: 2px solid #eee; cursor: pointer; background: var(--bg-light); padding: 4px; }
.pd-thumbs img:hover, .pd-thumbs img.act { border-color: var(--accent); }
.pd-info h1 { font-size: 26px; margin: 0 0 6px; }
.pd-brandline { color: var(--muted); margin-bottom: 16px; font-size: 14.5px; }
.pd-brandline b { color: var(--head); letter-spacing: 1px; }
.pd-price { font-size: 34px; font-weight: 700; color: var(--head); margin: 8px 0; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pd-discount { font-size: 14px; font-weight: 600; background: var(--amber); color: #5d4200; border-radius: 12px; padding: 4px 14px; font-family: Roboto, sans-serif; }
.pd-price-note { font-size: 14px; color: var(--muted); margin-top: -2px; margin-bottom: 10px; font-weight: 400; }
.pd-price-note s { color: var(--muted); margin-right: 6px; font-weight: 400; }
.pd-stock { display: inline-block; border-radius: 16px; padding: 8px 18px; font-size: 15px; font-weight: 600; margin: 6px 0 18px; background: #f0f0f0; color: #8a8a8a; }
.pd-stock.in { background: #e6f7ef; color: #1e8e5a; }
.pd-cta { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0 22px; }
.btn { display: inline-block; padding: 13px 30px; border-radius: 30px; font-size: 15.5px; font-weight: 500; cursor: pointer; border: 2px solid var(--accent); color: var(--accent); background: transparent; font-family: inherit; }
.btn:hover { background: var(--accent); color: #fff; }
.btn-solid { background: var(--accent); color: #fff; }
.btn-solid:hover { background: #16a085; }
.btn-amber { border-color: var(--amber); color: #c98a00; }
.btn-amber:hover { background: var(--amber); color: #fff; }
.pd-specs { margin-top: 8px; }
.pd-specs table { border-collapse: collapse; width: 100%; }
.pd-specs td { padding: 8px 12px; border-bottom: 1px solid #f0f0f0; font-size: 14.5px; }
.pd-specs td:first-child { color: var(--muted); width: 42%; }
.pd-desc { margin: 8px 0 40px; }
.pd-desc h4 { margin: 18px 0 8px; font-size: 19px; }
.pd-desc p { white-space: pre-line; font-size: 15px; }
.pd-desc li { margin-left: 20px; }
.related { margin: 10px 0 60px; }
.related .grid { margin-top: 16px; }
.stock-note { border-left: 4px solid var(--amber); background: #fffaf0; border-radius: 0 14px 14px 0; padding: 14px 18px; font-size: 14.5px; margin: 14px 0; }

/* Подвал */
.foot { background: var(--dark); color: rgba(255,255,255,.75); margin-top: 30px; }
.foot-in { display: flex; gap: 40px; justify-content: space-between; padding: 34px 20px 20px; flex-wrap: wrap; }
.foot .logo-word { font-size: 24px; }
.foot .muted { color: rgba(255,255,255,.5); }
.foot .phone { color: #fff; font-size: 17px; }
.foot-links { display: flex; flex-direction: column; gap: 8px; }
.foot-links a { color: rgba(255,255,255,.75); }
.foot-links a:hover { color: var(--amber); }
.copy { padding: 18px 20px 26px; color: rgba(255,255,255,.35); font-size: 13px; }

/* Пагинация умная */
.pager { display: flex; gap: 8px; margin: 30px 0 50px; flex-wrap: wrap; align-items: center; }
.pager a, .pager span.cur, .pager span.dots { padding: 9px 16px; border-radius: 20px; border: 1px solid #e5e5e5; color: var(--head); font-size: 14.5px; background: #fff; }
.pager span.cur { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager span.dots { border: 0; color: var(--muted); padding: 9px 6px; }
.pager a:hover { border-color: var(--accent); color: var(--accent); }
.empty { padding: 60px 20px; text-align: center; color: var(--muted); }

/* ==== Мобильная адаптация ==== */
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .cats { grid-template-columns: repeat(3, 1fr); }
  .drop-panel { width: 480px; }
}
@media (max-width: 900px) {
  .catalog-layout { grid-template-columns: 1fr; }
  .filters { order: 2; position: static; }
  .pd { grid-template-columns: 1fr; }
  .hero { padding: 36px 26px; }
  .hero h1 { font-size: 30px; }
  .logo-word { font-size: 24px; }
  .logo-sub { font-size: 9px; letter-spacing: 2px; }
  .phone { font-size: 16px; }
}
@media (max-width: 780px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .cats { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  /* Меню-бургер: категории в выпадающую панель */
  .burger { display: flex; }
  .menu-in { flex-wrap: wrap; display: none; padding: 10px 16px 16px; }
  .menu-in.show { display: flex; }
  .menu-in > a, .drop-btn { width: 100%; justify-content: flex-start; padding: 12px 16px; }
  .drop { width: 100%; }
  .drop-panel { position: static; display: none; padding-top: 0; width: 100%; }
  .drop-panel::before { display: none; }
  .drop-panel-in { width: 100%; box-shadow: none; border: 0; border-top: 1px solid #eee; border-radius: 0; padding: 6px 0 10px 14px; grid-template-columns: 1fr 1fr; }
  .drop.open .drop-panel { display: block; }
  .menu-phone { margin-left: 0; }
  /* Поиск переносится ниже логотипа */
  .top-in { flex-wrap: wrap; }
  .search { order: 3; max-width: none; width: 100%; }
  /* Фильтры сворачиваются в кнопку */
  .filters { padding: 0; background: none; }
  .filters h3, .fgroup, .freset { display: none; }
  .filters.expanded h3, .filters.expanded .fgroup, .filters.expanded .freset { display: block; }
  .filters.expanded { background: var(--bg-light); padding: 20px; }
  .filters .ftoggle { display: flex; width: 100%; justify-content: space-between; align-items: center; background: var(--bg-light); border-radius: var(--radius); padding: 15px 20px; font-weight: 500; color: var(--head); font-size: 15px; border: 0; cursor: pointer; font-family: inherit; }
  .pager a, .pager span.cur { padding: 8px 12px; font-size: 14px; }
}
@media (min-width: 781px) {
  .filters .ftoggle { display: none; }
}
@media (max-width: 460px) {
  .grid { grid-template-columns: 1fr; }
  .card-name { min-height: 0; }
  .hero { padding: 26px 18px; }
  .top-in { gap: 12px; }
}

/* BAS: таблица модификаций в описании товара */
.pd-desc .bas-table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 16px 0 20px; border: 1px solid #e7e7e7; border-radius: 14px; overflow: hidden; font-size: 14.5px; }
.pd-desc .bas-table th { background: var(--bg-light); color: var(--head); text-align: left; padding: 10px 16px; font-size: 12.5px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; }
.pd-desc .bas-table td { padding: 10px 16px; border-top: 1px solid #f0f0f0; vertical-align: top; line-height: 1.45; color: var(--text); }
.pd-desc .bas-table tbody tr:nth-child(even) { background: #fafbfb; }
.pd-desc .bas-table tbody tr:hover { background: #f2f9f7; }
.pd-desc .bas-table td:first-child { white-space: nowrap; font-weight: 600; color: var(--head); }
.pd-desc .bas-table thead th:first-child { border-top-left-radius: 13px; }
.pd-desc .bas-table thead th:last-child { border-top-right-radius: 13px; }
@media (max-width: 640px) {
  .pd-desc .bas-table { font-size: 13.5px; border-radius: 10px; }
  .pd-desc .bas-table th, .pd-desc .bas-table td { padding: 8px 10px; }
  .pd-desc .bas-table td:first-child { white-space: normal; }
}
