/* SLComp Theme - Main Stylesheet */

/* ============================================
   Variables & Colors
   ============================================ */
:root {
    --color-primary: #2379bd;
    --color-primary-light: #588ec4;
    --color-accent: #ff0000;
    --color-white: #ffffff;
    --color-bg: #f2f2f2;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-border: #dddddd;
    --color-black: #000000;

    --font-heading: 'Comfortaa', cursive;
    --font-body: 'Roboto', sans-serif;
    --font-button: 'Lato', sans-serif;

    --container-width: 1200px;
    --header-height: 80px;
    --transition: 0.3s ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    background-color: var(--color-bg);
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    line-height: 1.6;
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

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

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

ul { list-style: none; }

#wrapper {
    background-color: var(--color-bg);
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   Header
   ============================================ */
#header {
    background: var(--color-white);
    position: relative;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.logo img {
    max-height: 60px;
    width: auto;
}

/* Navigation — Betheme style */
.main-nav {
    flex: 1;
    text-align: right;
}

.main-nav .nav-menu {
    display: inline-flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-nav .nav-menu > li {
    position: relative;
}

.main-nav .nav-menu > li > a {
    display: block;
    padding: 12px 18px;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: var(--color-primary);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-radius: 6px;
}

.main-nav .nav-menu > li > a:hover,
.main-nav .nav-menu > li.current-menu-item > a,
.main-nav .nav-menu > li.current-menu-parent > a {
    color: var(--color-accent);
    background: #e0e0e0;
}

.main-nav .nav-menu > li.menu-item-has-children > a:hover {
    background: #e0e0e0;
}

.main-nav .nav-menu > li.menu-item-has-children > a {
    padding-right: 26px;
    position: relative;
}

.main-nav .nav-menu > li.menu-item-has-children > a::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    margin-top: -2px;
    border: 4px solid transparent;
    border-top-color: var(--color-primary);
}

/* Submenu */
.main-nav .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-white);
    min-width: 220px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.12);
    z-index: 100;
    padding: 10px 0;
    border-top: 2px solid var(--color-primary);
}

.main-nav .nav-menu > li:hover > .sub-menu {
    display: block;
}

.main-nav .sub-menu li {
    position: relative;
}

.main-nav .sub-menu .sub-menu {
    top: -10px;
    left: 100%;
    margin-left: 2px;
    border-top: 2px solid var(--color-primary);
}

.main-nav .sub-menu a {
    display: block;
    padding: 8px 22px;
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: var(--color-text);
    font-weight: 400;
    transition: color var(--transition);
    border-radius: 4px;
}

.main-nav .sub-menu a:hover {
    color: var(--color-primary);
    background: #e0e0e0;
}

.main-nav .sub-menu .menu-item-has-children > a::after {
    content: '›';
    float: right;
    font-size: 1.2rem;
    color: #999;
}

/* Menu Toggle (mobile) */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: none;
    border: 2px solid var(--color-primary);
    border-radius: 4px;
    cursor: pointer;
    padding: 8px;
    gap: 4px;
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--color-primary);
    transition: transform var(--transition), opacity var(--transition);
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}
.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}
.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

/* =============================================
   Hero Section — matching original LayerSlider
   ============================================= */
.hero {
    position: relative;
    background: url('../images/hero-bg.jpg') no-repeat center top / cover;
    background-color: #1a5276;
    overflow: hidden;
}

.hero-body {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 420px;
    padding: 40px 20px;
    gap: 30px;
}

.hero-text-col {
    text-align: center;
    flex: 1;
}

.hero-badge {
    max-width: 100%;
    height: auto;
    margin-bottom: 10px;
}

.hero-subtitle {
    font-family: 'Poiret One', cursive;
    font-size: 1.6rem;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
    margin-bottom: 15px;
}

.hero-arrow {
    margin: 0 auto;
}

.hero-img-col {
    flex: 0 0 auto;
    max-width: 45%;
}

.hero-illustration {
    max-width: 100%;
    height: auto;
}

.hero-topline {
    margin-bottom: 20px;
}

.hero-badge {
    max-width: 100%;
    height: auto;
}

.hero-subtitle {
    font-family: 'Poiret One', cursive;
    font-size: 1.6rem;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.hero-img-col {
    flex: 0 0 auto;
    max-width: 45%;
}

.hero-illustration {
    max-width: 100%;
    height: auto;
}

/* Entrance animations */
.animate-in {
    opacity: 0;
    transform: translateY(30px);
    animation: heroEntrance 0.8s ease forwards;
}

.animate-in:nth-child(1) { animation-delay: 0.2s; }
.animate-in:nth-child(2) { animation-delay: 0.5s; }
.animate-in:nth-child(3) { animation-delay: 0.8s; }

@keyframes heroEntrance {
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   Content — Betheme-compatible layout
   ============================================ */
#content {
    padding: 30px 20px;
    min-height: 400px;
}

.home #content h1,
.home #content h2,
.home #content h3 {
    text-align: center;
}

.page-title {
    text-align: left;
}

/* Headings */
#content h1 { font-family: var(--font-heading); font-size: 1.75rem; color: var(--color-primary); margin-bottom: 15px; line-height: 1.3; }
#content h2 { font-family: var(--font-heading); font-size: 1.5rem; color: var(--color-primary); margin-bottom: 12px; line-height: 1.3; }
#content h3 { font-family: var(--font-heading); font-size: 1.25rem; color: var(--color-primary); margin-bottom: 10px; line-height: 1.3; }
#content h4 { font-family: var(--font-heading); font-size: 1.1rem; color: var(--color-primary); margin-bottom: 8px; line-height: 1.3; }
#content h5, #content h6 { font-family: var(--font-heading); color: var(--color-primary); }

#content p {
    margin-bottom: 15px;
    line-height: 1.7;
}

#content strong { font-weight: 700; }

/* Images — Betheme alignment rules */
#content img {
    max-width: 100%;
    height: auto;
}

#content img.alignleft,
#content .alignleft img {
    float: left;
    margin: 5px 20px 15px 0;
    display: inline;
}

#content img.alignright,
#content .alignright img {
    float: right;
    margin: 5px 0 15px 20px;
    display: inline;
}

#content img.aligncenter,
#content .aligncenter img {
    display: block;
    margin: 10px auto;
    clear: both;
}

#content img.alignnone {
    margin: 5px 0 15px 0;
}

#content .alignleft {
    float: left;
    margin: 5px 20px 15px 0;
}

/* Homepage: image + 4 service items side by side
   h2:3-6 = 4 строки с иконками, h2:2 = большая картинка */
.home #content h2:first-of-type img.alignleft {
    float: left;
    margin-right: 10px;
    margin-bottom: 20px;
}

.home #content h2:nth-of-type(3),
.home #content h2:nth-of-type(4),
.home #content h2:nth-of-type(5),
.home #content h2:nth-of-type(6) {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0;
    margin-left: 313px;
    line-height: 1.6;
    padding: 8px 16px;
    border-left: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    background: #fff;
    text-align: left !important;
    width: 420px;
    box-sizing: border-box;
}

.home #content h2:nth-of-type(3) {
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    transition: box-shadow 0.3s;
}

.home #content h2:nth-of-type(6) {
    padding-bottom: 16px;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 0 0 8px 8px;
}

/* Hover: shadow on the whole card */
.home #content article:has(h2:nth-of-type(3):hover) h2:nth-of-type(3),
.home #content article:has(h2:nth-of-type(4):hover) h2:nth-of-type(3),
.home #content article:has(h2:nth-of-type(5):hover) h2:nth-of-type(3),
.home #content article:has(h2:nth-of-type(6):hover) h2:nth-of-type(3) {
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.home #content h2:nth-of-type(3) img,
.home #content h2:nth-of-type(4) img,
.home #content h2:nth-of-type(5) img,
.home #content h2:nth-of-type(6) img {
    display: inline;
    vertical-align: middle;
    margin: 0 5px 0 0;
}

.home #content h2:nth-of-type(3) {
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.home #content h2:nth-of-type(6) {
    padding-bottom: 16px;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 0 0 8px 8px;
}

.home #content h2:nth-of-type(3) img,
.home #content h2:nth-of-type(4) img,
.home #content h2:nth-of-type(5) img,
.home #content h2:nth-of-type(6) img {
    display: inline;
    vertical-align: middle;
    margin: 0 5px 0 0;
}

.home #content h2:nth-of-type(3):hover,
.home #content h2:nth-of-type(4):hover,
.home #content h2:nth-of-type(5):hover,
.home #content h2:nth-of-type(6):hover {
    color: var(--color-accent);
}

#content .alignright {
    float: right;
    margin: 5px 0 15px 20px;
}

#content .aligncenter {
    display: block;
    margin: 10px auto;
}

/* Lists — Betheme style */
#content ul, #content ol {
    margin: 0 0 15px 30px;
    padding: 0;
}

#content ul {
    list-style: disc outside;
}

#content ul li, #content ol li {
    margin-bottom: 5px;
    padding-left: 0;
}

#content ul li ul {
    margin-left: 20px;
}

#content ul li ul li {
    list-style: circle;
}

/* Inline images in paragraphs */
#content p img {
    display: inline-block;
    vertical-align: middle;
}

/* Table */
#content table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

#content table td, #content table th {
    border: 1px solid #ddd;
    padding: 8px;
}

/* Blockquote */
#content blockquote {
    border-left: 4px solid var(--color-primary);
    padding: 10px 20px;
    margin: 15px 0;
    font-style: italic;
    background: #f9f9f9;
}

/* Clearfix for floated content */
#content:after {
    content: '';
    display: table;
    clear: both;
}

/* Image + text side by side (Windows page) */
#content .win-section {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

#content .win-section img {
    flex-shrink: 0;
}

#content .win-section .win-text {
    flex: 1;
}

/* Contacts Page — phone image big, carousel 3 visible
   ============================================ */
.ms-contacts {
    max-width: 600px;
    margin: 20px auto;
}

.ms-contact-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.ms-contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ms-big-icon {
    width: 100px !important;
    height: auto;
    border-radius: 8px;
}

.ms-contact-item img {
    width: auto;
    height: auto;
}

.ms-phone {
    color: var(--color-accent) !important;
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
}
.ms-phone:hover { color: #cc0000 !important; }

/* Carousel — 3 visible, no arrows, transparent bg */
.ms-carousel {
    position: relative;
    max-width: 640px;
    margin: 20px auto;
    overflow: hidden;
}

.ms-track {
    display: flex;
    transition: transform 0.5s ease;
}

.ms-slide {
    min-width: 33.333%;
    box-sizing: border-box;
    text-align: center;
    padding: 6px;
}

.ms-slide img {
    width: 100%;
    height: auto;
    max-height: 180px;
    object-fit: contain;
    display: block;
}

/* ============================================
   Footer
   ============================================ */
#footer {
    background-image: url('../images/texture.jpg');
    background-repeat: repeat;
    background-position: left top;
    color: #999;
}

.footer-action {
    padding: 40px 0;
    text-align: center;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.footer-action-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.footer-action-icon {
    width: 50px;
    height: auto;
}

.footer-action h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: #99c2e0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-copy {
    padding: 30px 0;
}

.footer-copy-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    text-align: center;
}

.footer-phone {
    font-size: 1.5rem;
    font-weight: 700;
}

.phone-icon {
    margin-right: 8px;
}

.footer-phone a {
    color: var(--color-accent);
}
.footer-phone a:hover {
    color: #cc0000;
}

.copyright p {
    font-size: 0.875rem;
    line-height: 1.6;
}

.copyright a {
    color: #99c2e0;
}

/* Scroll to Top — creative button */
#scroll-top {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary) 0%, #1a5276 100%);
    color: var(--color-white);
    font-size: 1.4rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition), transform var(--transition), box-shadow var(--transition);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(35, 121, 189, 0.4);
    line-height: 1;
}

#scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

#scroll-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 25px rgba(35, 121, 189, 0.6);
    background: linear-gradient(135deg, #2980b9 0%, #1a5276 100%);
}

#scroll-top::before {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 12px solid #fff;
    margin-top: 2px;
}

/* ============================================
   Error 404
   ============================================ */
.error-404-inner {
    text-align: center;
    padding: 80px 20px;
}

.error-404-inner h1 {
    font-family: var(--font-heading);
    font-size: 6rem;
    color: var(--color-primary);
    margin-bottom: 10px;
}

.error-404-inner p {
    font-size: 1.25rem;
    margin-bottom: 30px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--color-primary);
    color: var(--color-white);
    font-family: var(--font-button);
    font-weight: 700;
    border-radius: 4px;
    transition: background var(--transition);
}

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

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 991px) {
    :root {
        --header-height: 60px;
    }

    .menu-toggle {
        display: flex;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--color-white);
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        z-index: 999;
        text-align: left;
    }

    .main-nav.open {
        display: block;
    }

    .main-nav .nav-menu {
        display: block;
    }

    .main-nav .nav-menu > li > a {
        padding: 12px 20px;
        border-bottom: 1px solid var(--color-bg);
        font-size: 0.85rem;
    }

    .main-nav .sub-menu {
        position: static;
        box-shadow: none;
        padding-left: 20px;
        background: var(--color-bg);
        display: none;
        border-top: none;
    }

    .main-nav .nav-menu > li:hover > .sub-menu {
        display: none;
    }

    .main-nav .nav-menu > li.open > .sub-menu {
        display: block;
    }

    .main-nav .sub-menu .sub-menu {
        left: 0;
        border-top: none;
    }

    .hero-body {
        flex-direction: column;
        text-align: center;
    }
    .hero-img-col {
        max-width: 70%;
    }
    .hero-subtitle {
        font-size: 1.25rem;
    }
}

@media (max-width: 640px) {
    #scroll-top {
        display: none;
    }

    .hero-main {
        min-height: auto;
        padding: 30px 0;
    }
    .hero-body {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    .hero-img-col {
        max-width: 80%;
    }
    .hero-subtitle {
        font-size: 1rem;
    }

    .footer-action-inner {
        flex-direction: column;
    }
    .footer-phone {
        font-size: 1.2rem;
    }

    #content h1 { font-size: 1.4rem; }
    #content h2 { font-size: 1.2rem; }

    .ms-slide img { max-height: 120px; }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.15rem;
        letter-spacing: 1px;
    }
    .hero-subtitle {
        font-size: 0.875rem;
    }

    .ms-contact-row { flex-direction: column; gap: 15px; }
}