/*
Theme Name: АкадемПомощь
Theme URI: https://academhelp.ru
Author: АкадемПомощь
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: academhelp
*/

/* =============================================
   CSS VARIABLES
   ============================================= */
:root {
  --navy:         #0f2444;
  --navy-dark:    #091828;
  --blue:         #1655a2;
  --blue-light:   #2a75cc;
  --blue-pale:    #e8f0fb;
  --accent:       #e8560a;
  --accent-dark:  #c94509;
  --accent2:      #f4a828;
  --text:         #1a2636;
  --text-muted:   #6b7d95;
  --white:        #ffffff;
  --bg:           #f5f7fc;
  --border:       #dce4f0;
  --shadow-sm:    0 2px 8px rgba(15,36,68,.08);
  --shadow-md:    0 8px 32px rgba(15,36,68,.13);
  --shadow-lg:    0 20px 60px rgba(15,36,68,.2);
  --radius:       10px;
  --radius-sm:    6px;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Raleway', 'Segoe UI', sans-serif;
  --tr:           0.22s cubic-bezier(.4,0,.2,1);
}

/* RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font-body); color: var(--text); background: var(--bg); line-height: 1.65; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; transition: color var(--tr); }
a:hover { color: var(--accent); }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: var(--font-body); }
input, select, textarea { font-family: var(--font-body); }

/* TYPOGRAPHY */
h1,h2,h3,h4,h5,h6 { font-family: var(--font-display); font-weight: 700; line-height: 1.25; color: var(--navy); }
h1 { font-size: clamp(26px, 4vw, 48px); }
h2 { font-size: clamp(20px, 3vw, 36px); }
h3 { font-size: clamp(17px, 2.5vw, 26px); }
h4 { font-size: 20px; }
p  { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }
.section-title { font-family: var(--font-display); font-size: clamp(22px, 3.5vw, 40px); font-weight: 900; color: var(--navy); margin-bottom: 10px; }
.section-sub   { color: var(--text-muted); font-size: 16px; margin-bottom: 44px; }

/* LAYOUT */
.container         { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.container--wide   { max-width: 1440px; margin: 0 auto; padding: 0 24px; }
.container--narrow { max-width: 900px;  margin: 0 auto; padding: 0 24px; }
.section       { padding: 72px 0; }
.section--sm   { padding: 48px 0; }
.section--lg   { padding: 96px 0; }
.section--dark  { background: var(--navy); }
.section--navy  { background: var(--navy-dark); }
.section--light { background: var(--bg); }
.section--white { background: var(--white); }
.grid-2    { display: grid; grid-template-columns: repeat(2,1fr); gap: 24px; }
.grid-3    { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.grid-4    { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 24px; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 28px; border-radius: var(--radius-sm); font-weight: 700; font-size: 14px; letter-spacing: .3px; transition: all var(--tr); border: 2px solid transparent; white-space: nowrap; text-decoration: none; cursor: pointer; line-height: 1; }
.btn--primary  { background: var(--accent); color: var(--white); border-color: var(--accent); }
.btn--primary:hover  { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--white); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(232,86,10,.3); }
.btn--secondary{ background: transparent; color: var(--white); border-color: rgba(255,255,255,.5); }
.btn--secondary:hover{ background: rgba(255,255,255,.1); border-color: var(--white); color: var(--white); }
.btn--outline  { background: transparent; color: var(--blue); border-color: var(--blue); }
.btn--outline:hover { background: var(--blue); color: var(--white); }
.btn--lg   { padding: 15px 34px; font-size: 15px; }
.btn--sm   { padding: 8px 18px; font-size: 12px; }
.btn--full { width: 100%; justify-content: center; }

/* =============================================
   HEADER
   ============================================= */
.site-header { background: var(--navy); position: sticky; top: 0; z-index: 1000; box-shadow: 0 4px 20px rgba(0,0,0,.25); }
.header-inner { display: flex; align-items: center; height: 68px; position: relative; }

.site-logo { display: flex; flex-direction: column; line-height: 1; text-decoration: none; flex-shrink: 0; margin-right: 32px; }
.site-logo__main { font-family: var(--font-display); font-size: 22px; font-weight: 900; color: var(--white); letter-spacing: -.3px; }
.site-logo__sub  { font-size: 9px; color: var(--accent2); letter-spacing: 3px; text-transform: uppercase; margin-top: 3px; }

/* =============================================
   NAVIGATION
   ============================================= */
.main-nav { display: flex; align-items: center; flex: 1; height: 68px; }

.nav-item { position: relative; height: 68px; display: flex; align-items: center; }

.nav-link {
  display: flex; align-items: center; gap: 5px;
  padding: 0 14px; height: 68px;
  color: rgba(255,255,255,.85); font-size: 13px; font-weight: 600;
  white-space: nowrap; cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all var(--tr);
  text-decoration: none; letter-spacing: .2px; user-select: none;
}
.nav-link:hover,
.nav-item.is-open > .nav-link { color: var(--white); border-bottom-color: var(--accent2); background: rgba(255,255,255,.05); }
.nav-arrow { width: 10px; height: 10px; transition: transform var(--tr); opacity: .7; flex-shrink: 0; }
.nav-item.is-open .nav-arrow { transform: rotate(180deg); }

.header-cta { margin-left: auto; display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.header-contacts { color: rgba(255,255,255,.55); font-size: 12px; text-align: right; line-height: 1.4; }
.header-contacts strong { color: var(--white); display: block; font-size: 13px; }

.nav-toggle { display: none; flex-direction: column; justify-content: center; background: none; border: none; color: var(--white); padding: 8px; margin-left: auto; cursor: pointer; z-index: 1001; flex-shrink: 0; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: currentColor; margin: 4px 0; transition: all 0.25s ease; border-radius: 2px; }

/* =============================================
   DROPDOWNS
   ============================================= */
.dropdown {
  display: none;
  position: absolute;
  top: 68px; left: 0;
  background: var(--white);
  border-top: 3px solid var(--accent2);
  box-shadow: var(--shadow-lg);
  border-radius: 0 0 var(--radius) var(--radius);
  z-index: 999;
  min-width: 240px;
  overflow: hidden;
  animation: dropIn .18s ease;
}
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.nav-item.is-open > .dropdown { display: block; }
.dropdown.align-right { left: auto; right: 0; }

/* MEGA — ключевой фикс позиционирования */
.dropdown.mega   { width: 800px; }
.dropdown.mega-xl{ width: 1040px; }
/* JS выставит правильный left, чтобы не уходил за край */

.dd-list { padding: 8px 0; }
.dd-list a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 20px; color: var(--text); font-size: 13px; font-weight: 500; transition: background var(--tr), color var(--tr); text-decoration: none; }
.dd-list a:hover { background: var(--blue-pale); color: var(--blue); }
.dd-list .dd-price { color: var(--accent); font-size: 11px; font-weight: 700; }
.dd-list .dd-hot  { background: #ffe8e0; color: var(--accent); font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 10px; flex-shrink: 0; }
.dd-divider { height: 1px; background: var(--border); margin: 6px 16px; }

/* MEGA GRID */
.mega-body { display: grid; padding: 24px; gap: 24px; }
.mega-3col { grid-template-columns: 1fr 1fr 1fr; }
.mega-4col { grid-template-columns: 1fr 1fr 1fr 220px; }

.mega-col-title { font-size: 10px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 2px; padding-bottom: 10px; border-bottom: 2px solid var(--border); margin-bottom: 8px; }
.mega-col ul li a { display: flex; align-items: center; justify-content: space-between; padding: 7px 8px; border-radius: var(--radius-sm); color: var(--text); font-size: 13px; font-weight: 500; text-decoration: none; transition: background var(--tr), color var(--tr); }
.mega-col ul li a:hover { background: var(--blue-pale); color: var(--blue); }
.mega-col ul li a .p   { color: var(--accent); font-size: 11px; font-weight: 700; flex-shrink: 0; }
.mega-col ul li a .hot { background: #ffe8e0; color: var(--accent); font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 8px; flex-shrink: 0; }

.mega-promo { background: var(--navy); border-radius: var(--radius); padding: 20px; color: rgba(255,255,255,.7); font-size: 13px; }
.mega-promo h4 { color: var(--accent2); font-size: 14px; margin-bottom: 10px; }
.mega-promo ul li { padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.1); font-size: 12px; }
.mega-promo ul li:last-child { border: none; }
.mega-promo ul li span { color: var(--white); font-weight: 600; }
.mega-promo .btn { margin-top: 14px; font-size: 12px; padding: 9px 16px; }

/* MEGA SIDEBAR */
.mega-sidebar-wrap { display: grid; grid-template-columns: 190px 1fr; min-height: 380px; }
.mega-sidebar { background: #f2f5fb; border-right: 1px solid var(--border); padding: 10px 0; overflow-y: auto; }
.mega-sidebar-btn { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; transition: all var(--tr); border-left: 3px solid transparent; }
.mega-sidebar-btn:hover,
.mega-sidebar-btn.active { background: var(--white); color: var(--blue); border-left-color: var(--blue); }
.mega-sidebar-btn svg { width: 10px; opacity: .5; transform: rotate(-90deg); flex-shrink: 0; }
.mega-panels-wrap { overflow: hidden; }
.mega-panel { display: none; padding: 20px 24px; }
.mega-panel.active { display: block; animation: dropIn .15s ease; }
.mega-panel h4  { font-size: 16px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.mega-panel .sub{ color: var(--text-muted); font-size: 12px; margin-bottom: 16px; }
.work-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.work-card { background: var(--blue-pale); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; text-decoration: none; transition: border-color var(--tr), transform var(--tr), box-shadow var(--tr); display: block; }
.work-card:hover { border-color: var(--blue); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.work-card .name { font-size: 12px; font-weight: 600; color: var(--text); }
.work-card .from { font-size: 11px; color: var(--accent); font-weight: 700; margin-top: 4px; }

/* =============================================
   HERO
   ============================================= */
.hero { background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 55%, #1a3a60 100%); color: var(--white); padding: 80px 0 72px; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); pointer-events: none; }
.hero__inner { display: grid; grid-template-columns: 1fr 420px; gap: 60px; align-items: center; position: relative; z-index: 1; }
.hero__label { display: inline-flex; align-items: center; gap: 8px; background: rgba(244,168,40,.15); border: 1px solid rgba(244,168,40,.3); color: var(--accent2); font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; padding: 6px 14px; border-radius: 20px; margin-bottom: 20px; }
.hero__title { font-family: var(--font-display); font-size: clamp(30px, 4.5vw, 52px); font-weight: 900; color: var(--white); line-height: 1.15; margin-bottom: 20px; }
.hero__title span { color: var(--accent2); }
.hero__desc  { font-size: 16px; color: rgba(255,255,255,.75); margin-bottom: 32px; line-height: 1.7; }
.hero__badges{ display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; }
.hero__badge { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); padding: 7px 14px; border-radius: 6px; font-size: 13px; color: rgba(255,255,255,.9); font-weight: 500; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero__form-card { background: var(--white); border-radius: 16px; padding: 28px; box-shadow: 0 24px 80px rgba(0,0,0,.3); }
.hero__form-card h3 { font-size: 18px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.hero__form-card p  { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.hero__mobile-cta   { display: none; }

/* =============================================
   FORMS
   ============================================= */
.form-group  { margin-bottom: 16px; }
.form-label  { display: block; font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.form-control { width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 14px; color: var(--text); background: var(--white); transition: border-color var(--tr), box-shadow var(--tr); -webkit-appearance: none; appearance: none; }
.form-control:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(22,85,162,.12); }
select.form-control { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7d95' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-note { font-size: 11px; color: var(--text-muted); margin-top: 12px; }
.form-note a { color: var(--blue); }
.order-success { text-align: center; padding: 20px 0; }
.order-success h3 { color: var(--navy); margin: 12px 0 8px; }
.order-success p  { color: var(--text-muted); font-size: 14px; }

/* SERVICE CARDS */
.service-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; transition: all var(--tr); position: relative; overflow: hidden; text-decoration: none; display: block; color: var(--text); }
.service-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform var(--tr); }
.service-card:hover { border-color: var(--blue-light); box-shadow: var(--shadow-md); transform: translateY(-4px); color: var(--text); }
.service-card:hover::before { transform: scaleX(1); }
.service-card__icon  { font-size: 32px; margin-bottom: 14px; }
.service-card__name  { font-family: var(--font-display); font-size: 17px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.service-card__desc  { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.service-card__meta  { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--border); }
.service-card__price { font-size: 15px; font-weight: 800; color: var(--accent); }
.service-card__term  { font-size: 12px; color: var(--text-muted); }

/* STATS */
.stats-strip { background: var(--navy); padding: 32px 0; }
.stats-grid  { display: grid; grid-template-columns: repeat(4,1fr); gap: 0; text-align: center; }
.stat-item   { padding: 12px 24px; border-right: 1px solid rgba(255,255,255,.1); }
.stat-item:last-child { border-right: none; }
.stat-num    { font-family: var(--font-display); font-size: 36px; font-weight: 900; color: var(--accent2); line-height: 1; margin-bottom: 6px; }
.stat-label  { font-size: 13px; color: rgba(255,255,255,.65); font-weight: 500; }

/* STEPS */
.steps-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 24px; position: relative; }
.steps-grid::before { content: ''; position: absolute; top: 32px; left: calc(12.5% + 12px); right: calc(12.5% + 12px); height: 2px; background: var(--border); z-index: 0; }
.step { text-align: center; position: relative; z-index: 1; }
.step__num   { width: 64px; height: 64px; border-radius: 50%; background: var(--navy); color: var(--white); font-family: var(--font-display); font-size: 24px; font-weight: 900; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; box-shadow: 0 0 0 6px var(--bg); }
.step__title { font-size: 15px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.step__desc  { font-size: 13px; color: var(--text-muted); }

/* GUARANTEES */
.guarantee-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.guarantee-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 24px; text-align: center; transition: box-shadow var(--tr); }
.guarantee-card:hover { box-shadow: var(--shadow-md); }
.guarantee-card__icon  { font-size: 40px; margin-bottom: 16px; }
.guarantee-card__title { font-size: 16px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.guarantee-card__text  { font-size: 13px; color: var(--text-muted); }

/* REVIEWS */
.reviews-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.review-card  { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.review-stars { color: var(--accent2); font-size: 14px; margin-bottom: 12px; }
.review-text  { font-size: 14px; color: var(--text); line-height: 1.65; margin-bottom: 16px; font-style: italic; }
.review-author{ display: flex; align-items: center; gap: 10px; }
.review-avatar{ width: 36px; height: 36px; background: var(--navy); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--white); font-weight: 700; font-size: 14px; flex-shrink: 0; }
.review-name  { font-size: 13px; font-weight: 700; color: var(--navy); }
.review-meta  { font-size: 11px; color: var(--text-muted); }

/* PAGE HERO */
.page-hero { background: linear-gradient(135deg, var(--navy-dark), var(--navy)); padding: 52px 0 48px; color: var(--white); }
.page-hero__breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: rgba(255,255,255,.5); margin-bottom: 16px; flex-wrap: wrap; }
.page-hero__breadcrumb a { color: rgba(255,255,255,.6); }
.page-hero__breadcrumb a:hover { color: var(--white); }
.page-hero__breadcrumb .sep { opacity: .4; }
.page-hero__title { font-family: var(--font-display); font-size: clamp(24px,4vw,44px); font-weight: 900; color: var(--white); margin-bottom: 12px; }
.page-hero__desc  { font-size: 16px; color: rgba(255,255,255,.75); max-width: 680px; }
.page-hero__meta  { display: flex; gap: 24px; margin-top: 24px; flex-wrap: wrap; }
.page-hero__meta-item { font-size: 13px; color: rgba(255,255,255,.7); }
.page-hero__meta-item strong { color: var(--accent2); }

/* SERVICE PAGE */
.service-page-grid { display: grid; grid-template-columns: 1fr 360px; gap: 40px; align-items: start; }
.service-content h2 { margin: 32px 0 12px; font-size: 22px; }
.service-content h3 { margin: 24px 0 10px; font-size: 18px; }
.service-content p  { margin-bottom: 16px; color: var(--text); line-height: 1.75; }
.service-content ul { margin-bottom: 20px; }
.service-content ul li { padding: 6px 0 6px 22px; position: relative; font-size: 14px; color: var(--text); }
.service-content ul li::before { content: '→'; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.order-sidebar { position: sticky; top: 88px; }
.order-card    { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.order-card__title { font-size: 18px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.order-card__price-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.order-card__from  { font-size: 12px; color: var(--text-muted); }
.order-card__price { font-size: 28px; font-weight: 900; color: var(--accent); font-family: var(--font-display); }
.order-card__features { margin-bottom: 20px; }
.order-card__feature { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 13px; border-bottom: 1px solid var(--border); }
.order-card__feature:last-child { border: none; }
.order-card__feature-icon { color: #22c55e; font-size: 16px; }

/* PRICE TABLE */
.price-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.filter-btn   { padding: 8px 18px; border-radius: 20px; border: 1px solid var(--border); background: var(--white); color: var(--text); font-size: 13px; font-weight: 500; cursor: pointer; transition: all var(--tr); font-family: var(--font-body); }
.filter-btn:hover, .filter-btn.active { background: var(--navy); color: var(--white); border-color: var(--navy); }
.price-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-sm); }
.price-table      { width: 100%; border-collapse: collapse; min-width: 520px; }
.price-table th   { background: var(--navy); color: var(--white); padding: 12px 16px; font-size: 13px; font-weight: 700; text-align: left; white-space: nowrap; }
.price-table td   { padding: 11px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.price-table tr:nth-child(even) td { background: var(--blue-pale); }
.price-table tr:hover td { background: #dde8f8; }
.price-table .price-cell { font-weight: 700; color: var(--accent); white-space: nowrap; }

/* FAQ */
.faq-list   { max-width: 820px; }
.faq-item   { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; overflow: hidden; transition: box-shadow var(--tr); }
.faq-item.active { box-shadow: var(--shadow-sm); }
.faq-question { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; cursor: pointer; font-weight: 600; font-size: 15px; color: var(--navy); background: var(--white); transition: background var(--tr); user-select: none; gap: 12px; }
.faq-question:hover { background: var(--blue-pale); }
.faq-toggle { width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; background: var(--blue-pale); border: none; display: flex; align-items: center; justify-content: center; color: var(--blue); font-size: 18px; font-weight: 700; line-height: 1; transition: all var(--tr); cursor: pointer; }
.faq-item.active .faq-toggle { background: var(--accent); color: var(--white); transform: rotate(45deg); }
.faq-answer { display: none; padding: 4px 20px 20px; background: var(--white); font-size: 14px; color: var(--text-muted); line-height: 1.7; }
.faq-item.active .faq-answer { display: block; }

/* BLOG */
.posts-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.post-card  { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: all var(--tr); display: flex; flex-direction: column; }
.post-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.post-card__thumb { height: 180px; background: linear-gradient(135deg, var(--navy), var(--blue)); display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.3); font-size: 48px; overflow: hidden; }
.post-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card__body    { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.post-card__cat     { display: inline-block; background: var(--blue-pale); color: var(--blue); font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; padding: 3px 10px; border-radius: 20px; margin-bottom: 10px; text-decoration: none; }
.post-card__title   { font-size: 16px; font-weight: 700; color: var(--navy); margin-bottom: 8px; line-height: 1.35; text-decoration: none; display: block; }
.post-card__title:hover { color: var(--blue); }
.post-card__excerpt { font-size: 13px; color: var(--text-muted); flex: 1; margin-bottom: 14px; }
.post-card__meta    { font-size: 12px; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 12px; }

.single-layout { display: grid; grid-template-columns: 1fr 300px; gap: 40px; align-items: start; }
.post-content  { background: var(--white); border-radius: var(--radius); padding: 40px; border: 1px solid var(--border); }
.post-content h1,.post-content h2,.post-content h3 { margin: 28px 0 12px; }
.post-content h1:first-child,.post-content h2:first-child { margin-top: 0; }
.post-content p  { margin-bottom: 18px; line-height: 1.8; }
.post-content ul,.post-content ol { margin: 16px 0 16px 20px; }
.post-content li { margin-bottom: 8px; line-height: 1.65; }
.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }

/* WIDGETS */
.widget { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.widget-title { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.5px; color: var(--navy); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--border); }

/* CTA SECTION */
.cta-section { background: linear-gradient(135deg, var(--navy) 0%, #1a3a60 100%); padding: 64px 0; text-align: center; color: var(--white); position: relative; overflow: hidden; }
.cta-section::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 30% 50%, rgba(255,255,255,.04) 0%, transparent 60%), radial-gradient(ellipse at 70% 50%, rgba(244,168,40,.06) 0%, transparent 60%); pointer-events: none; }
.cta-section__title   { font-size: clamp(22px,3.5vw,38px); font-weight: 900; color: var(--white); margin-bottom: 12px; position: relative; }
.cta-section__desc    { font-size: 16px; color: rgba(255,255,255,.75); margin-bottom: 32px; position: relative; }
.cta-section__actions { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; position: relative; }
.cta-bonus { display: inline-flex; align-items: center; gap: 8px; background: rgba(244,168,40,.2); border: 1px solid rgba(244,168,40,.4); color: var(--accent2); padding: 8px 20px; border-radius: 20px; font-size: 13px; font-weight: 700; margin-bottom: 24px; position: relative; }

/* CONTACT */
.contact-grid { display: grid; grid-template-columns: 1fr 400px; gap: 48px; align-items: start; }
.contact-info-item  { display: flex; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.contact-info-icon  { width: 44px; height: 44px; background: var(--blue-pale); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.contact-info-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 700; margin-bottom: 4px; }
.contact-info-value { font-size: 15px; font-weight: 600; color: var(--navy); }

/* ANTIPLAGIAT */
.antiplagiat-levels { display: grid; grid-template-columns: repeat(5,1fr); gap: 12px; }
.level-card { background: var(--white); border: 2px solid var(--border); border-radius: var(--radius); padding: 20px 16px; text-align: center; transition: all var(--tr); }
.level-card:hover { box-shadow: var(--shadow-sm); }
.level-card__pct   { font-family: var(--font-display); font-size: 32px; font-weight: 900; color: var(--navy); margin-bottom: 6px; }
.level-card__label { font-size: 12px; color: var(--text-muted); }
.level-card--active { border-color: var(--blue); }
.level-card--active .level-card__pct { color: var(--blue); }

/* PAGINATION */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 48px; flex-wrap: wrap; }
.page-link  { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--white); color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none; transition: all var(--tr); }
.page-link:hover, .page-link.active { background: var(--navy); color: var(--white); border-color: var(--navy); }

/* FOOTER */
.site-footer { background: var(--navy-dark); color: rgba(255,255,255,.65); padding: 56px 0 0; }
.footer-grid { display: grid; grid-template-columns: 280px 1fr 1fr 1fr; gap: 48px; padding-bottom: 48px; border-bottom: 1px solid rgba(255,255,255,.1); }
.footer-brand p { font-size: 13px; line-height: 1.7; }
.footer-brand .social-links { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.social-link { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.6); font-size: 13px; font-weight: 700; transition: all var(--tr); text-decoration: none; }
.social-link:hover { background: var(--accent); border-color: var(--accent); color: var(--white); }
.footer-col-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 2px; color: var(--white); margin-bottom: 16px; }
.footer-nav { list-style: none; }
.footer-nav li { margin-bottom: 8px; }
.footer-nav a  { font-size: 13px; color: rgba(255,255,255,.55); text-decoration: none; transition: color var(--tr); }
.footer-nav a:hover { color: var(--white); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; padding: 20px 0; font-size: 12px; color: rgba(255,255,255,.35); }
.footer-bottom a { color: rgba(255,255,255,.45); }
.footer-bottom a:hover { color: rgba(255,255,255,.8); }

/* UTILITY */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-white  { color: var(--white); }
.mt-8{margin-top:8px}.mt-16{margin-top:16px}.mt-24{margin-top:24px}.mt-32{margin-top:32px}.mt-48{margin-top:48px}
.mb-8{margin-bottom:8px}.mb-16{margin-bottom:16px}.mb-24{margin-bottom:24px}.mb-32{margin-bottom:32px}.mb-48{margin-bottom:48px}
.fw-700 { font-weight: 700; }
.badge-hot { display: inline-block; background: #ffe8e0; color: var(--accent); font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 10px; vertical-align: middle; }
.badge-new { display: inline-block; background: var(--blue-pale); color: var(--blue); font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 10px; vertical-align: middle; }

/* SCROLL ANIMATION */
.service-card,.step,.guarantee-card,.review-card { opacity: 0; transform: translateY(16px); transition: opacity .4s ease, transform .4s ease, box-shadow var(--tr), border-color var(--tr); }
.service-card.in-view,.step.in-view,.guarantee-card.in-view,.review-card.in-view { opacity: 1; transform: translateY(0); }
.service-card:nth-child(2){transition-delay:.05s}.service-card:nth-child(3){transition-delay:.1s}.service-card:nth-child(4){transition-delay:.15s}
.service-card:nth-child(5){transition-delay:.05s}.service-card:nth-child(6){transition-delay:.1s}.service-card:nth-child(7){transition-delay:.15s}.service-card:nth-child(8){transition-delay:.2s}
.step:nth-child(2){transition-delay:.08s}.step:nth-child(3){transition-delay:.16s}.step:nth-child(4){transition-delay:.24s}
.guarantee-card:nth-child(2){transition-delay:.06s}.guarantee-card:nth-child(3){transition-delay:.12s}
.guarantee-card:nth-child(4){transition-delay:.06s}.guarantee-card:nth-child(5){transition-delay:.12s}.guarantee-card:nth-child(6){transition-delay:.18s}
.review-card:nth-child(2){transition-delay:.08s}.review-card:nth-child(3){transition-delay:.16s}

/* =============================================
   RESPONSIVE ≤ 1200px
   ============================================= */
@media (max-width:1200px){
  .nav-link{padding:0 11px;font-size:12.5px}
  .mega-body.mega-4col{grid-template-columns:1fr 1fr 1fr}
  .mega-promo{display:none}
  .hero__inner{gap:40px}
  .footer-grid{grid-template-columns:220px 1fr 1fr 1fr;gap:32px}
}

/* =============================================
   RESPONSIVE ≤ 1024px (Планшет)
   ============================================= */
@media (max-width:1024px){
  .header-contacts{display:none}
  .nav-link{padding:0 10px;font-size:12px}
  .hero__inner{grid-template-columns:1fr}
  .hero__form-card{display:none}
  .hero{padding:60px 0 52px}
  /* Мегаменю: центрируем по экрану, не уходит за край */
  .dropdown.mega,.dropdown.mega-xl{
    position:fixed !important;
    top:68px;
    left:50% !important;
    transform:translateX(-50%) !important;
    max-width:calc(100vw - 32px);
    width:min(900px,calc(100vw - 32px));
  }
  .mega-body.mega-4col{grid-template-columns:1fr 1fr 1fr}
  .mega-sidebar-wrap{grid-template-columns:150px 1fr}
  .work-grid{grid-template-columns:repeat(2,1fr)}
  .service-page-grid{grid-template-columns:1fr}
  .order-sidebar{position:static}
  .contact-grid{grid-template-columns:1fr}
  .single-layout{grid-template-columns:1fr 250px;gap:24px}
  .stats-grid{grid-template-columns:repeat(2,1fr)}
  .stat-item{border-right:none;border-bottom:1px solid rgba(255,255,255,.1)}
  .stat-item:nth-child(odd){border-right:1px solid rgba(255,255,255,.1)}
  .stat-item:nth-last-child(-n+2){border-bottom:none}
  .grid-4{grid-template-columns:repeat(2,1fr)}
  .reviews-grid{grid-template-columns:repeat(2,1fr)}
  .footer-grid{grid-template-columns:1fr 1fr;gap:28px}
  .guarantee-grid{grid-template-columns:repeat(2,1fr)}
  .antiplagiat-levels{grid-template-columns:repeat(3,1fr)}
}

/* =============================================
   RESPONSIVE ≤ 768px (Смартфон)
   ============================================= */
@media (max-width:768px){
  /* Header */
  .header-inner{height:60px}
  .site-logo__main{font-size:19px}
  .site-logo__sub{font-size:8px;letter-spacing:2px}
  .header-cta .btn--primary{display:none}

  /* Hamburger */
  .nav-toggle{display:flex}
  .nav-toggle[aria-expanded="true"] span:nth-child(1){transform:rotate(45deg) translate(4px,4px)}
  .nav-toggle[aria-expanded="true"] span:nth-child(2){opacity:0;transform:scaleX(0)}
  .nav-toggle[aria-expanded="true"] span:nth-child(3){transform:rotate(-45deg) translate(4px,-4px)}

  /* Mobile nav */
  .main-nav{
    display:none;
    position:fixed;
    top:60px;left:0;right:0;
    height:calc(100dvh - 60px);
    background:var(--navy-dark);
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior:contain;
    padding:0 0 40px;
    z-index:998;
    flex-direction:column;
    border-top:2px solid var(--accent2);
  }
  .main-nav.mobile-open{display:flex}

  .nav-item{height:auto;width:100%;flex-direction:column;align-items:flex-start;border-bottom:1px solid rgba(255,255,255,.07)}
  .nav-link{height:auto;width:100%;padding:14px 20px;font-size:15px;font-weight:600;border-bottom:none !important;justify-content:space-between}
  .nav-link:hover,.nav-item.is-open > .nav-link{background:rgba(255,255,255,.06);border-bottom:none !important}
  .nav-arrow{width:14px;height:14px}

  /* Mobile dropdowns — все сбрасываем на статик */
  .dropdown,.dropdown.mega,.dropdown.mega-xl{
    position:static !important;
    display:none;
    transform:none !important;
    border-top:none;
    border-left:3px solid var(--accent2);
    border-radius:0;
    box-shadow:none;
    margin:0 0 0 20px;
    width:calc(100% - 20px);
    max-width:none;
    min-width:0 !important;
    background:rgba(255,255,255,.04);
    animation:none;
    overflow:visible;
  }
  .nav-item.is-open > .dropdown{display:block}

  /* Dropdown links mobile */
  .dd-list a{color:rgba(255,255,255,.8);font-size:13px;padding:10px 16px;min-height:44px}
  .dd-list a:hover{background:rgba(255,255,255,.07);color:var(--white)}
  .dd-divider{background:rgba(255,255,255,.1)}
  .dd-list .dd-price{color:var(--accent2)}
  .dd-list .dd-hot{background:rgba(232,86,10,.3);color:#ffb394}

  /* Mega mobile */
  .mega-body{display:block;padding:4px 0}
  .mega-col{margin:0}
  .mega-col-title{font-size:10px;color:rgba(255,255,255,.4);padding:10px 16px 4px;border-bottom:none;margin:0}
  .mega-col ul li a{color:rgba(255,255,255,.8);border-radius:0;padding:10px 16px;min-height:44px}
  .mega-col ul li a:hover{background:rgba(255,255,255,.07);color:var(--white)}
  .mega-col ul li a .p{color:var(--accent2)}
  .mega-col ul li a .hot{background:rgba(232,86,10,.3);color:#ffb394}
  .mega-promo{display:none}

  /* По направлениям mobile */
  .mega-sidebar-wrap{display:block}
  .mega-sidebar{display:none}
  .mega-panels-wrap{display:block}
  .mega-panel{display:block !important;padding:0;animation:none}
  .mega-panel h4,.mega-panel .sub{display:none}
  .work-grid{display:block}
  .work-card{display:flex;align-items:center;justify-content:space-between;background:transparent;border:none;border-bottom:1px solid rgba(255,255,255,.07);border-radius:0;padding:10px 16px;min-height:44px}
  .work-card:hover{transform:none;box-shadow:none;border-color:rgba(255,255,255,.15)}
  .work-card .name{color:rgba(255,255,255,.8);font-size:13px}
  .work-card .from{color:var(--accent2);font-size:11px}

  /* Hero */
  .hero{padding:44px 0 40px}
  .hero__label{font-size:11px;padding:5px 12px;margin-bottom:14px}
  .hero__title{font-size:clamp(24px,6vw,34px);margin-bottom:14px}
  .hero__desc{font-size:14px;margin-bottom:20px}
  .hero__badges{gap:8px;margin-bottom:24px}
  .hero__badge{font-size:12px;padding:6px 12px}
  .hero__actions{flex-direction:column;gap:10px}
  .hero__actions .btn{width:100%;justify-content:center}
  .hero__form-card{display:none !important}
  .hero__mobile-cta{display:block;margin-top:20px;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.15);border-radius:var(--radius);padding:16px 20px;text-align:center}

  /* Stats */
  .stats-strip{padding:24px 0}
  .stats-grid{grid-template-columns:repeat(2,1fr)}
  .stat-item{padding:12px 16px}
  .stat-num{font-size:28px}
  .stat-label{font-size:12px}

  /* Grids */
  .grid-2,.grid-3{grid-template-columns:1fr}
  .grid-4{grid-template-columns:repeat(2,1fr);gap:12px}
  .grid-auto{grid-template-columns:1fr}
  .posts-grid{grid-template-columns:1fr}
  .reviews-grid{grid-template-columns:1fr}
  .guarantee-grid{grid-template-columns:1fr;gap:12px}
  .guarantee-card{display:flex;gap:16px;text-align:left;align-items:flex-start;padding:18px}
  .guarantee-card__icon{font-size:28px;flex-shrink:0;margin-bottom:0}

  /* Sections */
  .section{padding:40px 0}
  .section--lg{padding:52px 0}
  .section-title{margin-bottom:8px}
  .section-sub{font-size:14px;margin-bottom:28px}
  .mb-48{margin-bottom:28px}

  /* Steps */
  .steps-grid{grid-template-columns:repeat(2,1fr);gap:16px}
  .steps-grid::before{display:none}
  .step__num{width:52px;height:52px;font-size:20px}

  /* Page hero */
  .page-hero{padding:32px 0 28px}
  .page-hero__title{font-size:clamp(20px,5vw,30px)}
  .page-hero__desc{font-size:14px}
  .page-hero__meta{flex-wrap:wrap;gap:10px;margin-top:14px}
  .page-hero__breadcrumb{font-size:11px}

  /* Service page */
  .service-page-grid{grid-template-columns:1fr}
  .order-sidebar{position:static}
  .order-card{padding:18px}
  .order-card__price{font-size:24px}

  /* Price */
  .price-filter{gap:6px}
  .filter-btn{padding:7px 14px;font-size:12px}

  /* Single post */
  .single-layout{grid-template-columns:1fr}
  .post-content{padding:22px 18px}

  /* Contact */
  .contact-grid{grid-template-columns:1fr}

  /* FAQ */
  .faq-question{font-size:14px;padding:13px 16px}

  /* CTA */
  .cta-section{padding:44px 0}
  .cta-section__title{font-size:clamp(18px,5vw,28px)}
  .cta-section__desc{font-size:14px;margin-bottom:20px}
  .cta-section__actions{flex-direction:column;align-items:center;gap:10px}
  .cta-section__actions .btn{width:100%;max-width:320px;justify-content:center}
  .cta-bonus{font-size:12px;padding:6px 14px;margin-bottom:16px}

  /* Footer */
  .site-footer{padding:36px 0 0}
  .footer-grid{grid-template-columns:1fr;gap:24px;padding-bottom:28px}
  .footer-brand p{font-size:12px}
  .footer-col-title{margin-bottom:10px}
  .footer-nav li{margin-bottom:6px}
  .footer-nav a{font-size:12px}
  .footer-bottom{flex-direction:column;gap:6px;text-align:center;font-size:11px;padding:14px 0}

  /* Antiplagiat */
  .antiplagiat-levels{grid-template-columns:repeat(3,1fr)}

  /* Forms — prevent iOS zoom */
  .form-control{font-size:16px}
  select.form-control{font-size:16px}
}

/* =============================================
   RESPONSIVE ≤ 480px
   ============================================= */
@media (max-width:480px){
  .container{padding:0 14px}
  .header-inner{height:56px}
  .main-nav{top:56px;height:calc(100dvh - 56px)}
  .site-logo__main{font-size:17px}
  .site-logo__sub{display:none}
  .hero{padding:32px 0}
  .hero__label{display:none}
  .hero__title{font-size:clamp(21px,7vw,26px)}
  .hero__badges{display:grid;grid-template-columns:1fr 1fr;gap:6px}
  .hero__badge{font-size:11px;padding:6px 8px}
  .steps-grid{grid-template-columns:1fr;gap:14px}
  .step{display:flex;align-items:flex-start;gap:14px;text-align:left}
  .step__num{width:44px;height:44px;font-size:18px;flex-shrink:0;margin:0;box-shadow:none}
  .grid-4{grid-template-columns:1fr}
  .stat-num{font-size:24px}
  .btn--lg{padding:13px 20px;font-size:14px}
  .page-hero{padding:24px 0}
  .page-hero__title{font-size:clamp(18px,6vw,24px)}
  .price-filter{flex-wrap:nowrap;overflow-x:auto;padding-bottom:6px;-webkit-overflow-scrolling:touch;gap:6px}
  .filter-btn{flex-shrink:0}
  .antiplagiat-levels{grid-template-columns:repeat(2,1fr)}
  .section{padding:28px 0}
}

/* =============================================
   RESPONSIVE ≤ 360px
   ============================================= */
@media (max-width:360px){
  .container{padding:0 10px}
  .hero__badges{grid-template-columns:1fr}
  .stats-grid{grid-template-columns:1fr}
  .stat-item{border-right:none !important;border-bottom:1px solid rgba(255,255,255,.1)}
  .grid-4{grid-template-columns:1fr}
  .antiplagiat-levels{grid-template-columns:1fr 1fr}
}

/* TOUCH */
@media (hover:none) and (pointer:coarse){
  .nav-link,.btn{min-height:48px}
  .dd-list a,.work-card{min-height:44px}
  .faq-question{min-height:52px}
  .filter-btn{min-height:40px}
  .form-control{min-height:48px}
  .service-card:hover,.post-card:hover,.work-card:hover{transform:none}
}

/* PRINT */
@media print{
  .site-header,.site-footer,.cta-section,.nav-toggle,.order-sidebar,.hero__form-card{display:none !important}
  body{font-size:12pt;color:#000;background:#fff}
  a{color:#000;text-decoration:underline}
  .container{max-width:100%;padding:0}
  .page-hero{background:none !important;color:#000;padding:20px 0}
  .page-hero__title,.page-hero__desc,.page-hero__breadcrumb{color:#000 !important}
}