/* ==========================================
   ЛесМаркет43 — Калькуляторы пиломатериалов
   calc.css v1.0
   ========================================== */

/* ── Hub page ──────────────────────────── */
.calc-hub-section {
  padding: 70px 5%;
  background: #FBF7EF;
}

.calc-hub-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 36px;
}

.calc-hub-card {
  background: #fff;
  border-radius: 20px;
  padding: 32px 28px;
  border: 1.5px solid #E8E0D0;
  box-shadow: 0 2px 16px rgba(45,80,22,0.07);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.28s;
}

.calc-hub-card:hover {
  border-color: #7AB648;
  transform: translateY(-5px);
  box-shadow: 0 10px 36px rgba(45,80,22,0.15);
}

.calc-hub-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #2D5016 0%, #3D6B1F 100%);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.calc-hub-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1E1E1E;
  line-height: 1.35;
}

.calc-hub-card p {
  font-size: 0.87rem;
  color: #666;
  line-height: 1.6;
  flex: 1;
}

.calc-hub-card .calc-arrow {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #5A8A2E;
}

/* ── Calculator hero ───────────────────── */
.calc-hero {
  background: linear-gradient(135deg, #1A2608 0%, #2D5016 50%, #1E3A0E 100%);
  padding: 100px 5% 60px;
}

.calc-hero-tag {
  display: inline-block;
  background: rgba(232,160,32,0.18);
  color: #E8A020;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 20px;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: 1px solid rgba(232,160,32,0.3);
  margin-bottom: 18px;
}

.calc-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 14px;
}

.calc-hero p {
  color: rgba(245,236,215,0.82);
  font-size: 1.05rem;
  line-height: 1.65;
  max-width: 620px;
}

/* ── Calculator wrapper ────────────────── */
.calc-section {
  background: #F8F4EC;
  padding: 60px 5%;
}

.calc-container {
  max-width: 1060px;
  margin: 0 auto;
}

.calc-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 8px 48px rgba(45,80,22,0.12);
  border: 1.5px solid #E8E0D0;
  overflow: hidden;
}

.calc-panel-inputs {
  padding: 44px 48px;
  background: #fff;
}

.calc-panel-result {
  padding: 44px 48px;
  background: linear-gradient(145deg, #1E3A0E 0%, #2D5016 40%, #3D6B1F 100%);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.calc-panel-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.calc-panel-inputs .calc-panel-title { color: #2D5016; }
.calc-panel-result .calc-panel-title { color: #fff; }

/* ── Form fields ───────────────────────── */
.calc-field {
  margin-bottom: 20px;
}

.calc-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 7px;
}

.calc-field input[type="number"],
.calc-field select {
  width: 100%;
  background: #FBF7EF;
  border: 1.5px solid #E8E0D0;
  border-radius: 10px;
  padding: 13px 16px;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #1E1E1E;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -moz-appearance: textfield;
}

.calc-field input[type="number"]::-webkit-inner-spin-button,
.calc-field input[type="number"]::-webkit-outer-spin-button {
  opacity: 0.5;
}

.calc-field input[type="number"]:focus,
.calc-field select:focus {
  border-color: #7AB648;
  box-shadow: 0 0 0 3px rgba(122,182,72,0.15);
}

.calc-field .field-hint {
  font-size: 0.77rem;
  color: #aaa;
  margin-top: 5px;
}

/* Presets */
.presets-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.presets-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 24px;
}

.preset-btn {
  background: #FBF7EF;
  border: 1.5px solid #E8E0D0;
  border-radius: 20px;
  padding: 6px 14px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: #2D5016;
  cursor: pointer;
  transition: all 0.18s;
}

.preset-btn:hover,
.preset-btn.active {
  background: #2D5016;
  border-color: #2D5016;
  color: #fff;
}

/* ── Result panel ──────────────────────── */
.result-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
  gap: 14px;
  opacity: 0.6;
}

.result-empty svg { opacity: 0.6; }
.result-empty p { color: rgba(255,255,255,0.8); font-size: 0.9rem; line-height: 1.6; }

.result-values {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result-item {
  background: rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 20px 24px;
  border: 1px solid rgba(255,255,255,0.15);
}

.result-item-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(122,182,72,0.95);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}

.result-item-value {
  font-family: 'Playfair Display', serif;
  font-size: 2.6rem;
  font-weight: 900;
  color: #fff;
  line-height: 1;
}

.result-item-value .result-unit {
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  margin-left: 5px;
}

.result-item-secondary {
  font-size: 0.83rem;
  color: rgba(255,255,255,0.6);
  margin-top: 6px;
}

.result-note {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.65;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* ── CTA after calc ────────────────────── */
.calc-cta {
  background: #fff;
  border-radius: 20px;
  padding: 32px 48px;
  margin-top: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1.5px solid #E8E0D0;
  box-shadow: 0 2px 16px rgba(45,80,22,0.06);
}

.calc-cta-text h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #2D5016;
  margin-bottom: 6px;
}

.calc-cta-text p {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.6;
  max-width: 480px;
}

.btn-calc-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #7AB648;
  color: #fff;
  padding: 14px 28px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: 'Nunito', sans-serif;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

.btn-calc-cta:hover {
  background: #2D5016;
  transform: translateY(-2px);
}

/* ── Lead form ─────────────────────────── */
.calc-lead {
  background: #FBF7EF;
  padding: 70px 5%;
}

.calc-lead-box {
  max-width: 760px;
  margin: 0 auto;
  background: #fff;
  border-radius: 24px;
  padding: 48px;
  border: 1.5px solid #E8E0D0;
  box-shadow: 0 4px 28px rgba(45,80,22,0.08);
}

.calc-lead-box h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.4rem, 2.5vw, 1.8rem);
  font-weight: 700;
  color: #2D5016;
  margin-bottom: 8px;
}

.calc-lead-box > p {
  font-size: 0.93rem;
  color: #777;
  margin-bottom: 28px;
  line-height: 1.65;
}

.calc-lead-summary {
  background: #FBF7EF;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 0.88rem;
  color: #444;
  border-left: 3px solid #7AB648;
  display: none;
}

.calc-lead-summary.visible { display: block; }

.lead-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.lead-form-grid .full-width { grid-column: 1 / -1; }

.lead-form-grid label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}

.lead-form-grid input,
.lead-form-grid textarea {
  width: 100%;
  background: #FBF7EF;
  border: 1.5px solid #E8E0D0;
  border-radius: 8px;
  padding: 12px 14px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  color: #1E1E1E;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.lead-form-grid input:focus,
.lead-form-grid textarea:focus {
  border-color: #7AB648;
  box-shadow: 0 0 0 3px rgba(122,182,72,0.1);
}

.lead-form-grid textarea { resize: vertical; min-height: 88px; }

.btn-lead-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: #2D5016;
  color: #fff;
  border: none;
  padding: 16px;
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.2s;
}

.btn-lead-submit:hover { background: #5A8A2E; }

.lead-privacy {
  font-size: 0.74rem;
  color: #bbb;
  text-align: center;
  margin-top: 10px;
}

/* ── SEO article ───────────────────────── */
.calc-article-wrap {
  background: #fff;
  padding: 70px 5%;
}

.calc-article {
  max-width: 860px;
  margin: 0 auto;
}

.calc-article h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  font-weight: 700;
  color: #2D5016;
  margin: 48px 0 16px;
  line-height: 1.3;
}

.calc-article h2:first-child { margin-top: 0; }

.calc-article p {
  font-size: 0.97rem;
  color: #333;
  line-height: 1.85;
  margin-bottom: 18px;
}

.calc-article ul,
.calc-article ol {
  margin: 0 0 20px 24px;
}

.calc-article li {
  font-size: 0.97rem;
  color: #333;
  line-height: 1.8;
  margin-bottom: 8px;
}

.calc-table-wrap {
  overflow-x: auto;
  margin: 28px 0;
  border-radius: 14px;
  border: 1.5px solid #E8E0D0;
}

.calc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.calc-table th {
  background: #2D5016;
  color: #fff;
  padding: 13px 18px;
  text-align: left;
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.calc-table td {
  padding: 12px 18px;
  border-bottom: 1px solid #E8E0D0;
  color: #333;
}

.calc-table tr:last-child td { border-bottom: none; }
.calc-table tr:nth-child(even) td { background: #FBF7EF; }
.calc-table td:first-child { font-weight: 700; color: #2D5016; }

.formula-box {
  background: #FBF7EF;
  border: 1.5px solid #E8E0D0;
  border-left: 4px solid #7AB648;
  border-radius: 12px;
  padding: 20px 26px;
  margin: 24px 0;
  font-family: 'Courier New', monospace;
  font-size: 0.93rem;
  color: #2D5016;
  line-height: 2.1;
}

.info-box {
  background: rgba(122,182,72,0.08);
  border: 1.5px solid rgba(122,182,72,0.25);
  border-radius: 12px;
  padding: 18px 22px;
  margin: 24px 0;
  font-size: 0.93rem;
  color: #333;
  line-height: 1.7;
}

.info-box strong { color: #2D5016; }

/* ── FAQ ────────────────────────────────── */
.calc-faq-wrap {
  background: #FBF7EF;
  padding: 70px 5%;
}

.calc-faq {
  max-width: 860px;
  margin: 32px auto 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.calc-faq-item {
  background: #fff;
  border-radius: 14px;
  border: 1.5px solid #E8E0D0;
  overflow: hidden;
}

.calc-faq-q {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.97rem;
  color: #1E1E1E;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: 'Nunito', sans-serif;
  transition: background 0.18s;
}

.calc-faq-q:hover { background: #FBF7EF; }

.calc-faq-q svg {
  flex-shrink: 0;
  transition: transform 0.3s;
}

.calc-faq-item.open .calc-faq-q svg { transform: rotate(180deg); }

.calc-faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.calc-faq-a-inner {
  padding: 0 24px 22px;
  font-size: 0.92rem;
  color: #444;
  line-height: 1.8;
}

.calc-faq-item.open .calc-faq-a { max-height: 500px; }

/* ── Related calculators ─────────────────── */
.calc-related {
  background: #fff;
  padding: 60px 5%;
}

.calc-related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 28px;
}

.calc-related-card {
  background: #FBF7EF;
  border-radius: 14px;
  padding: 22px 20px;
  text-decoration: none;
  border: 1.5px solid #E8E0D0;
  transition: all 0.22s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calc-related-card:hover {
  border-color: #7AB648;
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(45,80,22,0.1);
}

.calc-related-card span {
  font-size: 0.88rem;
  font-weight: 700;
  color: #2D5016;
  line-height: 1.4;
}

.calc-related-card small {
  font-size: 0.78rem;
  color: #999;
  line-height: 1.5;
}

/* ── Responsive ──────────────────────────── */
@media (max-width: 900px) {
  .calc-hub-grid { grid-template-columns: repeat(2, 1fr); }
  .calc-related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .calc-card { grid-template-columns: 1fr; }
  .calc-panel-inputs,
  .calc-panel-result { padding: 28px 24px; }
  .calc-cta {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
  }
  .calc-lead-box { padding: 28px 20px; }
  .lead-form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
  .calc-hub-grid { grid-template-columns: 1fr; }
  .calc-related-grid { grid-template-columns: 1fr; }
}
