/*
Theme Name: ApexUniSmart Classic
Description: Тема в стиле старого сайта apexunismart.ru (Diafan): шапка, синее меню, аккордеон каталога слева, слайдер, тёмный футер.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: apexunismart
*/

/* ---------- База ---------- */
html, body { margin: 0; padding: 0; }
html {
	background: #DADADA url("img/background.png") no-repeat center top;
	background-size: 100%;
}
body { font-family: Verdana, Geneva, sans-serif; font-size: 12px; color: #414141; background: transparent; }
a { color: #14478D; text-decoration: none; }
a:hover { color: #29a3b6; }
img { max-width: 100%; height: auto; }
.clearfix::after { content: ""; display: block; clear: both; }
.screen-reader-text { position: absolute !important; clip: rect(1px,1px,1px,1px); width: 1px; height: 1px; overflow: hidden; }

/* ---------- Каркас ---------- */
#parent {
	box-sizing: content-box;
	margin: 0 auto;
	max-width: 970px;
	padding: 40px 65px 0;
	background: #fff;
}

/* ---------- Шапка ---------- */
#header { display: flex; align-items: center; gap: 24px; min-height: 84px; }
#logo { flex: 0 0 250px; height: 84px; display: block; background: url("img/logo.png") no-repeat left center; background-size: contain; }
#logo .site-name { display: none; }
.no-logo-img #logo { background: none; }
.no-logo-img #logo .site-name { display: block; font-size: 30px; font-weight: bold; line-height: 84px; color: #15448d; }
#desc { flex: 0 0 168px; font-size: 11px; line-height: 13px; }
#search { flex: 1 1 205px; max-width: 220px; }
#search form { position: relative; margin: 0; }
#search input[type=search] {
	box-sizing: border-box; width: 100%; height: 24px; padding: 0 30px 0 9px;
	font: 10px Verdana, sans-serif; border: 1px solid #DADADA; outline: none;
}
#search input[type=search]:focus { border-color: #29a3b6; }
#search button {
	position: absolute; right: 4px; top: 3px; width: 18px; height: 18px; padding: 0 0 0 6px;
	border: 0; border-left: 1px solid #E5E5E5; background: none; cursor: pointer; color: #8a8a8a;
}
#phone { margin-left: auto; text-align: right; font-size: 16px; font-weight: bold; line-height: 18px; }
#phone .phone { display: block; white-space: nowrap; color: #262626; }
#phone .mail { display: block; font-size: 11px; font-weight: normal; color: #29a3b6; }

/* ---------- Верхнее меню ---------- */
#menu { margin-top: 26px; }
#menu ul.navigation { display: flex; margin: 0; padding: 0; list-style: none; }
#menu ul.navigation li { flex: 1 1 auto; }
#menu ul.navigation li a {
	display: block; padding: 16px 8px; text-align: center; white-space: nowrap;
	font-size: 12px; font-weight: bold; text-transform: uppercase; color: #fff;
	text-shadow: 1px 0 0 rgba(0,0,0,.14);
	background: #14478D; border-top: 2px solid #5173AA; border-right: 1px solid #365C9C;
}
#menu ul.navigation li:last-child a { border-right: 0; }
#menu ul.navigation li a:hover,
#menu ul.navigation li.current-menu-item a,
#menu ul.navigation li.current-menu-ancestor a { background: #2BA3B6; border-top-color: #5FBAC8; border-right-color: #2BA3B6; }
.menu-toggle { display: none; }

/* ---------- Колонки ---------- */
#columns { display: flex; align-items: flex-start; gap: 30px; margin-top: 29px; padding-bottom: 60px; }
#left { flex: 0 0 236px; }
#right { flex: 1 1 auto; min-width: 0; }

/* Аккордеон каталога */
.apex-accordion, .apex-accordion ul { list-style: none; margin: 0; padding: 0; }
.apex-accordion > li > a {
	display: block; height: 40px; line-height: 40px; padding-left: 17px; overflow: hidden;
	background: #DADADA; border-bottom: 1px solid #E7E7E7;
	font-size: 10px; font-weight: bold; text-transform: uppercase; color: #15448d;
	text-shadow: 0 1px 0 rgba(255,255,255,.43); cursor: pointer;
}
.apex-accordion > li > a::before { content: "▸"; display: inline-block; width: 12px; color: #15448d; }
.apex-accordion > li.open > a { background: #EDEDED; border-bottom-color: #EDEDED; }
.apex-accordion > li.open > a::before { content: "▾"; }
.apex-accordion > li > ul { display: none; background: #EDEDED; padding: 0 10px 10px 17px; }
.apex-accordion > li.open > ul { display: block; }
.apex-accordion > li > ul a { display: block; line-height: 16px; padding: 4px 0; font-size: 11px; color: #29a3b6; text-shadow: 0 1px 0 rgba(255,255,255,.43); }
.apex-accordion > li > ul a:hover, .apex-accordion .current-menu-item > a { color: #14478D; }

/* Мини-блоки слева */
.mini { box-sizing: border-box; width: 100%; margin-top: 20px; padding: 17px 12px 10px 13px; border: 4px solid #DADADA; font-size: 11px; color: #434343; transition: border-color .2s; }
.mini h4 { margin: 0 0 8px; font-size: 18px; font-weight: bold; color: #15448d; }
.mini a { color: #15448d; }
.mini:hover { border-color: #29a3b6; }
.mini:hover h4, .mini:hover a { color: #29a3b6; }
.mini.about { border-color: #29a3b6; }
.mini.about h4, .mini.about a { color: #29a3b6; }
.mini ul { list-style: none; margin: 0; padding: 0; }
.mini ul li { margin: 0 0 8px; font-weight: bold; }
.mini .faq-item { padding: 5px 0; }
.mini .news-item { margin-bottom: 8px; }
.mini .news-item span { display: block; color: #a0a0a0; }
.mini .all { margin: 8px 0 0; }

/* ---------- Слайдер ---------- */
.apex-slider { position: relative; height: 371px; overflow: hidden; background: #f3f3f3; }
.apex-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; pointer-events: none; }
.apex-slide.active { opacity: 1; pointer-events: auto; }
.apex-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.apex-slide .ltext { position: absolute; left: 26px; top: 146px; width: 508px; max-width: calc(100% - 52px); background: rgba(21,68,141,.87); }
.apex-slide .slogan { padding: 15px; font-size: 24px; font-weight: bold; line-height: 1.25; }
.apex-slide .slogan a { color: #fff; text-shadow: 1px 1px 0 rgba(0,0,0,.14); }
.apex-slider-dots { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 4px; z-index: 2; }
.apex-slider-dots button { width: 9px; height: 9px; padding: 0; border: 0; background: #DADADA; cursor: pointer; }
.apex-slider-dots button.active, .apex-slider-dots button:hover { background: #15448d; }

/* ---------- Контент ---------- */
#content, #content-inner { margin-top: 0; }
.apex-slider + #content { margin-top: 23px; }
#content h1, #content-inner h1 { margin: 0 0 16px; font-size: 30px; font-weight: normal; color: #262626; line-height: 1.2; }
#content h2, #content-inner h2 { font-size: 22px; font-weight: normal; color: #262626; }
#content p, #content-inner p, .entry li { font-size: 12px; line-height: 20px; color: #414141; }
.entry table { border-collapse: collapse; max-width: 100%; }
.entry td, .entry th { border: 1px solid #e3e3e3; padding: 5px 8px; vertical-align: top; }
.entry iframe { max-width: 100%; }
.entry img { max-width: 100%; height: auto; }
/* Корень каталога (разметка из Diafan) */
.entry .shop_list { margin: 0 0 20px; }
.entry .block_header { margin: 18px 0 8px; padding: 8px 12px; background: #15448d; color: #fff; font-weight: bold; text-transform: uppercase; font-size: 12px; }
.entry .block_header a { color: #fff; }
.entry .shop_cat_link { display: inline-block; margin: 4px 14px 4px 0; }
.entry .shop_cat_link a { color: #29a3b6; font-size: 13px; }
.apex-crumbs { margin: 0 0 14px; font-size: 11px; color: #8a8a8a; }
.apex-crumbs a { color: #29a3b6; }
.apex-date { font-size: 11px; font-style: italic; color: #8a8a8a; margin: -8px 0 12px; }

/* Товар */
.apex-product { display: flex; gap: 24px; align-items: flex-start; }
.apex-gallery { flex: 0 0 280px; display: flex; flex-wrap: wrap; gap: 6px; }
.apex-gallery a { display: block; border: 1px solid #e3e3e3; }
.apex-gallery a:first-child { flex: 0 0 100%; }
.apex-gallery a:not(:first-child) { width: 86px; }
.apex-product-info { flex: 1 1 auto; min-width: 0; }
.apex-article { font-weight: bold; font-size: 13px; color: #15448d; }
.apex-params { width: 100%; margin-top: 14px; border-collapse: collapse; table-layout: fixed; }
.apex-params td, .apex-params th, .entry td { overflow-wrap: anywhere; word-break: break-word; }
.apex-params th { width: 38%; text-align: left; background: #f3f3f3; font-weight: bold; }
.apex-params th, .apex-params td { border: 1px solid #e3e3e3; padding: 6px 8px; font-size: 12px; vertical-align: top; }

/* Списки (каталог, новости, FAQ, файлы) */
.apex-subcats { list-style: none; margin: 10px 0 20px; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 20px; }
.apex-subcats a { display: block; padding: 8px 10px; background: #EFEFEF; font-weight: bold; }
.apex-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin: 10px 0 20px; }
.apex-card { font-size: 12px; }
.apex-card .thumb { display: flex; align-items: center; justify-content: center; height: 150px; border: 1px solid #ececec; margin-bottom: 8px; background: #fff; }
.apex-card .thumb img { max-height: 140px; width: auto; }
.apex-card .title { color: #15448d; display: block; line-height: 1.35; }
.apex-card .meta { color: #8a8a8a; font-size: 11px; margin-top: 4px; }
.apex-list { list-style: none; margin: 10px 0 20px; padding: 0; }
.apex-list li { padding: 0 0 11px; margin: 0 0 11px; border-bottom: 1px solid #EEE; }
.apex-list .title { font-weight: bold; font-size: 13px; }
.apex-list .date { font-size: 11px; font-style: italic; color: #8a8a8a; }
.apex-list .excerpt { margin-top: 4px; color: #555; line-height: 18px; }
.apex-pagination { margin: 20px 0; text-align: center; }
.apex-pagination .page-numbers { display: inline-block; min-width: 26px; padding: 4px 6px; margin: 0 2px; border: 1px solid #DADADA; }
.apex-pagination .current { background: #15448d; color: #fff; border-color: #15448d; }

/* Последние поступления */
.new_products { margin-top: 30px; position: relative; }
.new_products .novin { font-size: 30px; color: #262626; margin-bottom: 18px; }
.apex-glider { position: relative; }
.apex-glider-track { display: flex; gap: 30px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; padding-bottom: 4px; }
.apex-glider-track::-webkit-scrollbar { display: none; }
.apex-glider-track .apex-card { flex: 0 0 calc((100% - 60px) / 3); scroll-snap-align: start; }
.apex-glider-nav { position: absolute; top: -48px; right: 0; display: flex; gap: 2px; }
.apex-glider-nav button { width: 28px; height: 28px; border: 0; background: #DADADA; color: #15448d; font-size: 16px; cursor: pointer; }
.apex-glider-nav button:hover { background: #15448d; color: #fff; }

/* ---------- Футер ---------- */
#footer { max-width: 970px; box-sizing: content-box; margin: 0 auto; padding: 40px 65px 20px; background: #2f2f2f url("img/footer.jpg") repeat; color: #fff; }
.f-menu { display: flex; gap: 60px; padding-bottom: 30px; border-bottom: 1px solid #393939; }
.f-menu .blocks { padding-left: 17px; }
.f-menu h4 { margin: 0 0 12px; font-size: 14px; font-weight: bold; color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.6); }
.f-menu .blocks p { margin: 0 0 8px; }
.f-menu .blocks a { font-size: 11px; color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.6); }
.f-menu .apex { margin-left: auto; width: 230px; position: relative; padding: 12px; background: rgba(0,0,0,.1); font-size: 11px; line-height: 14px; }
.f-menu .apex img { max-width: 160px; display: block; margin-bottom: 8px; }
.copy { display: flex; justify-content: space-between; border-top: 1px solid #929292; padding-top: 20px; font-size: 11px; color: #d3d3d3; text-shadow: 0 -1px 0 rgba(0,0,0,.64); }
.copy a { color: #d3d3d3; }

/* ---------- Адаптив ---------- */
@media (max-width: 1100px) {
	#parent, #footer { padding-left: 20px; padding-right: 20px; }
}
@media (max-width: 860px) {
	#header { flex-wrap: wrap; gap: 12px; }
	#desc { display: none; }
	#search { order: 3; flex: 1 1 100%; max-width: none; }
	.menu-toggle { display: block; width: 100%; margin-top: 16px; padding: 12px; border: 0; background: #14478D; color: #fff; font: bold 12px Verdana, sans-serif; text-transform: uppercase; cursor: pointer; }
	#menu { margin-top: 0; }
	#menu ul.navigation { display: none; flex-direction: column; }
	#menu.open ul.navigation { display: flex; }
	#menu ul.navigation li a { border-right: 0; text-align: left; padding: 12px 16px; }
	#columns { flex-direction: column-reverse; }
	#left { flex: 1 1 auto; width: 100%; }
	.apex-grid { grid-template-columns: repeat(2, 1fr); }
	.apex-product { flex-direction: column; }
	.apex-gallery { flex: 1 1 auto; }
	.apex-slider { height: 240px; }
	.apex-slide .ltext { top: auto; bottom: 20px; }
	.apex-slide .slogan { font-size: 16px; }
	.f-menu { flex-wrap: wrap; gap: 20px; }
	.f-menu .apex { margin-left: 0; }
}
@media (max-width: 520px) {
	.apex-grid, .apex-subcats { grid-template-columns: 1fr; }
	.apex-glider-track .apex-card { flex-basis: 80%; }
	.copy { flex-direction: column; gap: 8px; }
}
