/**
 * Свои правки без пересборки Tailwind.
 * Inter — интерфейс, Manrope — заголовки и баннеры.
 */

:root {
  --font-sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-display: 'Manrope', 'Inter', ui-sans-serif, system-ui, sans-serif;
}

body {
  font-family: var(--font-sans);
}

h1, h2, h3, h4, h5, h6,
.font-display,
.banner-title,
.hero-title {
  font-family: var(--font-display);
}

/* Крупные заголовки в hero/секциях (часто без тега h*) */
main h1,
main .text-4xl,
main .text-5xl,
main .text-6xl,
.section-block .text-3xl,
.section-block .text-4xl,
.section-block .text-5xl {
  font-family: var(--font-display);
}

/* Страница «О компании»: фото слева, текст справа */
.about-layout {
  display: grid;
  gap: 1.75rem;
  align-items: start;
}

.about-layout__photo {
  margin: 0 auto;
  width: 100%;
  max-width: 280px;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid hsl(var(--border, 214 20% 88%));
  background: hsl(var(--secondary, 210 20% 96%));
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.about-layout__photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center 18%;
}

.about-layout__body {
  min-width: 0;
}

@media (min-width: 768px) {
  .about-layout {
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 2.5rem;
  }

  .about-layout__photo {
    margin: 0;
    max-width: none;
    position: sticky;
    top: 7rem;
  }
}

@media (min-width: 1024px) {
  .about-layout {
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 3rem;
  }
}

/* Плашки подкатегорий на странице раздела */
.subcategory-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.subcategory-tile {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid hsl(var(--border, 214 20% 88%));
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.subcategory-tile:hover {
  transform: translateY(-2px);
  border-color: hsl(var(--primary, 0 72% 51%));
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.subcategory-tile__media {
  aspect-ratio: 4 / 3;
  background: hsl(var(--secondary, 210 20% 96%));
  overflow: hidden;
}

.subcategory-tile__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.subcategory-tile__title {
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
}

@media (min-width: 640px) {
  .subcategory-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .subcategory-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
  }
}

@media (min-width: 1280px) {
  .subcategory-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* Калькуляторы */
.calc-page {
  background:
    radial-gradient(ellipse 80% 50% at 10% 0%, rgba(180, 140, 60, 0.08), transparent 55%),
    linear-gradient(180deg, #f7f5f1 0%, #ffffff 40%);
}

.calc-hub-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .calc-hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .calc-hub-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.calc-hub-card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.35rem;
  border: 1px solid hsl(var(--border));
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.85);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.calc-hub-card:hover {
  border-color: hsl(var(--primary));
  transform: translateY(-2px);
}

.calc-form-grid {
  display: grid;
  gap: 0.85rem 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .calc-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .calc-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.calc-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
}

.calc-field input,
.calc-field select,
.calc-field textarea {
  width: 100%;
  border: 1px solid hsl(var(--border));
  border-radius: 0.65rem;
  background: #fff;
  padding: 0.55rem 0.75rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: hsl(var(--foreground));
}

.calc-stats {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .calc-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.calc-stats > div {
  border: 1px solid hsl(var(--border));
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  background: #fff;
}

.calc-stats dt {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.calc-stats dd {
  margin-top: 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.calc-match-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.calc-match-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  border: 1px solid hsl(var(--border));
  border-radius: 0.85rem;
  padding: 0.85rem 1rem;
  background: #fff;
}

.calc-match-row__role {
  display: inline-block;
  margin-bottom: 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: hsl(var(--primary));
}

.calc-delivery {
  background: rgba(255, 255, 255, 0.9);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.65rem;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  opacity: 0.92;
}

.calc-photo-box {
  border: 1px dashed hsl(var(--border));
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.75);
}

.calc-photo-preview {
  margin-top: 0.85rem;
  max-width: 320px;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid hsl(var(--border));
}

.calc-photo-preview img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: contain;
  background: #f3f1ec;
}

/* —— ИИ-смета: FAB + модалка + карточки —— */
body.ai-modal-open {
  overflow: hidden;
}

.ai-fab {
  background: linear-gradient(135deg, #1a1a1a 0%, #2D7DD1 55%, #246bb3 100%);
  border: none;
  cursor: pointer;
}

.ai-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: end center;
  padding: 0;
}

.ai-modal[hidden] {
  display: none !important;
}

.ai-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 12, 14, 0.55);
  backdrop-filter: blur(6px);
}

.ai-modal__panel {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  max-height: min(92vh, 900px);
  overflow: auto;
  margin: 0;
  border-radius: 1.35rem 1.35rem 0 0;
  background:
    radial-gradient(ellipse 80% 40% at 100% 0%, rgba(196, 18, 26, 0.12), transparent 50%),
    linear-gradient(180deg, #faf8f4 0%, #ffffff 35%);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.18);
  padding: 1.25rem 1.25rem 1.75rem;
}

@media (min-width: 768px) {
  .ai-modal {
    place-items: center;
    padding: 1.5rem;
  }
  .ai-modal__panel {
    border-radius: 1.35rem;
    margin: auto;
  }
}

.ai-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.9rem;
  border: none;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  color: #666;
  cursor: pointer;
}

.ai-modal__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2D7DD1;
  background: rgba(196, 18, 26, 0.08);
  border: 1px solid rgba(196, 18, 26, 0.18);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
}

.ai-modal__title {
  margin-top: 0.75rem;
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.ai-modal__lead {
  margin-top: 0.4rem;
  font-size: 0.92rem;
  color: #6b6b6b;
}

.ai-modal__body {
  margin-top: 1.1rem;
}

.ai-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1.25rem 1rem;
  border: 1.5px dashed rgba(0, 0, 0, 0.18);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.ai-drop:hover {
  border-color: #2D7DD1;
  transform: translateY(-1px);
}

.ai-drop input {
  display: none;
}

.ai-drop__icon {
  color: #2D7DD1;
}

.ai-drop__title {
  font-weight: 700;
  font-size: 0.95rem;
}

.ai-drop__hint {
  font-size: 0.75rem;
  color: #888;
}

.ai-drop__preview {
  margin-top: 0.5rem;
  max-height: 140px;
  border-radius: 0.6rem;
  object-fit: contain;
}

.ai-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #666;
}

.ai-field input,
.ai-field textarea {
  border: 1px solid #e2e0db;
  border-radius: 0.7rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.92rem;
  font-weight: 500;
  background: #fff;
  color: #1a1a1a;
}

.ai-field__hint {
  font-size: 0.72rem;
  font-weight: 500;
  color: #999;
}

.ai-file {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 3rem;
  padding: 0.4rem 0.45rem 0.4rem 0.4rem;
  border: 1px solid #e2e0db;
  border-radius: 0.75rem;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ai-file:hover {
  border-color: rgba(196, 18, 26, 0.45);
  box-shadow: 0 0 0 3px rgba(196, 18, 26, 0.06);
}

.ai-file input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.ai-file__btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.9rem;
  border-radius: 0.55rem;
  background: #1a1a1a;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.ai-file:hover .ai-file__btn {
  background: #2D7DD1;
}

.ai-file__name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
  font-weight: 500;
  color: #9a9a9a;
}

.ai-file__name.is-set {
  color: #1a1a1a;
  font-weight: 600;
}

.ai-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 0.75rem;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.65rem 1.15rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.ai-btn:hover {
  transform: translateY(-1px);
}

.ai-btn--primary {
  background: linear-gradient(135deg, #1a1a1a, #2D7DD1);
  color: #fff;
  width: 100%;
  margin-top: 1rem;
}

.ai-btn--ghost {
  background: #f3f1ec;
  color: #222;
}

.ai-btn--cart {
  background: #2D7DD1;
  color: #fff;
  width: 100%;
  margin-top: 0.55rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
}

.ai-btn--cart.is-done {
  background: #1f7a3a;
}

.ai-thinking {
  text-align: center;
  padding: 1.5rem 0.5rem 2rem;
}

.ai-bot {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
}

.ai-bot--lg {
  width: 110px;
  height: 110px;
}

.ai-bot__orb {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff 0%, #d6e8f7 35%, #2D7DD1 100%);
  box-shadow: 0 0 24px rgba(196, 18, 26, 0.35);
  animation: ai-orb 2.2s ease-in-out infinite;
}

.ai-bot__pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(196, 18, 26, 0.35);
  animation: ai-pulse 2.2s ease-out infinite;
}

@keyframes ai-orb {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@keyframes ai-pulse {
  0% { transform: scale(0.7); opacity: 0.9; }
  100% { transform: scale(1.35); opacity: 0; }
}

.ai-thinking__title {
  font-weight: 800;
  font-size: 1.05rem;
}

.ai-thinking__steps {
  list-style: none;
  margin: 1rem auto 0;
  padding: 0;
  max-width: 320px;
  text-align: left;
}

.ai-thinking__steps li {
  position: relative;
  padding: 0.45rem 0.5rem 0.45rem 1.6rem;
  font-size: 0.88rem;
  color: #999;
  transition: color 0.25s ease;
}

.ai-thinking__steps li::before {
  content: "";
  position: absolute;
  left: 0.35rem;
  top: 0.7rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #ddd;
}

.ai-thinking__steps li.is-active {
  color: #1a1a1a;
  font-weight: 600;
}

.ai-thinking__steps li.is-active::before {
  background: #2D7DD1;
  box-shadow: 0 0 0 4px rgba(196, 18, 26, 0.15);
}

.ai-thinking__steps li.is-done {
  color: #3a3a3a;
}

.ai-thinking__steps li.is-done::before {
  background: #1f7a3a;
}

.ai-line {
  margin-bottom: 1.35rem;
  animation: ai-rise 0.45s ease both;
  animation-delay: calc(var(--i, 0) * 0.08s);
}

@keyframes ai-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.ai-line__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.ai-line__head h3 {
  font-size: 0.98rem;
  font-weight: 800;
}

.ai-line__qty {
  font-size: 0.78rem;
  font-weight: 700;
  color: #2D7DD1;
  background: rgba(196, 18, 26, 0.08);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.ai-cards {
  display: grid;
  gap: 0.75rem;
}

.ai-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 1rem;
  background: #fff;
  border: 1px solid #ebe8e2;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
  animation: ai-rise 0.5s ease both;
  animation-delay: calc(var(--j, 0) * 0.1s + 0.12s);
}

.ai-card__media {
  width: 72px;
  height: 72px;
  border-radius: 0.7rem;
  overflow: hidden;
  background: #f3f1ec;
}

.ai-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ai-card__ph {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #eee, #f7f5f1);
}

.ai-chip {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #1f7a3a;
  background: rgba(31, 122, 58, 0.1);
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
  margin-bottom: 0.25rem;
}

.ai-card__name {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: #1a1a1a;
  text-decoration: none;
  line-height: 1.3;
}

.ai-card__name:hover {
  color: #2D7DD1;
}

.ai-card__price {
  margin-top: 0.35rem;
  font-size: 1.05rem;
  font-weight: 800;
}

.ai-card__price small {
  font-size: 0.75rem;
  font-weight: 600;
  color: #888;
}

.ai-empty,
.ai-note {
  font-size: 0.88rem;
  color: #666;
  background: #f7f5f1;
  border-radius: 0.75rem;
  padding: 0.75rem 0.9rem;
}

.ai-note {
  color: #7a5a00;
  background: #fff8e8;
  border: 1px solid #f0e0b0;
}

.ai-modal__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.ai-modal__footer .ai-btn {
  flex: 1;
  margin-top: 0;
  min-width: 140px;
}

.ai-toast {
  position: sticky;
  bottom: 0.5rem;
  margin-top: 0.75rem;
  text-align: center;
  background: #1a1a1a;
  color: #fff;
  border-radius: 0.65rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.ai-smeta-hero {
  display: grid;
  gap: 1.5rem;
  align-items: center;
}

@media (min-width: 900px) {
  .ai-smeta-hero {
    grid-template-columns: 1.4fr 0.6fr;
  }
}

.ai-smeta-form {
  max-width: 640px;
}

.ai-results .ai-card {
  grid-template-columns: 88px 1fr;
}

@media (min-width: 700px) {
  .ai-results .ai-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
