/* === NSK Site CSS === */
:root {
    --color-primary: #FFC72C;
    --color-primary-dark: #FFB81C;
    --color-bg: #FFFFFF;
    --color-text: #1A1A1A;
    --color-link: #0066CC;
    --color-footer: #333333;
    --color-border: #FFC72C;
    --color-light: #f8f8f8;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: Arial, sans-serif; color: var(--color-text); background: var(--color-bg); line-height: 1.5; }
a { color: var(--color-link); text-decoration: none; }
img { max-width: 100%; height: auto; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
h1 { font-size: 1.8em; margin: 20px 0; }
h2 { font-size: 1.4em; margin: 15px 0; }
h3 { font-size: 1.15em; margin: 10px 0; }

/* Header */
.site-header { background: #fff; border-bottom: 3px solid var(--color-primary); }
.header-top { background: var(--color-footer); color: #fff; padding: 5px 0; }
.header-top .container { display: flex; justify-content: space-between; align-items: center; }
.header-contacts a { color: #fff; margin-right: 20px; font-size: 0.85em; }
.header-nav ul { list-style: none; display: flex; gap: 15px; }
.header-nav a { color: #fff; font-size: 0.85em; }
.header-main .container { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; }
.logo { display: flex; flex-direction: column; }
.logo-text { font-size: 2em; font-weight: bold; color: var(--color-primary-dark); }
.logo-tagline { font-size: 0.75em; color: #888; }
.header-phones { text-align: right; }
.phone-main { font-size: 1.3em; font-weight: bold; color: var(--color-text); }
.phone-note { display: block; font-size: 0.75em; color: #888; }

/* Заголовок h1 на главной нужен поисковикам, но в макете его нет —
   его роль играет заголовок активного слайда. */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Слайдер на главной */
.hero-slider { position: relative; overflow: hidden; background: #1a1a1a; }
.hero-slider__viewport { position: relative; height: 560px; }
.hero-slide { position: absolute; inset: 0; display: flex; align-items: center; background-position: center; background-size: cover; background-repeat: no-repeat; opacity: 0; visibility: hidden; transition: opacity .5s ease; }
/* Класс is-active стоит на первом слайде прямо в разметке, поэтому без JS
   страница показывает первый слайд, а не пустой чёрный прямоугольник. */
.hero-slide.is-active { opacity: 1; visibility: visible; }
.hero-slide__box { position: relative; max-width: 560px; padding: 35px 40px; border: 2px solid rgba(255,255,255,.85); border-radius: 10px; }
.hero-slide__box--wide { max-width: 820px; }
.hero-slide__title { color: #fff; font-size: 2.6em; line-height: 1.2; font-weight: 700; text-transform: uppercase; margin: 0; }
.hero-slide__list { list-style: none; display: flex; flex-direction: column; gap: 14px; margin: 20px 0 0; padding: 0; }
.hero-slide__list li { position: relative; padding-left: 30px; color: #fff; font-size: 1.05em; line-height: 1.4; }
.hero-slide__list li::before { content: ""; position: absolute; left: 0; top: .35em; width: 15px; height: 13px; background: url("data:image/svg+xml,%3Csvg width='15' height='13' viewBox='0 0 15 13' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.9434 13L0 6.34884L0.849057 5.13953L5.66038 8.76744L13.8679 0L15 1.2093L5.9434 13Z' fill='%23fec72c'/%3E%3C/svg%3E") no-repeat; }
.hero-slide__text { color: #fff; font-size: 1.05em; font-weight: 700; line-height: 1.5; margin-top: 14px; }
.hero-slide .btn { margin-top: 25px; }
.hero-slider__nav { position: absolute; right: 30px; bottom: 30px; z-index: 3; display: flex; gap: 10px; }
.hero-slider__btn { width: 44px; height: 44px; border: 2px solid rgba(255,255,255,.7); background: rgba(0,0,0,.25); color: #fff; font-size: 1.1em; border-radius: 50%; cursor: pointer; }
.hero-slider__btn:hover { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-text); }
.hero-slider__dots { position: absolute; left: 0; right: 0; bottom: 30px; z-index: 2; display: flex; justify-content: center; gap: 10px; }
.hero-slider__dot { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.45); cursor: pointer; }
.hero-slider__dot.is-active { background: var(--color-primary); }

.hero-slide--1 { background-image: url(/assets/images/slider/slide-1.jpg); }
.hero-slide--2 { background-image: url(/assets/images/slider/slide-2.jpg); }
.hero-slide--3 { background-image: url(/assets/images/slider/slide-3.jpg); }
.hero-slide--4 { background-image: url(/assets/images/slider/slide-4.jpg); }
.hero-slide--5 { background-image: url(/assets/images/slider/slide-5.jpg); }
.hero-slide--6 { background-image: url(/assets/images/slider/slide-6.jpg); }

/* webp вдвое легче, но фон нельзя отдать через <picture> — только image-set.
   Браузеры без его поддержки просто остаются на jpg выше. */
@supports (background-image: image-set(url("x.webp") type("image/webp"))) {
    .hero-slide--1 { background-image: image-set(url(/assets/images/slider/slide-1.webp) type("image/webp"), url(/assets/images/slider/slide-1.jpg) type("image/jpeg")); }
    .hero-slide--2 { background-image: image-set(url(/assets/images/slider/slide-2.webp) type("image/webp"), url(/assets/images/slider/slide-2.jpg) type("image/jpeg")); }
    .hero-slide--3 { background-image: image-set(url(/assets/images/slider/slide-3.webp) type("image/webp"), url(/assets/images/slider/slide-3.jpg) type("image/jpeg")); }
    .hero-slide--4 { background-image: image-set(url(/assets/images/slider/slide-4.webp) type("image/webp"), url(/assets/images/slider/slide-4.jpg) type("image/jpeg")); }
    .hero-slide--5 { background-image: image-set(url(/assets/images/slider/slide-5.webp) type("image/webp"), url(/assets/images/slider/slide-5.jpg) type("image/jpeg")); }
    .hero-slide--6 { background-image: image-set(url(/assets/images/slider/slide-6.webp) type("image/webp"), url(/assets/images/slider/slide-6.jpg) type("image/jpeg")); }
}

/* Buttons */
.btn { display: inline-block; padding: 10px 25px; border: none; border-radius: 4px; cursor: pointer; font-size: 0.95em; text-align: center; }
.btn-primary { background: var(--color-primary); color: var(--color-text); font-weight: bold; }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-outline { border: 2px solid var(--color-primary); color: var(--color-text); font-weight: bold; }
.btn-outline:hover { background: var(--color-primary); }

/* Плитки разделов на главной */
.home-categories { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 20px; margin: 40px 0; }
.home-categories:empty { display: none; }
.home-tile { display: block; border: 1px solid #eee; border-radius: 8px; overflow: hidden; color: var(--color-text); text-align: center; transition: box-shadow .2s, border-color .2s; }
.home-tile:hover { border-color: var(--color-primary); box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.home-tile__image { display: block; height: 150px; background: var(--color-light); }
.home-tile__image img { width: 100%; height: 100%; object-fit: contain; }
.home-tile__title { display: block; padding: 14px 10px; font-weight: bold; }

/* Витрина «Наши предложения» */
.home-offers { margin: 50px 0; }
.home-offers__head { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.home-offers__head h2 { margin: 0; }

/* Блок «О компании» на главной */
.home-about { margin: 50px 0; }
.home-about p { max-width: 80ch; margin: 10px 0; color: #444; }
.home-about .btn { margin-top: 15px; }

/* Карточка категории (каталог и страницы разделов) */
.category-card { display: block; padding: 20px; border: 2px solid var(--color-primary); border-radius: 8px; text-align: center; color: var(--color-text); }
.category-card:hover { background: var(--color-light); }

/* Advantages */
.home-advantages { margin: 40px 0; }
.advantages-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-top: 20px; }
.advantage-item { padding: 20px; border: 1px solid #eee; border-radius: 8px; }
.advantage-item:hover { border-color: var(--color-primary); }

/* CTA / Form */
.home-cta { background: var(--color-light); padding: 30px; border-radius: 8px; margin: 40px 0; text-align: center; }
.contact-form-wrapper { max-width: 500px; margin: 0 auto; text-align: left; }
.contact-form input, .contact-form textarea { width: 100%; padding: 10px; margin: 8px 0; border: 1px solid #ccc; border-radius: 4px; font-size: 0.95em; }
.contact-form button { width: 100%; }
.checkbox-label { display: flex; align-items: center; font-size: 0.85em; margin: 8px 0; }
.checkbox-label input { width: auto; margin-right: 8px; }
.form-error { display: block; color: #c62828; font-size: 0.8em; }
.form-error:empty { display: none; }
.form-error--common { margin-bottom: 10px; font-size: 0.95em; }
.form-success { padding: 12px 15px; border-radius: 4px; background: #e8f5e9; color: #1b5e20; margin-bottom: 15px; }
.form-success:empty { display: none; }
/* Ловушка для ботов: должна быть невидимой, но не display:none — часть
   ботов такие поля пропускает. */
.form-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* Breadcrumbs */
.breadcrumbs ul { list-style: none; display: flex; flex-wrap: wrap; gap: 5px; font-size: 0.85em; margin: 15px 0; }
.breadcrumbs li:after { content: " / "; }
.breadcrumbs li:last-child:after { content: ""; }

/* Categories list (каталог и страницы категорий) */
.category-intro { color: #555; max-width: 70ch; margin: 10px 0 20px; }
.categories-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; margin: 20px 0; }
.categories-list:empty { display: none; }
.categories-list .category-card { padding: 0; overflow: hidden; text-align: left; }
.category-card-image { width: 100%; height: 170px; overflow: hidden; background: var(--color-light); }
.category-card-image img { width: 100%; height: 100%; object-fit: contain; }
.category-card-info { padding: 15px; }
.category-card-info p { font-size: 0.85em; color: #666; margin-top: 5px; }

/* Services list */
.services-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 15px; margin: 20px 0; }
.services-list li { border: 1px solid #eee; border-radius: 8px; }
.services-list li:hover { border-color: var(--color-primary); }
.services-list a { display: block; padding: 18px; color: var(--color-text); }

/* Products grid */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin: 20px 0; }
.product-card { border: 1px solid #eee; border-radius: 8px; overflow: hidden; transition: box-shadow 0.2s; }
.product-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.product-card-link { display: block; color: var(--color-text); }
.product-card-image { width: 100%; height: 200px; overflow: hidden; background: var(--color-light); }
.product-card-image img { width: 100%; height: 100%; object-fit: contain; }
.product-card-info { padding: 15px; }
.product-card-price { font-size: 1.2em; font-weight: bold; color: var(--color-primary-dark); margin: 5px 0; }
.product-card-availability { font-size: 0.85em; }

/* Product page */
.product-page { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin: 20px 0; }
.product-gallery { text-align: center; }
.product-image img { max-width: 100%; border-radius: 8px; }
.product-info h1 { font-size: 1.5em; }
.product-price-block { display: flex; align-items: center; gap: 15px; margin: 15px 0; padding: 15px; background: var(--color-light); border-radius: 8px; }
.product-price-block .price { font-size: 1.5em; font-weight: bold; }
.availability { padding: 4px 10px; border-radius: 4px; font-size: 0.85em; }
.availability.available { background: #4caf50; color: #fff; }
.availability.order { background: #ff9800; color: #fff; }
.availability.pending { background: #999; color: #fff; }
.product-specs { margin: 20px 0; }
.spec-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #eee; }
.spec-name { color: #666; }
.spec-value { font-weight: 500; }
.product-actions { margin: 20px 0; }
.product-description { margin: 30px 0; line-height: 1.6; }

/* Footer */
.site-footer { background: var(--color-footer); color: #fff; padding: 30px 0; margin-top: 40px; }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; }
.footer-col h4 { color: var(--color-primary); margin-bottom: 10px; }
.footer-col a { color: #ccc; display: block; margin: 5px 0; font-size: 0.85em; }
.footer-bottom { border-top: 1px solid #555; padding-top: 15px; margin-top: 20px; text-align: center; font-size: 0.8em; color: #999; }

/* Error 404 */
.error-404 { text-align: center; padding: 40px 0; }
.error-404 h1 { font-size: 4em; color: var(--color-primary); }

/* Responsive */
@media (max-width: 1024px) {
    .hero-slider__viewport { height: 460px; }
    .hero-slide__title { font-size: 2em; }
}
@media (max-width: 768px) {
    .product-page { grid-template-columns: 1fr; }
    .header-nav ul { flex-wrap: wrap; }
    .header-main .container { flex-direction: column; gap: 10px; }
    .header-top .container { flex-direction: column; gap: 5px; }
    .hero-slider__viewport { height: auto; min-height: 420px; }
    .hero-slide { position: relative; inset: auto; display: none; padding: 40px 0; }
    .hero-slide.is-active { display: flex; }
    .hero-slide__box { padding: 25px 20px; border-width: 1px; }
    .hero-slide__title { font-size: 1.5em; }
    .hero-slider__nav { right: 15px; bottom: 15px; }
    .hero-slider__dots { bottom: 12px; }
    .home-offers__head { flex-direction: column; align-items: flex-start; }
}

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 5px; margin: 20px 0; list-style: none; }
.pagination a, .pagination span { padding: 5px 10px; border: 1px solid #ddd; border-radius: 4px; }
.pagination .active { background: var(--color-primary); border-color: var(--color-primary); }
