/**
 * Caserf Yii integration overrides.
 * Not produced by www/markup npm build — edit here only.
 * Copied to www/caserf/css/integration.css by scripts/copy-to-caserf-assets.mjs
 */

/* Phone/email: solid color, no gradient bleed from third-party widgets or footer glow */
#footer__phone,
#footer__email,
.contact__phone,
.contact__email,
.hero-home__contact-link {
  background: none !important;
  background-image: none !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
  text-shadow: none !important;
}

#footer__phone,
#footer__email {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

.contact__phone,
.contact__email,
.hero-home__contact-link {
  color: #40403f !important;
  -webkit-text-fill-color: #40403f !important;
}

#footer__gradient {
  display: none !important;
}

#footer__bottom {
  position: relative;
  z-index: 20;
}

#contact {
  position: relative;
  z-index: 5;
  background-color: #f4f4f3;
}

/* Catalog filters aside: scroll when content overflows, hide scrollbar */
#aside-filters__content {
  min-height: 0;
  overflow-y: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  padding-inline: 4px;
}

#aside-filters__content::-webkit-scrollbar {
  display: none;
}

#aside-filters .filter-range-slider.noUi-target {
  background: #E5E5E2 !important;
}

#aside-filters .filter-range-slider .noUi-base,
#aside-filters .filter-range-slider .noUi-connects {
  border-radius: 999px;
}

/* Aside: reset — серый фон, без hover-эффектов */
#aside-filters__footer .btn-catalog-filters-reset {
  background-color: #ececea !important;
  color: #40403f !important;
  border: none;
  box-shadow: none;
}

#aside-filters__footer .btn-catalog-filters-reset:hover,
#aside-filters__footer .btn-catalog-filters-reset:focus,
#aside-filters__footer .btn-catalog-filters-reset:active {
  background-color: #ececea !important;
  color: #40403f !important;
  border: none;
  box-shadow: none;
}

/* Плавающий островок: категории */
#header__filters .header__filter-chip {
  background-color: #fff;
  color: #40403f;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

#header__filters .header__filter-chip:hover {
  background-color: #40403f;
  color: #fff;
}

#header__filters .header__filter-chip--active,
#header__filters .header__filter-chip--active:hover {
  background-color: #8cc63d;
  color: #fff;
}

#header__filters .header__filter-chip--active .property-icon.icon-close {
  display: inline-flex;
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  background-color: #fff;
}

/* Каталог: пустая выдача после фильтрации (#products — grid, блок на всю ширину) */
#products .catalog-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 280px;
  padding: 3rem 1.5rem;
  text-align: center;
}

#products .catalog-empty__title {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: #40403f;
}

#products .catalog-empty__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 0 1.5rem;
  max-width: 24rem;
}

#products .catalog-empty__line {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #adadad;
}

#products .catalog-empty__line + .catalog-empty__line {
  margin-top: 0.25rem;
}

#products .catalog-empty__reset {
  display: inline-flex;
  min-width: 14rem;
  text-decoration: none;
  background-color: #40403f;
  color: #fff;
  box-shadow: 2px 2px 12px rgba(69, 73, 67, 0.15);
}

#products .catalog-empty__reset:hover {
  background-color: #262626;
  color: #fff;
}

#contact-map {
  width: 100%;
  min-height: 300px;
}

.contact__map-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 300px;
  background: #e8e8e8;
  color: #40403f;
  font-size: 1rem;
  text-decoration: none;
}

.contact__map-fallback:hover {
  background: #dedede;
}

#hero-home .hero-home__contacts {
  position: relative;
  z-index: 2;
}

/* Built styles.css may reference hashed icon URLs; ensure icons resolve from /caserf/ */
.property-icon.icon-wheel {
  -webkit-mask-image: url("../icon-wheel.svg");
  mask-image: url("../icon-wheel.svg");
}

.property-icon.icon-hand {
  -webkit-mask-image: url("../icon-hand.svg");
  mask-image: url("../icon-hand.svg");
}

.property-icon.icon-dimensions-inner {
  -webkit-mask-image: url("../icon-dimensions-inner.svg");
  mask-image: url("../icon-dimensions-inner.svg");
}

.property-icon.icon-dimensions-outer {
  -webkit-mask-image: url("../icon-dimensions-outer.svg");
  mask-image: url("../icon-dimensions-outer.svg");
}

.property-icon.icon-water-resistance {
  -webkit-mask-image: url("../icon-water-resistance.svg");
  mask-image: url("../icon-water-resistance.svg");
}

.property-icon.icon-weight {
  -webkit-mask-image: url("../icon-weight.svg");
  mask-image: url("../icon-weight.svg");
}

.property-icon.icon-filter {
  -webkit-mask-image: url("../icon-filter.svg");
  mask-image: url("../icon-filter.svg");
}

.property-icon.icon-sort {
  -webkit-mask-image: url("../icon-sort.svg");
  mask-image: url("../icon-sort.svg");
}

.property-icon.icon-download {
  -webkit-mask-image: url("../icon-download.svg");
  mask-image: url("../icon-download.svg");
}

.property-icon.icon-close {
  -webkit-mask-image: url("../icon-close.svg");
  mask-image: url("../icon-close.svg");
}

.input-search {
  background-image: url("../icon-search.svg");
}

/* Плавающая кнопка внутри #main: sticky, у футера не перекрывает подвал */
#sticky-buttons {
  position: sticky;
  bottom: 1rem;
  z-index: 100;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  pointer-events: none;
}

#sticky-buttons #request-a-quote {
  margin-left: auto;
  pointer-events: auto;
}

/* Non-home pages: solid header (logo + dark nav links), no scroll toggle */
body[data-page]:not([data-page="home"]) #header #header__left {
  visibility: visible;
}

body[data-page]:not([data-page="home"]) #header #header__nav a:not(.text-highlight) {
  color: #40403f;
}

#accessories-list .product,
#related-products .product {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-radius: 0.5rem;
  background-color: #fafafa;
  padding: 0.75rem;
  text-decoration: none;
  color: inherit;
}

#accessories-list .product:hover,
#related-products .product:hover {
  background-color: #fff;
}

/* Calculator («Подобрать по размеру») */
body.calculator-pending {
  overflow: hidden;
  height: 100vh;
}

body[data-page="calculator"] #header__nav a.text-highlight {
  color: var(--brand-green, #b4e600);
}

.calculator-skeletons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 1rem;
}

@media (min-width: 768px) {
  .calculator-skeletons {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
  }
}

.calculator-skeleton {
  min-height: 220px;
  border-radius: 0.5rem;
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: calculator-skeleton-shimmer 1.2s ease-in-out infinite;
}

@keyframes calculator-skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

#calculator-products.hidden {
  display: none;
}

#calculator-skeletons.hidden {
  display: none;
}

/* Catalog listing */
body[data-page="catalog"] #products.is-loading-more {
  opacity: 0.85;
  pointer-events: none;
}

body[data-page="catalog"] #header__filters a.btn-small {
  text-decoration: none;
}

/* Catalog: mobile — floating «Фильтры»; desktop — header island with chips */
body[data-page="catalog"] #catalog-sticky-filters {
  display: flex;
}

body[data-page="catalog"] #header__filters.header__filters-bar {
  display: none;
}

@media (min-width: 768px) {
  body[data-page="catalog"] #catalog-sticky-filters {
    display: none !important;
  }

  body[data-page="catalog"] #header__filters.header__filters-bar {
    display: flex !important;
  }
}

@media (max-width: 767px) {
  body[data-page="catalog"] #header__filters.header__filters-bar {
    display: none !important;
  }
}

/* Single sticky «Оставить заявку» from layout — avoid overlap with catalog filters bar */
body[data-page="catalog"] #sticky-buttons {
  justify-content: flex-end;
}

/* News listing — grid instead of home carousel */
body[data-page="news"] .posts-container {
  margin-right: 0;
  width: 100%;
  overflow-x: visible;
}

body[data-page="news"] .posts-container.is-loading-more {
  opacity: 0.85;
  pointer-events: none;
}

body[data-page="news"] .posts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  gap: 1rem;
}

@media (min-width: 768px) {
  body[data-page="news"] .posts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  body[data-page="news"] .posts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

body[data-page="news"] .post {
  width: auto;
  max-width: none;
}

/* Error page (404 / 5xx) */
body[data-page="error"] #main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: calc(100vh - 120px);
}

body[data-page="error"] .error-page {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem 5rem;
}

body[data-page="error"] .error-page__inner {
  display: flex;
  max-width: 28rem;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

body[data-page="error"] .error-page__code {
  margin: 0 0 1rem;
  font-size: clamp(5rem, 18vw, 8rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
  color: #adadad;
  user-select: none;
}

body[data-page="error"] .error-page__title {
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.25;
  color: #40403f;
}

@media (min-width: 768px) {
  body[data-page="error"] .error-page__title {
    font-size: 1.75rem;
  }
}

body[data-page="error"] .error-page__text {
  margin: 0 0 2rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #adadad;
}

body[data-page="error"] .error-page__actions {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 480px) {
  body[data-page="error"] .error-page__actions {
    flex-direction: row;
    justify-content: center;
  }

  body[data-page="error"] .error-page__actions .btn-large {
    min-width: 10rem;
  }
}

/* News article: CMS images without .post__image class */
#main.post .post__content img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  object-fit: cover;
  aspect-ratio: 698 / 491;
}

/* Contacts page (site/contact) */
#main.post .contact-page__content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

#main.post .contact-page__company {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #40403f;
}

#main.post .contact-page__address,
#main.post .contact-page__schedule {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  color: #40403f;
}

#main.post .contact-page__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#main.post .contact-page__text {
  font-size: 1rem;
  line-height: 1.6;
  color: #40403f;
}

#main.post .contact-page__text img {
  aspect-ratio: auto;
}

#main.post .contact-page__map {
  margin-top: 1rem;
  width: 100%;
  max-width: 100%;
}

#main.post .contact-page__map .contact__map-container {
  min-height: 360px;
  border-radius: 0.5rem;
  overflow: hidden;
}

/* Request form modal (Yii integration) */
.request-form__info.is-hidden,
.request-form__topic-row.is-hidden,
.request-form__product-row.is-hidden {
  display: none !important;
}

.request-form__file-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.request-form__file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  background: #f5f5f4;
}

.request-form__file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-form__file-remove {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: #8cc63d;
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
}

.request-form__form-error,
.request-form__success {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

.request-form__form-error {
  background: #fff4f4;
  color: #b42318;
}

.request-form__success {
  background: #f3faeb;
  color: #3f6212;
}

.request-form__form.hidden {
  display: none;
}

#request-form__submit.is-loading {
  opacity: 0.7;
  pointer-events: none;
}
