/* ==========================================================================
   Lestan Theme - Main Styles
   ========================================================================== */

/* CSS Variables */
:root {
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-primary-light: #3b82f6;
    --color-secondary: #64748b;
    --color-success: #22c55e;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-dark: #1e293b;
    --color-light: #f8fafc;
    --color-white: #ffffff;
    --color-gray-100: #f1f5f9;
    --color-gray-200: #e2e8f0;
    --color-gray-300: #cbd5e1;
    --color-gray-400: #94a3b8;
    --color-gray-500: #64748b;
    --color-gray-600: #475569;
    --color-gray-700: #334155;
    --color-gray-800: #1e293b;
    --color-gray-900: #0f172a;

    --font-family: 'Exo 2', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-base: 16px;
    --line-height-base: 1.6;

    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;

    --border-radius-sm: 0.25rem;
    --border-radius-md: 0.5rem;
    --border-radius-lg: 1rem;
    --border-radius-xl: 1.5rem;
    --border-radius-full: 9999px;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: var(--line-height-base);
    color: var(--color-gray-800);
    background-color: var(--color-white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-dark);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-gray-900);
    margin-bottom: var(--spacing-md);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: var(--spacing-md);
}

.lead {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--color-gray-600);
}

/* Container */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 0.75rem 1.5rem;
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    color: var(--color-white);
}

.btn-outline-primary {
    background-color: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-outline-primary:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
}

/* Header */
#layout-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

/* =====================================================
   НОВАЯ ШАПКА - ДВЕ ПОЛОСЫ
   ===================================================== */

/* Верхняя чёрная полоса */
.header-top-bar {
    background: #1a1a1a;
    padding: 0.625rem 0;
}

.header-top-content {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    flex-direction: row !important;
}

.header-top-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.top-contact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.top-contact:hover {
    opacity: 0.8;
    color: #ffffff;
}

.top-contact svg {
    color: #22c55e;
    flex-shrink: 0;
}

.top-address {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ffffff;
    font-size: 0.875rem;
}

.top-address svg {
    color: #ef4444;
    flex-shrink: 0;
}

.header-top-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.top-social {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: #ffffff;
    font-size: 0.875rem;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.top-social:hover {
    opacity: 0.8;
    color: #ffffff;
}

.top-lang {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-left: 0.5rem;
}

.top-lang-link {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.top-lang-link:hover,
.top-lang-link.active {
    color: #ffffff;
}

.top-lang-divider {
    color: rgba(255, 255, 255, 0.4);
}

.top-lang-flags {
    display: none;
}

.top-lang-flag {
    display: inline-flex;
    padding: 0.25rem;
    border-radius: 4px;
    transition: opacity 0.2s ease;
}

.top-lang-flag:hover {
    opacity: 0.8;
}

.top-lang-flag svg {
    display: block;
    border-radius: 2px;
    overflow: hidden;
}

/* Нижняя белая полоса */
.header-main-bar {
    background: #ffffff;
    padding: 0.75rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.header-main-content {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    flex-direction: row !important;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo img {
    height: 44px;
    width: auto;
}

.header-slogan {
    font-size: 0.8125rem;
    color: #64748b;
    line-height: 1.4;
    border-left: 1px solid #e2e8f0;
    padding-left: 1rem;
}

.header-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.header-nav .nav-list,
.nav-list {
    display: flex !important;
    list-style: none !important;
    gap: 0;
    margin: 0;
    padding: 0;
    flex-direction: row !important;
}

.header-nav .nav-list > li {
    position: relative;
}

.header-nav .nav-list > li > a {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #1e293b;
    transition: color 0.2s ease;
}

.header-nav .nav-list > li > a:hover {
    color: #3b82f6;
}

.header-nav .nav-list > li > a.active {
    color: #3b82f6;
}

/* Разделители между пунктами меню */
.header-nav .nav-list > li:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 14px;
    background-color: #e2e8f0;
}

.header-cta {
    display: inline-flex;
    align-items: center;
    padding: 0.625rem 1.25rem;
    background: #3b82f6;
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.header-cta:hover {
    background: #2563eb;
    color: #ffffff;
}

/* Навигационный пункт-переключатель dropdown (без перехода) */
.nav-dropdown-toggle {
    cursor: default;
}

/* Dropdown arrow */
.dropdown-arrow {
    transition: transform 0.2s ease;
    opacity: 0.5;
    color: #64748b;
}

.has-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
    color: #3b82f6;
}

/* Dropdown menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    min-width: 220px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    list-style: none;
    z-index: 100;
    margin-top: 0;
    border: 1px solid #e5e7eb;
}

.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-menu li a {
    display: block;
    padding: 0.875rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    transition: background-color 0.2s ease, color 0.2s ease;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.dropdown-menu li a:hover {
    background-color: #f3f4f6;
    color: #3b82f6;
}

.dropdown-menu li:first-child a {
    border-radius: 8px 8px 0 0;
}

.dropdown-menu li:last-child a {
    border-radius: 0 0 8px 8px;
}

/* Услуги — выпадающее меню в 2 колонки */
.dropdown-menu--cols-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-width: 420px;
}

.dropdown-menu--cols-2 li:nth-child(1) a {
    border-radius: 8px 8px 0 0;
}

.dropdown-menu--cols-2 li:nth-child(3) a {
    border-radius: 0 0 0 8px;
}

.dropdown-menu--cols-2 li:nth-child(4) a {
    border-radius: 0 8px 8px 0;
}

.dropdown-menu--cols-2 li:nth-child(6) a {
    border-radius: 0 0 8px 8px;
}

/* CTA Button */
.btn-cta {
    background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 100%);
    color: #1e40af;
    padding: 0.75rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    margin-left: 1.5rem;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

.btn-cta:hover {
    background: linear-gradient(135deg, #ffffff 0%, #c7d2fe 100%);
    color: #1e3a8a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.4);
}

/* Main Content */
#layout-content {
    flex: 1;
    padding-top: 114px; /* Высота header: top-bar(46) + main-bar(68) */
}

/* Footer */
#layout-footer {
    background-color: #1a1a1a;
    color: #9ca3af;
    margin-top: auto;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 1.5rem;
}

.footer-main {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 3rem;
    margin-bottom: 2.5rem;
}

/* Footer Brand */
.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-logo img {
    height: 40px;
    width: auto;
    filter: brightness(0) invert(1);
}

.footer-description {
    color: #9ca3af;
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 0;
}

.footer-socials {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.footer-social {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #2d2d2d;
    color: #9ca3af;
    transition: all 0.2s ease;
}

.footer-social:hover {
    background: #3b82f6;
    color: #ffffff;
}

/* Footer Columns */
.footer-column {
    text-align: left;
}

.footer-column h4 {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
}

.footer-links {
    list-style: none;
    padding: 0 0 0 0.75rem;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.625rem;
}

.footer-links a {
    color: #9ca3af;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #ffffff;
}

/* Footer Contact List */
.footer-contact-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    color: #9ca3af;
    font-size: 0.875rem;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.footer-contact-item svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: #6b7280;
}

a.footer-contact-item:hover {
    color: #ffffff;
}

a.footer-contact-item:hover svg {
    color: #3b82f6;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #2d2d2d;
    padding-top: 1.25rem;
}

.footer-bottom p {
    color: #6b7280;
    font-size: 0.8125rem;
    margin: 0;
}

.footer-bottom-center {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    font-size: 0.8125rem;
}

.footer-developer {
    display: flex;
    align-items: center;
}

.wemake-logo {
    height: 18px;
    width: auto;
    transition: opacity 0.2s ease;
}

.footer-developer:hover .wemake-logo {
    opacity: 0.8;
}

.footer-bottom-links {
    display: flex;
    gap: 1.5rem;
}

.footer-bottom-links a {
    color: #6b7280;
    font-size: 0.8125rem;
    transition: color 0.2s ease;
}

.footer-bottom-links a:hover {
    color: #ffffff;
}

/* Alerts */
.alert {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--border-radius-md);
    margin-bottom: var(--spacing-md);
}

.alert-success {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.alert-danger,
.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* Responsive */
@media (max-width: 1200px) {
    .header-top-left {
        gap: 1rem;
    }
    
    .top-address {
        display: none;
    }
}

/* Бургер-кнопка — скрыта на десктопе */
.burger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.burger-btn:hover {
    background: #f1f5f9;
}

.burger-line {
    display: block;
    width: 22px;
    height: 2px;
    background: #1e293b;
    border-radius: 1px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.burger-btn.is-active .burger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.burger-btn.is-active .burger-line:nth-child(2) {
    opacity: 0;
}

.burger-btn.is-active .burger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Мобильное меню — скрыто по умолчанию */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    pointer-events: none;
    visibility: hidden;
    transition: visibility 0.3s ease;
}

.mobile-menu-overlay.is-open {
    pointer-events: auto;
    visibility: visible;
}

.mobile-menu-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.is-open .mobile-menu-backdrop {
    opacity: 1;
}

.mobile-menu-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 320px;
    height: 100%;
    background: #ffffff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.mobile-menu-overlay.is-open .mobile-menu-panel {
    transform: translateX(0);
}

.mobile-menu-nav {
    flex: 1;
    padding: 1.5rem 0;
}

.mobile-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-menu-list > li {
    border-bottom: 1px solid #e2e8f0;
}

.mobile-menu-list > li > a,
.mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 1.5rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    color: #1e293b;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s ease, color 0.2s ease;
}

.mobile-menu-list > li > a:hover,
.mobile-menu-toggle:hover {
    background: #f8fafc;
    color: #3b82f6;
}

.mobile-menu-list > li > a.active {
    color: #3b82f6;
}

.mobile-menu-arrow {
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.mobile-menu-sub.is-open .mobile-menu-arrow {
    transform: rotate(180deg);
}

.mobile-menu-sublist {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #f8fafc;
}

.mobile-menu-sublist.is-open {
    max-height: 500px;
}

.mobile-menu-sublist a {
    display: block;
    padding: 0.75rem 1.5rem 0.75rem 2.5rem;
    font-size: 0.9375rem;
    color: #475569;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.mobile-menu-sublist a:hover {
    background: #f1f5f9;
    color: #3b82f6;
}

.mobile-menu-cta {
    display: block;
    margin: 1rem 1.5rem 1.5rem;
    padding: 1rem 1.5rem;
    background: #3b82f6;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.mobile-menu-cta:hover {
    background: #2563eb;
    color: #ffffff;
}

body.menu-open {
    overflow: hidden;
}

@media (max-width: 992px) {
    .burger-btn {
        display: flex;
    }

    .header-nav {
        display: none !important;
    }

    .header-top-content {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .header-main-content {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .header-cta {
        display: none !important;
    }

    .top-lang-text {
        display: none;
    }

    .top-lang-flags {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
}

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

    #layout-content {
        padding-top: 106px; /* Высота header на мобильной: top-bar + main-bar */
    }

    .header-top-bar {
        padding: 0.5rem 0;
    }
    
    .header-top-left {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .header-top-right {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .header-slogan {
        display: none;
    }
    
    .header-nav .nav-list > li > a {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }

    .footer-main {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .footer-brand {
        grid-column: span 2;
        align-items: center;
        text-align: center;
    }

    .footer-socials {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .footer-main {
        grid-template-columns: 1fr;
    }

    .footer-brand {
        grid-column: span 1;
    }

    .footer-logo {
        display: none;
    }

    .footer-column {
        text-align: left;
    }

    .footer-contact-list {
        align-items: flex-start;
    }
}

/* ==========================================================================
   Page Hero Section (Reusable Component)
   ========================================================================== */

.page-hero {
    position: relative;
    padding: 6rem 0 3rem;
    overflow: hidden;
    min-height: 280px;
    display: flex;
    align-items: center;
}

.page-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: 0;
}

.page-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.75);
    z-index: 1;
}

.page-hero-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.04);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    z-index: 2;
    pointer-events: none;
    user-select: none;
}

.page-hero .container {
    position: relative;
    z-index: 3;
}

.page-hero-title {
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.75rem;
    letter-spacing: -0.02em;
}

.page-hero-subtitle {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 1.25rem;
    max-width: 700px;
}

.page-hero-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

.page-hero-breadcrumbs a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s ease;
}

.page-hero-breadcrumbs a:hover {
    color: #fff;
}

.page-hero-breadcrumbs .current {
    color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .page-hero {
        padding: 5rem 0 2rem;
        min-height: 220px;
    }

    .page-hero-breadcrumbs {
        display: none;
    }

    .page-hero-title {
        font-size: 2.25rem;
    }

    .page-hero-subtitle {
        font-size: 1rem;
    }

    .page-hero-watermark {
        font-size: 6rem;
    }
}
