:root {
    --color-bg: #0b0b0c;
    --color-bg-soft: #15161a;
    --color-bg-alt: #f7f7f5;
    --color-accent: #c8a25a;
    --color-accent-dark: #a4813f;
    --color-text: #1a1a1a;
    --color-text-light: #6b6b6b;
    --color-text-on-dark: #e9e7e1;
    --color-border: #e4e2dd;
    --font-main: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    --font-sans: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { overflow-x: hidden; }
body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: #fff;
    line-height: 1.5;
    overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.section { padding-top: 48px; padding-bottom: 48px; }
.section-title { font-family: var(--font-main); font-weight: 700; font-size: 30px; margin-bottom: 24px; text-transform: uppercase; letter-spacing: 1px; }
.page-title { font-family: var(--font-main); font-weight: 700; font-size: 32px; margin: 24px 0; }

/* Header */
.site-header { background: var(--color-bg); color: var(--color-text-on-dark); position: sticky; top: 0; z-index: 100; border-bottom: 1px solid rgba(200,162,90,.2); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 80px; gap: 12px; }
.logo { flex-shrink: 0; font-family: var(--font-main); font-weight: 700; font-size: 24px; letter-spacing: 2px; color: #fff; white-space: nowrap; }
.logo span { color: var(--color-accent); font-weight: 700; }

.main-nav > ul { display: flex; gap: 30px; list-style: none; margin: 0; padding: 0; }
.main-nav > ul > li { position: relative; padding: 30px 0; }
.main-nav > ul > li > a { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; font-weight: 500; color: var(--color-text-on-dark); transition: color .2s; }
.main-nav > ul > li > a:hover { color: var(--color-accent); }
/* Стрелка у пунктов меню с вложенными: вниз — в верхнем уровне, вправо — в выпадающем списке */
.main-nav > ul > li.has-children-1 > a::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-3px) rotate(45deg); transition: transform .2s; }
.main-nav > ul > li.has-children-1:hover > a::after { transform: translateY(0) rotate(225deg); }
.main-nav .sub-menu li.has-children-1 > a { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.main-nav .sub-menu li.has-children-1 > a::after { content: ""; flex-shrink: 0; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-top: 1.5px solid currentColor; transform: rotate(45deg); }
.main-nav .sub-menu { display: none; position: absolute; top: 100%; left: 0; background: #fff; color: var(--color-text); min-width: 240px; box-shadow: 0 12px 24px rgba(0,0,0,.15); padding: 8px 0; list-style: none; margin: 0; }
.main-nav .sub-menu li { position: relative; }
.main-nav .sub-menu a { display: block; padding: 10px 20px; font-size: 13px; white-space: nowrap; }
.main-nav .sub-menu a:hover { background: var(--color-bg-alt); color: var(--color-accent-dark); }
.main-nav .sub-menu-lvl2 { position: absolute; left: 100%; top: 0; }
.main-nav li:hover > .sub-menu { display: block; }

.cart-link { color: var(--color-text-on-dark); font-size: 13px; text-transform: uppercase; letter-spacing: .5px; display: flex; align-items: center; gap: 8px; }
.cart-count { background: var(--color-accent); color: #1a1a1a; font-weight: 700; border-radius: 999px; padding: 2px 9px; font-size: 12px; }

/* Hero */
.hero-slider { position: relative; background: var(--color-bg); color: #fff; min-height: 520px; }
.hero-slide { min-height: 520px; background-size: cover; background-position: center; display: flex; align-items: center; }
.hero-slide::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.75) 0%, rgba(0,0,0,.35) 55%, rgba(0,0,0,.05) 100%); }
.hero-slide--placeholder { background: linear-gradient(135deg, #0b0b0c, #26221a); }
.hero-content { position: relative; max-width: 640px; z-index: 1; }
.hero-content h1 { font-family: var(--font-main); font-weight: 700; font-size: 46px; margin-bottom: 16px; }
.hero-content p { font-size: 18px; margin-bottom: 24px; color: #ddd; }
.hero-slides { position: relative; }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .6s; }
.hero-slide.is-active { position: relative; opacity: 1; }
.hero-dots { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 2; }
.hero-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.4); border: none; cursor: pointer; }
.hero-dot.is-active { background: var(--color-accent); }
.hero-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35); background: rgba(0,0,0,.35); color: #fff; display: flex; align-items: center; justify-content: center; padding: 0; line-height: 0; cursor: pointer; transition: background .2s, border-color .2s, color .2s; }
.hero-arrow svg { display: block; flex-shrink: 0; }
.hero-arrow:hover { background: var(--color-accent); border-color: var(--color-accent); }
.hero-arrow--prev { left: 24px; }
.hero-arrow--next { right: 24px; }

.btn { display: inline-block; background: var(--color-accent); color: #1a1a1a; font-weight: 600; padding: 13px 30px; border: none; text-transform: uppercase; letter-spacing: 1px; font-size: 13px; cursor: pointer; }
.btn:hover { background: var(--color-accent-dark); color: #fff; }
.btn--small { padding: 8px 16px; font-size: 12px; }
.btn--outline { background: transparent; border: 1px solid var(--color-text); color: var(--color-text); }
.btn--block { width: 100%; text-align: center; }
.btn[disabled] { background: #ccc; cursor: not-allowed; }
.link-btn { background: none; border: none; color: var(--color-text-light); cursor: pointer; text-decoration: underline; font-size: 13px; }

/* Categories / products */
.catalog-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.catalog-card { position: relative; display: flex; align-items: flex-end; aspect-ratio: 4 / 3; overflow: hidden; background: #1a1a1a; color: #fff; }
.catalog-card__image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.catalog-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.8) 0%, rgba(0,0,0,.25) 50%, rgba(0,0,0,.05) 100%); transition: background .3s; }
.catalog-card__body { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding: 24px; width: 100%; }
.catalog-card__btn { display: none; }
.catalog-dots { display: none; }
.catalog-card__title { font-family: var(--font-main); font-weight: 700; font-size: 26px; letter-spacing: .5px; text-transform: uppercase; }
.catalog-card__title::after { content: ""; display: block; width: 40px; height: 3px; margin-top: 10px; background: var(--color-accent); transition: width .3s; }
.catalog-card:hover .catalog-card__image { transform: scale(1.06); }
.catalog-card:hover .catalog-card__title::after { width: 80px; }
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.category-card { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; border: 1px solid var(--color-border); padding: 20px; transition: box-shadow .2s, border-color .2s; }
.category-card:hover { box-shadow: 0 12px 26px rgba(0,0,0,.1); border-color: var(--color-accent); }
.category-card img { height: 120px; object-fit: contain; }
.category-card span { font-family: var(--font-main); font-weight: 700; letter-spacing: .3px; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; }
.product-card { border: 1px solid var(--color-border); display: flex; flex-direction: column; transition: box-shadow .2s, border-color .2s; }
.product-card:hover { box-shadow: 0 12px 26px rgba(0,0,0,.08); border-color: var(--color-accent); }
.product-card__image img { height: 220px; width: 100%; object-fit: cover; }
.product-card__body { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.product-card__title { font-weight: 600; }
.product-card__price { color: var(--color-accent-dark); font-weight: 700; font-family: var(--font-main); font-size: 17px; }

.subcategory-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.subcategory-pill { border: 1px solid var(--color-border); padding: 8px 16px; border-radius: 999px; font-size: 13px; }
.subcategory-pill:hover { background: var(--color-bg-alt); }

.breadcrumbs { font-size: 13px; color: var(--color-text-light); margin: 20px 0; }
.pagination { display: flex; gap: 8px; margin-top: 32px; }
.page-link { border: 1px solid var(--color-border); padding: 8px 14px; }
.page-link.is-active { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }

/* Product page */
.product-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin: 24px 0; }
.product-gallery__main { position: relative; }
.product-gallery__main img { width: 100%; cursor: zoom-in; touch-action: pan-y; }
.product-gallery__thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.product-gallery__thumbs img { width: 72px; height: 72px; object-fit: cover; border: 1px solid var(--color-border); cursor: pointer; opacity: .65; transition: opacity .15s, border-color .15s; }
.product-gallery__thumbs img:hover { opacity: 1; }
.product-gallery__thumbs img.is-active { opacity: 1; border-color: var(--color-accent); }

.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: none; border-radius: 50%; background: rgba(255,255,255,.85); font-size: 16px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 2; }
.gallery-nav:hover { background: #fff; }
.gallery-nav--prev { left: 12px; }
.gallery-nav--next { right: 12px; }

.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 300; display: flex; align-items: center; justify-content: center; touch-action: pan-y; }
.lightbox[hidden] { display: none; }
.lightbox__image { max-width: 90vw; max-height: 85vh; object-fit: contain; user-select: none; }
.lightbox__close { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border: none; border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
.lightbox__close:hover { background: rgba(255,255,255,.3); }
.lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border: none; border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lightbox__nav:hover { background: rgba(255,255,255,.3); }
.lightbox__nav--prev { left: 16px; }
.lightbox__nav--next { right: 16px; }
.lightbox__counter { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 13px; background: rgba(255,255,255,.15); padding: 4px 14px; border-radius: 999px; }
body.lightbox-open { overflow: hidden; }
@media (max-width: 600px) {
    .lightbox__nav { width: 40px; height: 40px; font-size: 16px; }
}

.product-info h1 { font-family: var(--font-main); font-size: 30px; }
.product-price { font-size: 26px; color: var(--color-accent-dark); font-weight: 700; margin: 16px 0; }
.add-to-cart-form { display: flex; align-items: end; gap: 16px; margin-top: 20px; }
.add-to-cart-form input[type=number] { width: 70px; padding: 8px; }
.product-description, .product-specs { margin-top: 40px; }
.rich-content p { margin: 0 0 16px; }
.rich-content img { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.product-specs table { border-collapse: collapse; width: 100%; }
.product-specs th, .product-specs td { border: 1px solid var(--color-border); padding: 8px 12px; text-align: left; }

/* Cart / checkout */
.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; }
.cart-table th, .cart-table td { border-bottom: 1px solid var(--color-border); padding: 12px; text-align: left; }
.cart-table__product { display: flex; align-items: center; gap: 12px; }
.cart-table__product img { width: 60px; height: 60px; object-fit: cover; }
.cart-summary { display: flex; justify-content: flex-end; align-items: center; gap: 20px; }
.cart-summary__total { font-size: 20px; }

.checkout-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; }
.checkout-form fieldset { border: 1px solid var(--color-border); margin-bottom: 24px; padding: 20px; }
.checkout-form legend { font-weight: 700; padding: 0 8px; }
.checkout-form label { display: block; margin-bottom: 14px; font-size: 14px; }
.checkout-form input, .checkout-form textarea { width: 100%; padding: 10px; border: 1px solid var(--color-border); margin-top: 4px; }
.checkout-summary { border: 1px solid var(--color-border); padding: 20px; height: fit-content; }
.checkout-summary__list { list-style: none; padding: 0; margin: 0 0 16px; }
.checkout-summary__list li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--color-border); font-size: 14px; }
.checkout-summary__total { font-size: 18px; margin-bottom: 16px; }

.alert { padding: 14px 18px; margin-bottom: 20px; }
.alert--error { background: #fdecea; color: #b3261e; border: 1px solid #f5c2c0; }
.empty-state { text-align: center; padding: 60px 0; }

/* Footer */
.site-footer { background: var(--color-bg); color: #ccc; margin-top: 60px; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding: 48px 20px; }
.footer-col h4 { color: #fff; margin-bottom: 16px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a:hover { color: var(--color-accent); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 16px 20px; font-size: 12px; }

/* Мобильное меню */
.header-actions { display: flex; align-items: center; gap: 20px; }
.hamburger { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 32px; height: 32px; background: none; border: none; cursor: pointer; padding: 0; }
.hamburger span { display: block; width: 100%; height: 2px; background: #fff; }

.mobile-nav-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); opacity: 0; visibility: hidden; transition: opacity .25s; z-index: 200; }
.mobile-nav-backdrop.is-open { opacity: 1; visibility: visible; }

.mobile-nav { position: fixed; top: 0; right: 0; bottom: 0; width: 320px; max-width: 88vw; background: var(--color-bg); color: var(--color-text-on-dark); z-index: 201; transform: translateX(100%); transition: transform .3s; overflow-y: auto; overflow-x: hidden; }
.mobile-nav.is-open { transform: translateX(0); }
.mobile-nav-head { display: flex; align-items: center; justify-content: space-between; padding: 20px; border-bottom: 1px solid rgba(200,162,90,.2); }
.mobile-nav-close { background: none; border: none; color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }
.mobile-nav-list { list-style: none; margin: 0; padding: 8px 0; }
.mobile-nav-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; }
.mobile-nav-row a { flex: 1; font-size: 15px; min-width: 0; overflow-wrap: break-word; }
.mobile-nav-toggle { background: none; border: none; color: var(--color-accent); font-size: 11px; padding: 8px; cursor: pointer; transition: transform .2s; }
.mobile-nav-item.is-expanded > .mobile-nav-row .mobile-nav-toggle { transform: rotate(180deg); }
.mobile-nav-children { list-style: none; margin: 0; padding: 0; max-height: 0; overflow: hidden; background: rgba(255,255,255,.03); }
.mobile-nav-item.is-expanded > .mobile-nav-children { max-height: 2000px; }
.mobile-nav-children .mobile-nav-row { padding-left: 36px; }
.mobile-nav-children .mobile-nav-children .mobile-nav-row { padding-left: 52px; }
body.nav-open { overflow: hidden; }

@media (max-width: 900px) {
    .main-nav { display: none; }
    .hamburger { display: flex; flex-shrink: 0; }
    .header-actions { gap: 14px; }
    .cart-label { display: none; }
    .cart-count { min-width: 20px; text-align: center; }
    .product-layout, .checkout-layout, .footer-inner { grid-template-columns: 1fr; }
    .product-grid, .category-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .hero-content h1 { font-size: 32px; }
    .hero-slider, .hero-slide { min-height: 380px; }
    .hero-arrow { width: 38px; height: 38px; }
    /* На мобильных карточки каталога — горизонтальный слайдер с прокруткой свайпом */
    .catalog-cards { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -20px; padding: 0 20px; scroll-padding: 0 20px; }
    .catalog-cards::-webkit-scrollbar { display: none; }
    .catalog-card { flex: 0 0 85%; aspect-ratio: 4 / 5; scroll-snap-align: start; }
    .catalog-card__body { padding: 20px; }
    .catalog-card__title { font-size: 22px; }
    .catalog-card__btn { display: block; width: 100%; text-align: center; }
    .catalog-dots { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
    .catalog-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--color-border); border: none; padding: 0; cursor: pointer; }
    .catalog-dot.is-active { background: var(--color-accent); }
    .hero-arrow--prev { left: 10px; }
    .hero-arrow--next { right: 10px; }
}

@media (max-width: 480px) {
    .product-grid, .category-grid { grid-template-columns: 1fr; }
    .header-inner { height: 64px; }
    .logo { font-size: 18px; letter-spacing: 1px; }
    .section { padding-top: 32px; padding-bottom: 32px; }
}

/* Contacts page */
.contact-list { list-style: none; margin: 24px 0 0; padding: 0; max-width: 480px; display: flex; flex-direction: column; gap: 4px; }
.contact-list__item { display: flex; align-items: center; gap: 16px; padding: 16px 4px; border-bottom: 1px solid var(--color-border); }
.contact-list__icon { flex-shrink: 0; width: 40px; height: 40px; }
.contact-list__icon svg { width: 100%; height: 100%; color: var(--color-accent-dark); }
.contact-list__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.contact-list__label { font-size: 13px; color: var(--color-text-light); }
.contact-list__value { font-size: 16px; color: var(--color-text); word-break: break-word; }
a.contact-list__value:hover { color: var(--color-accent-dark); }

.footer-social { display: flex; gap: 10px; margin-top: 12px; }
.footer-social__icon { display: block; width: 30px; height: 30px; opacity: .85; transition: opacity .15s, transform .15s; }
.footer-social__icon svg { width: 100%; height: 100%; }
.footer-social__icon:hover { opacity: 1; transform: translateY(-2px); }

/* Static content pages (About PERI) */
.about-content { max-width: 780px; margin-top: 16px; }
.about-content p { margin: 0 0 16px; line-height: 1.7; }
.about-content h2 { font-family: var(--font-main); font-weight: 700; font-size: 22px; margin: 32px 0 12px; }
.about-list { margin: 0 0 16px; padding-left: 20px; line-height: 1.8; }
.about-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 8px 0 28px; }
.about-gallery img { width: 100%; height: 280px; object-fit: cover; }
.about-video { margin: 24px 0; background: #000; }
.about-video video { width: 100%; display: block; max-height: 640px; }
.about-video--hero { max-width: 780px; }
.about-videos { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 780px; margin: 32px 0; }
.about-videos .about-video { margin: 0; }

.home-about { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.home-about__text p { line-height: 1.7; margin: 0 0 20px; }
.home-about__video.about-video { margin: 0; }

@media (max-width: 900px) {
    .about-gallery, .about-videos { grid-template-columns: 1fr; }
    .about-gallery img { height: auto; }
    .home-about { grid-template-columns: 1fr; }
    .home-about__video { order: -1; }
}
