/*
Theme Name: KZmarket
Theme URI: https://github.com/TerentievKirill/KZmarket
Author: KZmarket
Description: Practical responsive WooCommerce electronics storefront.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.1
Text Domain: kzmarket
*/

:root {
  --blue: #1262dc;
  --blue-dark: #0c4db4;
  --ink: #182333;
  --muted: #69788b;
  --paper: #fff;
  --background: #f6f8fb;
  --line: #e3e9f0;
  --shadow: 0 12px 35px rgba(30, 56, 95, .07);
  --radius: 15px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body, button, input, select, textarea { font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--blue); }
button, input, select { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; height: auto; }
.container { width: min(100% - 52px, 1420px); margin-inline: auto; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link:focus { position: fixed; z-index: 999; top: 12px; left: 12px; width: auto; height: auto; clip: auto; background: #fff; color: #111; padding: 10px 16px; }
:focus-visible { outline: 3px solid #87baff; outline-offset: 3px; }

/* Common shop header */
.topbar { color: #607080; background: #f3f6fa; border-bottom: 1px solid #e9eef5; font-size: 12px; }
.topbar-inner { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.topbar-links { display: flex; align-items: center; gap: 25px; }
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: relative; z-index: 10; }
.header-inner { display: flex; align-items: center; gap: 20px; min-height: 91px; }
.site-brand { display: inline-flex; align-items: center; flex: 0 0 auto; white-space: nowrap; font-size: 29px; font-weight: 850; letter-spacing: -1.8px; color: #162436; }
.site-brand:hover { color: #162436; }
.brand-sign { display: grid; place-items: center; background: var(--blue); border-radius: 10px; color: white; font-size: 19px; letter-spacing: -.7px; height: 39px; width: 43px; margin-right: 8px; }
.brand-period, .footer-brand span { color: var(--blue); }
.brand-image { max-width: 210px; max-height: 60px; width: auto; height: auto; object-fit: contain; }
.catalog-toggle { display: flex; align-items: center; justify-content: center; gap: 13px; border: 0; border-radius: 9px; background: var(--blue); color: #fff; min-width: 148px; height: 49px; font-weight: 700; }
.catalog-toggle:hover, .catalog-toggle[aria-expanded=true] { background: var(--blue-dark); }
.catalog-toggle span:first-child { font-size: 20px; line-height: 1; }
.header-search { flex: 1; display: flex; height: 49px; min-width: 150px; border: 1px solid #cbd9ea; border-radius: 9px; overflow: hidden; background: #fff; }
.header-search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(18,98,220,.1); }
.header-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: 0; padding: 0 17px; font-size: 14px; }
.header-search button { display: grid; place-items: center; flex: 0 0 54px; border: 0; background: var(--blue); color: white; }
.header-search button:hover { background: var(--blue-dark); }
.header-search button svg, .header-action svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.header-actions { display: flex; align-items: center; gap: 22px; }
.header-phone { font-size: 13px; font-weight: 700; white-space: nowrap; }
.header-action { position: relative; display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.header-cart-count { display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: var(--blue); color: white; font-size: 11px; font-weight: 800; }
.category-nav { border-bottom: 1px solid #e9edf2; background: #fff; }
.category-nav-inner { display: flex; align-items: center; gap: 32px; min-height: 43px; overflow-x: auto; white-space: nowrap; scrollbar-width: thin; font-size: 13px; font-weight: 600; }
.category-nav .nav-all { color: var(--blue); margin-left: auto; }
.catalog-menu-wrap { position: absolute; width: 100%; background: #fff; box-shadow: var(--shadow); border-top: 1px solid var(--line); }
.catalog-menu-wrap[hidden] { display: none; }
.catalog-menu { padding-block: 15px 22px; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 7px 22px; }
.catalog-menu a { padding: 12px; border-radius: 10px; font-size: 14px; font-weight: 550; }
.catalog-menu a span { margin-right: 11px; }
.catalog-menu a:hover { background: #f1f6fd; }
.catalog-menu .catalog-menu-all { color: var(--blue); }

/* Homepage */
.hero { display: grid; grid-template-columns: 48% 52%; position: relative; margin-top: 24px; overflow: hidden; border-radius: 17px; min-height: 350px; isolation: isolate; background: linear-gradient(118deg, #06469e 0%, #1267dc 51%, #55a7ed 100%); color: #fff; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(circle at 78% 45%, rgba(255,255,255,.22), transparent 40%); }
.hero-text { align-self: center; padding: 44px 0 44px 54px; position: relative; z-index: 1; }
.hero .eyebrow { text-transform: uppercase; font-size: 11px; font-weight: 800; letter-spacing: 2.4px; color: #cfe4ff; }
.hero h1 { font-size: clamp(33px, 3.2vw, 50px); line-height: 1.08; letter-spacing: -1.8px; margin: 13px 0 17px; max-width: 550px; }
.hero p { max-width: 430px; color: #e4f0ff; font-size: 16px; line-height: 1.6; margin: 0 0 24px; }
.hero .button-white { display: inline-flex; align-items: center; gap: 18px; background: #fff; color: var(--blue-dark); padding: 12px 18px; border-radius: 8px; font-size: 14px; font-weight: 800; }
.hero .button-white:hover { background: #edf6ff; }
.hero-picture { display: flex; align-items: end; justify-content: center; padding: 17px 10px 0 0; }
.hero-picture img { width: min(100%, 640px); max-height: 335px; object-fit: contain; object-position: center bottom; }
.home-section { margin-top: 38px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 15px; margin-bottom: 20px; }
.section-heading h2 { font-size: clamp(24px, 2.1vw, 31px); line-height: 1.2; margin: 0; letter-spacing: -.7px; }
.section-heading > a { color: var(--blue); font-size: 14px; font-weight: 700; white-space: nowrap; }
.section-heading > a span { margin-left: 7px; }
.category-tiles { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 14px; }
.category-tile { min-height: 120px; display: flex; align-items: center; flex-direction: column; justify-content: center; position: relative; gap: 9px; border: 1px solid #e6edf5; border-radius: 13px; background: linear-gradient(150deg,#f9fbff,#eef4fa); text-align: center; transition: transform .18s ease, border-color .18s ease; }
.category-tile:hover { transform: translateY(-3px); border-color: #b9d0ef; }
.category-tile strong { font-size: 13px; }
.category-icon { font-size: 38px; line-height: 1.2; }
.category-arrow { position: absolute; top: 11px; right: 13px; color: #a1b2c5; }
.empty-catalogue { display: flex; align-items: center; gap: 20px; background: #f5f8fc; border: 1px dashed #c5d5e6; border-radius: 13px; padding: 35px; }
.empty-catalogue > span { font-size: 45px; }
.empty-catalogue h3 { margin: 0 0 3px; }
.empty-catalogue p { margin: 0; color: var(--muted); }
.features-strip { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 20px; margin: 35px 0 45px; padding: 22px; border-radius: 14px; background: #f2f6fa; }
.features-strip > div { display: grid; grid-template-columns: 38px 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 10px; }
.features-strip span { grid-row: 1 / span 2; font-size: 29px; }
.features-strip strong { font-size: 13px; }
.features-strip p { margin: 0; font-size: 12px; color: var(--muted); }

/* WooCommerce product cards and catalogue */
.woocommerce ul.products, .woocommerce-page ul.products,
.woocommerce.columns-4 ul.products { display: grid !important; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 17px; margin: 0 0 22px; padding: 0; }
.woocommerce ul.products::before, .woocommerce ul.products::after { display: none !important; }
.woocommerce ul.products li.product, .woocommerce-page ul.products li.product { float: none !important; width: auto !important; margin: 0 !important; padding: 15px !important; display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: 13px; background: white; transition: box-shadow .2s ease, transform .2s ease; }
.woocommerce ul.products li.product:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.woocommerce ul.products li.product a.woocommerce-LoopProduct-link { display: block; flex: 1; }
.woocommerce ul.products li.product a img { display: block; width: 100%; height: 195px; object-fit: contain; border-radius: 9px; margin: 0 0 10px; background: #f7f9fc; }
.woocommerce ul.products li.product .woocommerce-loop-product__title { color: var(--ink); padding: 0 !important; font-size: 14px !important; font-weight: 700; line-height: 1.45; min-height: 43px; margin: 0 0 10px; }
.woocommerce ul.products li.product .price { font-size: 20px !important; font-weight: 850; color: var(--ink) !important; margin: 0 0 10px; }
.woocommerce ul.products li.product .price del { color: #8692a2; font-size: 12px; font-weight: 400; }
.woocommerce ul.products li.product .button, .woocommerce ul.products li.product .added_to_cart { text-align: center; display: block; margin: auto 0 0 !important; padding: 11px 10px; background: var(--blue); color: #fff; border-radius: 8px; font-size: 13px; font-weight: 750; }
.woocommerce ul.products li.product .button:hover { background: var(--blue-dark); }
.woocommerce span.onsale { background: #ee4e55; min-height: auto; min-width: auto; line-height: 1.4; padding: 5px 10px; border-radius: 8px; font-size: 12px; }
.shop-layout { display: grid; gap: 30px; padding-block: 28px 60px; align-items: start; }
.shop-layout.has-sidebar { grid-template-columns: 245px minmax(0,1fr); }
.shop-content { min-width: 0; }
.shop-content.full-width { width: 100%; }
.catalog-sidebar { padding: 22px; border: 1px solid var(--line); border-radius: 13px; }
.catalog-sidebar h2 { font-size: 19px; margin: 0 0 12px; }
.catalog-sidebar h3 { font-size: 15px; margin: 23px 0 12px; }
.sidebar-categories { list-style: none; margin: 0; padding: 0; }
.sidebar-categories li + li { border-top: 1px solid #eef2f7; }
.sidebar-categories a { display: block; padding: 10px 0; font-size: 13px; }
.price-inputs { display: flex; gap: 10px; }
.price-inputs label { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); }
.price-inputs input { width: 100%; display: block; height: 40px; margin-top: 4px; padding: 6px 8px; border: 1px solid #d7e0ec; border-radius: 7px; }
.brand-filter { display: block; margin: 16px 0; color: var(--muted); font-size: 12px; }
.brand-filter select { display: block; width: 100%; padding: 9px; border: 1px solid #d7e0ec; border-radius: 7px; margin-top: 5px; }
.filters-form .button { margin: 20px 0 8px; width: 100%; }
.clear-filters { font-size: 12px; color: var(--muted); display: block; text-align: center; }
.woocommerce .woocommerce-result-count { color: var(--muted); font-size: 14px; }
.woocommerce .woocommerce-ordering select { background: #fff; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; }
.woocommerce-breadcrumb { margin-bottom: 20px !important; color: var(--muted) !important; }
.woocommerce .page-title, .woocommerce div.product .product_title { font-size: clamp(25px,2.5vw,35px); line-height: 1.2; }
.woocommerce nav.woocommerce-pagination ul { border: 0; display: flex; gap: 8px; }
.woocommerce nav.woocommerce-pagination ul li { border: 0; }
.woocommerce nav.woocommerce-pagination ul li a, .woocommerce nav.woocommerce-pagination ul li span { border: 1px solid var(--line); border-radius: 7px; padding: 10px 13px; }
.woocommerce nav.woocommerce-pagination ul li span.current { background: var(--blue); color: white; }

/* Single products, cart, checkout, account */
.woocommerce div.product div.images img { background: #f7f9fc; border: 1px solid var(--line); border-radius: 14px; }
.woocommerce div.product p.price, .woocommerce div.product span.price { color: var(--ink); font-size: 28px; font-weight: 850; }
.woocommerce .quantity .qty { height: 43px; border: 1px solid var(--line); border-radius: 7px; }
.woocommerce div.product form.cart .button, .woocommerce .button.button-primary,
.woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt,
.woocommerce input.button.alt, .woocommerce button.button, .woocommerce a.button,
.woocommerce input.button, .button-primary { background: var(--blue) !important; border: 0 !important; border-radius: 8px !important; color: white !important; padding: 13px 19px !important; font-weight: 750 !important; }
.woocommerce button.button:hover, .woocommerce a.button:hover, .button-primary:hover { background: var(--blue-dark) !important; }
.woocommerce div.product .woocommerce-tabs ul.tabs li.active { background: #fff; }
.woocommerce div.product .woocommerce-tabs { margin-top: 40px; }
.woocommerce div.product .woocommerce-tabs .panel { line-height: 1.7; }
.woocommerce table.shop_table { border-radius: 12px; border-color: var(--line); }
.woocommerce form .form-row input.input-text, .woocommerce form .form-row textarea, .woocommerce form .form-row select, .woocommerce .input-text { border: 1px solid #ccd8e6; border-radius: 7px; padding: 11px 12px; }
.woocommerce .select2-container .select2-selection--single { border-color: #ccd8e6; height: 43px; border-radius: 7px; }
.woocommerce .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 41px; }
.woocommerce .select2-container--default .select2-selection--single .select2-selection__arrow { height: 41px; }
.woocommerce-checkout #payment { border-radius: 12px; background: #f5f8fc; }
.woocommerce-account .woocommerce-MyAccount-navigation ul { list-style: none; margin: 0; padding: 0; }
.woocommerce-account .woocommerce-MyAccount-navigation li { padding: 9px 0; }
.woocommerce-info { border-top-color: var(--blue); }
.woocommerce-info::before { color: var(--blue); }
.content-page { padding-block: 42px 80px; min-height: 48vh; }
.content-page article { max-width: 920px; }
.content-page h1 { margin: 0 0 18px; font-size: clamp(26px,2.8vw,38px); }
.entry-content { line-height: 1.75; }
.entry-content a { color: var(--blue); text-decoration: underline; }

/* Footer */
.site-footer { background: #172639; color: #d0dbe8; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 80px; padding: 45px 0; }
.footer-brand { font-weight: 850; color: #fff; font-size: 26px; letter-spacing: -1px; }
.footer-grid p { max-width: 350px; color: #92a8be; font-size: 13px; line-height: 1.7; }
.footer-grid h3 { margin: 0 0 15px; color: #fff; font-size: 15px; }
.footer-grid a:not(.footer-brand) { display: block; color: #bed0e1; font-size: 13px; margin: 9px 0; }
.footer-grid a:hover { color: white; }
.footer-bottom { display: flex; justify-content: space-between; padding: 17px 0; border-top: 1px solid #314153; color: #91a3b8; font-size: 12px; }

@media (max-width: 1200px) {
  .header-inner { gap: 13px; }
  .site-brand { font-size: 24px; }
  .catalog-toggle { min-width: 125px; }
  .header-phone { display: none; }
  .category-nav-inner { gap: 20px; }
  .category-tiles { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .woocommerce ul.products, .woocommerce-page ul.products { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 850px) {
  .container { width: min(100% - 30px, 1420px); }
  .topbar-inner { min-height: 28px; }
  .header-inner { flex-wrap: wrap; padding-block: 14px; }
  .site-brand { order: 0; margin-right: auto; }
  .header-actions { order: 1; }
  .account-link { display: none; }
  .catalog-toggle { order: 2; }
  .header-search { order: 3; flex: 1 1 calc(100% - 155px); }
  .hero { min-height: 320px; grid-template-columns: 55% 45%; }
  .hero-text { padding-left: 32px; }
  .hero h1 { font-size: 35px; }
  .hero-picture img { max-height: 290px; }
  .catalog-menu { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .shop-layout.has-sidebar { grid-template-columns: 185px minmax(0,1fr); gap: 18px; }
  .catalog-sidebar { padding: 14px; }
  .woocommerce ul.products, .woocommerce-page ul.products { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .features-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .footer-grid { gap: 30px; }
}
@media (max-width: 600px) {
  .topbar { display: none; }
  .header-inner { gap: 10px; }
  .site-brand { font-size: 24px; }
  .brand-sign { width: 34px; height: 34px; font-size: 15px; }
  .header-action span:not(.header-cart-count) { display: none; }
  .header-search { min-width: 0; }
  .catalog-toggle { min-width: 112px; font-size: 14px; }
  .category-nav-inner { min-height: 40px; }
  .catalog-menu { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .hero { grid-template-columns: 1fr; min-height: 390px; }
  .hero-text { padding: 28px 24px 0; align-self: start; }
  .hero .eyebrow { font-size: 9px; }
  .hero h1 { font-size: 32px; max-width: 320px; margin-block: 10px; }
  .hero p { font-size: 13px; max-width: 275px; margin-bottom: 13px; }
  .hero .button-white { padding: 10px 12px; font-size: 12px; }
  .hero-picture { justify-content: end; height: 180px; padding: 0 8px; }
  .hero-picture img { height: 205px; width: 310px; }
  .home-section { margin-top: 27px; }
  .section-heading h2 { font-size: 23px; }
  .section-heading > a { font-size: 12px; }
  .category-tiles { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .category-tile { min-height: 105px; }
  .category-icon { font-size: 31px; }
  .shop-layout.has-sidebar { display: block; }
  .catalog-sidebar { margin-bottom: 22px; }
  .sidebar-categories { display: flex; flex-wrap: wrap; gap: 4px 14px; }
  .sidebar-categories li + li { border-top: 0; }
  .filters-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
  .filters-form h3 { grid-column: 1 / -1; margin: 0; }
  .filters-form .button { margin: 0; }
  .filters-form .clear-filters { grid-column: 1 / -1; }
  .woocommerce ul.products, .woocommerce-page ul.products { gap: 9px; }
  .woocommerce ul.products li.product, .woocommerce-page ul.products li.product { padding: 9px !important; }
  .woocommerce ul.products li.product a img { height: 140px; }
  .woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: 12px !important; }
  .woocommerce ul.products li.product .price { font-size: 16px !important; }
  .woocommerce .woocommerce-result-count, .woocommerce .woocommerce-ordering { float: none; display: block; }
  .features-strip { padding: 17px; gap: 14px; }
  .features-strip strong { font-size: 11px; }
  .features-strip p { font-size: 10px; }
  .footer-grid { grid-template-columns: 1fr 1fr; padding-block: 32px; gap: 20px; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
  .footer-bottom { gap: 5px; flex-direction: column; }
}
