/* Адаптация AMP-вёрстки под обычный HTML/JS */

/* картинки в обёртках ведут себя как amp-img */
.img_wrap img, .item_img img, .about_img img, .product_image_sm img { display: block; width: 100%; height: auto; }
.logo .img img { display: block; width: 100px; height: auto; }

/* квадратные превью товаров — как amp-img 297x297 (одинаковая высота карточек) */
.product_item .item_img { aspect-ratio: 1 / 1; }
.product_item .item_img img { width: 100%; height: 100%; object-fit: cover; }
.pd_items .product_item .item_img, .product_items .product_item .item_img { aspect-ratio: 1 / 1; }

/* баннер-фейдер */
.main-banner { position: relative; }
.db-banner-carousel { position: relative; height: 477px; overflow: hidden; }
.db-banner-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .8s; display: block; }
.db-banner-slide.is-active { opacity: 1; visibility: visible; }
@media (max-width: 768px) { .db-banner-carousel { height: 360px; } }

/* горизонтальные карусели */
.db-carousel { display: flex !important; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 20px; }
.db-carousel::-webkit-scrollbar { display: none; }
.db-carousel > li { flex: 0 0 calc(25% - 15px); scroll-snap-align: start; }
@media (max-width: 1365px) { .db-carousel > li { flex-basis: calc(33.33% - 14px); } }
@media (max-width: 767px) { .db-carousel > li { flex-basis: calc(50% - 10px); } }
@media (max-width: 479px) { .db-carousel > li { flex-basis: 90%; } }

/* галерея товара */
.db-gallery-main { position: relative; height: 550px; }
.db-gallery-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .4s; }
.db-gallery-slide.is-active { opacity: 1; visibility: visible; }
.db-gallery-slide img { width: 100%; height: 100%; object-fit: contain; }
.db-gallery-thumbs { display: flex; gap: 10px; overflow-x: auto; }
.db-gallery-thumbs .product_image_sm { flex: 0 0 31%; cursor: pointer; border: 1px solid #e0e1e5; }
.db-gallery-thumbs .product_image_sm.is-active { border-color: #ff6f00; }
@media (max-width: 768px) { .db-gallery-main { height: 360px; } }

/* поиск-лайтбокс */
.db-search-lightbox { position: fixed; inset: 0; z-index: 9999; background: rgba(20, 24, 28, .92); display: flex; align-items: flex-start; justify-content: center; padding-top: 18vh; }
.db-search-lightbox[hidden] { display: none; }
.db-search-inner { position: relative; width: min(640px, 90%); }
.db-search-inner form { display: flex; background: #fff; border-radius: 6px; overflow: hidden; }
.db-search-inner input[type="search"] { flex: 1; border: 0; padding: 16px 20px; font-size: 18px; outline: none; }
.db-search-inner button[type="submit"] { border: 0; background: #ff6f00; color: #fff; padding: 0 24px; cursor: pointer; }
.db-search-close { position: absolute; top: -56px; right: 0; background: none; border: 0; color: #fff; font-size: 42px; cursor: pointer; line-height: 1; }

/* мобильное меню */
.db-mob-nav { position: fixed; top: 0; left: 0; bottom: 0; width: 280px; max-width: 80vw; background: #1b2227; z-index: 9999; overflow-y: auto; padding: 24px 0; transform: none; }
.db-mob-nav[hidden] { display: none; }
.db-mob-nav li { display: block; }
.db-mob-nav li a { display: block; color: #fff; padding: 10px 22px; font-size: 16px; }
.db-mob-nav li ul { padding-left: 14px; }
.db-mob-nav li ul li a { font-size: 14px; opacity: .85; }
.db-mob-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 9998; }
.db-mob-overlay[hidden] { display: none; }

/* кнопка Top */
.scrollToTop { opacity: 0; visibility: hidden; transition: opacity .3s; }
.scrollToTop.is-visible { opacity: 1; visibility: visible; }

/* пагинация WP */
.pages .page-numbers { position: relative; display: inline-block; vertical-align: top; border: 1px solid #cfcfcf; line-height: 32px; min-width: 26px; padding: 0 12px; margin: 0 0 0 5px; border-radius: 3px; font-size: 16px; background: linear-gradient(#fefefe, #ececec); }
.pages .page-numbers.current, .pages a.page-numbers:hover { background: #1a2126; color: #fff; border-color: #1a2126; }

/* CF7 в стиле исходной формы */
.form_wrap .wpcf7 label { display: block; margin: 0 0 18px; }
.form_wrap .wpcf7 input[type="text"], .form_wrap .wpcf7 input[type="email"], .form_wrap .wpcf7 input[type="tel"], .form_wrap .wpcf7 textarea { width: 100%; border: 1px solid #e0e1e5; padding: 12px 14px; font-size: 14px; }
.form_wrap .wpcf7 textarea { min-height: 140px; }
.form_wrap .wpcf7 input[type="submit"] { display: block; width: 100%; height: auto; line-height: normal; border: 0; border-left: 0; background: #ff6f00; color: #fff; padding: 16px 46px; font-size: 16px; cursor: pointer; text-transform: uppercase; text-align: center; }
.form_wrap .wpcf7 input[type="submit"]:hover { background: #1b2227; color: #fff; }

/* контент rich-text */
.rich-text img { max-width: 100%; height: auto; }
.rich-text table { max-width: 100%; border-collapse: collapse; }
.rich-text td { border: 1px solid #e0e1e5; padding: 4px 8px; }
.page_info .text img, article.text img { max-width: 100%; height: auto; }

/* хедер: ссылка логотипа */
.logo a { color: inherit; text-decoration: none; }
.logo a:hover { color: inherit; }
