/*
 * Листинг товаров подкатегории межкомнатных дверей (/interior-doors/<slug>/).
 * Макет: data/inter_cat/index.html
 */

body.footer-interior-doors-category {
  background: #f3f8fe;
  --idc-page-max: var(--storefront-content-max, 1248px);
  --idc-side-gutter: clamp(14px, 6.7vw, 96px);
  --id-content-max: 1158px;
  --id-side-gutter: var(--idc-side-gutter);
  --id-scale: 1;
  /* Align footer with white surface (PVC-like shell) */
  --id-footer-w: min(var(--idc-page-max), calc(100% - 32px));
}

body.footer-interior-doors-category main {
  margin-bottom: 16px;
}

/* Outer gutter (like .pvc-latvia-guide) */
.idc-page {
  --idc-blue: #0a397f;
  --idc-blue-dark: #062963;
  --idc-blue-soft: #2c5aa2;
  --idc-line: #cad6eb;
  --idc-line-soft: #e5ebf5;
  --idc-text: #1e2f50;
  --idc-muted: #4a5d7e;
  --idc-bg: #fafbfe;
  --idc-white: #ffffff;
  --idc-shadow: 0 10px 22px rgba(10, 41, 99, 0.07);
  --idc-radius: 8px;
  --idc-container: 1158px;

  width: 100%;
  margin: 0;
  padding: 18px 0 36px;
  min-height: 0;
  overflow: visible;
  color: var(--idc-text);
  font-family: var(--font-sans);
  background: transparent;
  border: 0;
}

/* White substrate only — same idea as .pvc-guide__surface */
.idc-page__surface {
  overflow: hidden;
  width: min(var(--idc-page-max), calc(100% - 32px));
  margin-inline: auto;
  border: 1px solid rgba(116, 156, 204, 0.28);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(23, 73, 130, 0.08);
}

.idc-page *,
.idc-page *::before,
.idc-page *::after {
  box-sizing: border-box;
}

.idc-page img {
  display: block;
  max-width: 100%;
}

.idc-page a {
  color: inherit;
  text-decoration: none;
}

/* DRE subcategory listing: full-width image hero (no HTML title text) */
.idc-page--dre .idc-page__surface {
  background: #fff;
}

.idc-dre-hero {
  position: relative;
  width: 100%;
  margin: 0;
  line-height: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--idc-line-soft, #e5ebf5);
  background: #eef3fa;
}

.idc-dre-hero__image {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  object-position: center top;
}

picture.idc-dre-hero__image img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center top;
}

.idc-dre-hero__sr-title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.idc-page--dre .idc-catalog {
  padding-top: 28px;
}

/* Non-DRE custom listing hero (e.g. shpon) — desktop image; mobile unchanged */
.idc-listing-hero {
  position: relative;
  width: 100%;
  margin: 0;
  line-height: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--idc-line-soft, #e5ebf5);
  background: #eef3fa;
}

.idc-listing-hero__image {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  object-position: center top;
}

picture.idc-listing-hero__image img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center top;
}

/* Desktop: show image hero, hide classic title + blueprints */
.idc-listing-hero--desktop-only {
  display: block;
}

.idc-page--listing-hero .idc-section-head--mobile-only,
.idc-page--listing-hero .idc-blueprint-corner--mobile-only {
  display: none;
}

.idc-page--listing-hero .idc-catalog {
  padding-top: 28px;
}

@media (max-width: 767px) {
  /* Mobile: keep original text hero; hide custom image hero */
  .idc-listing-hero--desktop-only {
    display: none !important;
  }

  /* DRE listing Hero: 8px side inset, same canon as interior/DRE landings */
  .idc-dre-hero__image {
    width: calc(100% - 16px);
    margin-inline: 8px;
  }

  .idc-page--listing-hero .idc-section-head--mobile-only {
    display: block;
  }

  .idc-page--listing-hero .idc-blueprint-corner--mobile-only {
    display: block;
  }

  .idc-page--listing-hero .idc-catalog {
    padding-top: 38px;
  }
}

.idc-catalog {
  position: relative;
  width: 100%;
  padding: 38px var(--idc-side-gutter) 42px;
}

.idc-blueprint-corner {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  opacity: .92;
}

.idc-blueprint-corner--left {
  left: clamp(8px, 6.4vw, 92px);
  top: 20px;
  width: clamp(150px, 17.5vw, 255px);
}

.idc-blueprint-corner--right {
  right: clamp(8px, 4vw, 48px);
  top: 18px;
  width: clamp(150px, 17.8vw, 260px);
}

.idc-section-head {
  position: relative;
  z-index: 1;
  width: min(100%, var(--idc-container));
  margin: 0 auto 42px;
  text-align: center;
  padding-top: 2px;
}

.idc-section-title {
  margin: 0;
  color: var(--idc-blue-dark);
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 28px);
  line-height: .96;
  font-weight: 500;
  letter-spacing: -.035em;
}

.idc-section-subtitle {
  margin: 12px 0 0;
  color: var(--idc-blue);
  font-size: var(--text-2xl);
  line-height: 1.35;
  font-weight: 500;
}

.idc-title-line {
  width: 58px;
  height: 2px;
  margin: 26px auto 0;
  background: var(--idc-blue);
  border-radius: 999px;
}

/* Listing toolbar: product count + price sort */
.idc-toolbar {
  position: relative;
  z-index: 1;
  width: min(100%, var(--idc-container));
  margin: 0 auto 18px;
  padding: 0 4px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
}

.idc-page--dre .idc-toolbar {
  margin-top: 22px;
}

.idc-toolbar__count {
  margin: 0;
  color: var(--idc-muted);
  font-size: var(--text-md);
  line-height: 1.3;
  font-weight: 500;
}

.idc-sort {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 0;
  margin-left: auto;
}

.idc-sort__label {
  color: var(--idc-blue-dark);
  font-size: var(--text-md);
  font-weight: 600;
  white-space: nowrap;
}

.idc-sort__select {
  min-width: min(100%, 220px);
  height: 38px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--idc-line);
  border-radius: 8px;
  background-color: var(--idc-white);
  background-image: linear-gradient(45deg, transparent 50%, var(--idc-blue) 50%),
    linear-gradient(135deg, var(--idc-blue) 50%, transparent 50%);
  background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  color: var(--idc-text);
  font: inherit;
  font-size: var(--text-md);
  font-weight: 500;
  line-height: 1.2;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(10, 41, 99, 0.04);
}

.idc-sort__select:hover,
.idc-sort__select:focus {
  border-color: var(--idc-blue-soft);
  outline: none;
  box-shadow: 0 0 0 3px rgba(42, 90, 162, 0.12);
}

.idc-products-grid {
  position: relative;
  z-index: 1;
  width: min(100%, var(--idc-container));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 23px;
}

.idc-product-card {
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--idc-line);
  border-radius: var(--idc-radius);
  background: rgba(255, 255, 255, .88);
  box-shadow: var(--idc-shadow);
}

.idc-product-card__image {
  flex: 0 0 auto;
  height: 236px;
  border-bottom: 1px solid var(--idc-line);
  background: #eef2f8;
  overflow: hidden;
}

.idc-product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}

.idc-product-card__placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  color: var(--idc-muted);
  font-size: var(--text-caption);
  font-weight: 500;
  text-align: center;
  padding: 12px;
}

/*
 * Body fills remaining card height; price + button stay on the bottom row
 * whether the title is one or two lines (equal-height grid cells).
 */
.idc-product-card__body {
  flex: 1 1 auto;
  min-height: 84px;
  padding: 11px 16px 13px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(255, 255, 255, .86));
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto 1fr auto;
  column-gap: 10px;
  row-gap: 0;
  align-items: end;
}

.idc-product-card__name {
  grid-column: 1 / -1;
  grid-row: 1;
  margin: 0 0 4px;
  color: var(--idc-blue-dark);
  font-family: var(--font-sans);
  font-size: var(--text-xl);
  line-height: 1.05;
  font-weight: var(--fw-title);
  letter-spacing: -.015em;
}

.idc-product-card__price {
  grid-row: 4;
  align-self: end;
  margin-top: 10px;
  color: var(--idc-blue-dark);
  font-size: var(--text-2xl);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -.02em;
  white-space: nowrap;
}

.idc-product-card__button {
  grid-row: 4;
  align-self: end;
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  min-width: 88px;
  min-height: 28px;
  padding: 7px 13px 6px;
  border: 1px solid var(--idc-blue);
  border-radius: 3px;
  color: var(--idc-blue);
  background: rgba(255, 255, 255, .82);
  font-size: var(--text-caption);
  line-height: 1;
  font-weight: 800;
  transition: background .2s ease, color .2s ease;
}

.idc-product-card__button:hover {
  background: var(--idc-blue);
  color: #fff;
}

.idc-empty {
  grid-column: 1 / -1;
  padding: 28px 20px;
  border: 1px dashed var(--idc-line);
  border-radius: var(--idc-radius);
  background: rgba(255, 255, 255, .72);
  text-align: center;
}

.idc-empty h2 {
  margin: 0 0 8px;
  color: var(--idc-blue-dark);
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 500;
}

.idc-empty p {
  margin: 0;
  color: var(--idc-muted);
  font-size: var(--text-body);
  line-height: 1.4;
}

.idc-consult-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 1182px);
  min-height: 93px;
  margin: 20px auto 0;
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) 210px 238px;
  align-items: center;
  gap: 24px;
  padding: 18px 26px 18px 30px;
  border: 1px dashed #6d91ca;
  background: rgba(255, 255, 255, .72);
  color: var(--idc-blue-dark);
}

.idc-consult-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(12, 57, 127, .04) 1px, transparent 1px),
    linear-gradient(rgba(12, 57, 127, .04) 1px, transparent 1px);
  background-size: 88px 88px;
  pointer-events: none;
}

.idc-consult-panel__icon,
.idc-consult-panel__content,
.idc-consult-panel__button,
.idc-consult-panel__blueprint {
  position: relative;
  z-index: 1;
}

.idc-consult-panel__icon {
  width: 62px;
  height: 62px;
  color: var(--idc-blue);
  justify-self: center;
}

.idc-consult-panel__icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.idc-consult-panel__title {
  margin: 0 0 8px;
  color: var(--idc-blue-dark);
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: -.02em;
}

.idc-consult-panel__text {
  margin: 0;
  color: var(--idc-blue);
  font-size: var(--text-body);
  line-height: 1.35;
  font-weight: 500;
}

.idc-consult-panel__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 10px 22px;
  border: 1px solid var(--idc-blue);
  border-radius: 4px;
  background: rgba(255, 255, 255, .86);
  color: var(--idc-blue);
  font-weight: 800;
  font-size: var(--text-body);
  text-align: center;
  white-space: nowrap;
  transition: background .2s ease, color .2s ease;
}

.idc-consult-panel__button:hover {
  background: var(--idc-blue);
  color: #fff;
}

.idc-consult-panel__blueprint {
  align-self: stretch;
  min-height: 70px;
  overflow: hidden;
  opacity: .92;
}

.idc-consult-panel__blueprint img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

@media (max-width: 1279px) {
  body.footer-interior-doors-category {
    --idc-side-gutter: 28px;
  }

  .idc-blueprint-corner--left,
  .idc-blueprint-corner--right {
    width: 190px;
  }

  .idc-toolbar {
    width: min(100%, calc(100% - 24px));
    padding-inline: 8px;
  }

  .idc-products-grid {
    gap: 14px;
  }

  .idc-consult-panel {
    grid-template-columns: 68px minmax(0, 1fr) 210px;
  }

  .idc-consult-panel__blueprint {
    display: none;
  }
}

@media (max-width: 1024px) {
  .idc-section-head {
    margin-bottom: 34px;
  }

  .idc-blueprint-corner {
    opacity: .55;
  }

  .idc-products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .idc-product-card__image {
    height: 236px;
  }
}

@media (max-width: 768px) {
  body.footer-interior-doors-category {
    --idc-side-gutter: 14px;
  }

  .idc-catalog {
    padding: 28px var(--idc-side-gutter) 30px;
  }

  .idc-blueprint-corner {
    display: none;
  }

  .idc-section-head {
    margin-bottom: 24px;
  }

  .idc-title-line {
    margin-top: 18px;
  }

  .idc-toolbar {
    width: 100%;
    margin-bottom: 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .idc-sort {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }

  .idc-sort__select {
    flex: 1 1 auto;
    min-width: 0;
  }

  .idc-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .idc-product-card__body {
    padding: 11px 12px 12px;
  }

  .idc-product-card__name {
    font-size: var(--text-lg);
  }

  .idc-product-card__price {
    font-size: var(--text-xl);
  }

  .idc-product-card__button {
    min-width: 82px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .idc-consult-panel {
    grid-template-columns: 54px 1fr;
    gap: 14px;
    padding: 16px;
  }

  .idc-consult-panel__button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .idc-consult-panel__icon {
    width: 48px;
    height: 48px;
  }
}

@media (max-width: 480px) {
  .idc-products-grid {
    grid-template-columns: 1fr;
  }

  .idc-product-card__image {
    height: 247px;
  }

  .idc-consult-panel {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .idc-consult-panel__icon {
    justify-self: center;
  }
}
