/*
Theme Name: Energocert
Theme URI: https://energocert.ru
Author: Your Name
Author URI: https://energocert.ru
Description: Minimalistic theme for Energocert company
Version: 1.0
Requires at least: 6.0
Tested up to: 6.5
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: energocert
*/

/* Base Styles */
:root {
    --primary-color: var(--wp--custom--theme-primary);
    --secondary-color: var(--wp--custom--theme-secondary);
    --text-color: var(--wp--custom--theme-text);
    --link-hover-color: var(--wp--custom--theme-link-hover);
}


body {
    font-family: var(--wp--preset--font-family--scada);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--wp--preset--font-family--pt-sans-narrow);
    font-weight: 700;
    color: var(--secondary-color);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--link-hover-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header Styles */
.header-container {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
    z-index: 100;
}

.header-top {
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.site-description {
    font-size: 14px;
    color: var(--text-color);
    margin: 0;
    line-height: 1.4;
}

.header-contacts {
    font-size: 14px;
    line-height: 1.6;
}

.header-phone {
    font-weight: 600;
    color: var(--secondary-color);
}

.header-email {
    color: var(--primary-color);
    font-weight: 500;
}


/* Общая ширина колонок на десктопе */
.sidebar-right,
.header-right-col {
    width: 300px;
    min-width: 300px;
    max-width: 300px;
    flex-shrink: 0;
}

/* Flex-контейнер для контент + сайдбар */
.page-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* Хлебные крошки */
.breadcrumbs {
    font-weight: bold;
    font-style: italic;
    font-size: 12px;
    margin-left: 0;
    margin-top: 10px;
    margin-bottom: 20px;
}


/* Контент — остальная ширина */
.page-content {
    flex: 1;
    min-width: 0;
}

.sticky-contacts {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    padding: 15px;
    z-index: 9999;
    display: none;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.sticky-contacts.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.sticky-contacts.hidden {
    opacity: 0;
    transform: translateY(20px);
}


/* Top Navigation */
/* Основное меню встроенное в поток */
.top-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    padding: 0;
    margin: 0;
    list-style: none;
    font-size: 15px;
    border-bottom: 1px solid #dcdcdc;
    gap: 0;
}

/* Элементы меню */
.top-nav > li {
    position: relative;
    margin: 0;
    list-style: none;
    background: #ffffff;
}

.top-nav > li > a {
    display: block;
    padding: 8px 14px;
    color: #333;
    text-decoration: none;
    font-weight: normal;
    border-left: 1px solid #dcdcdc;
    border-right: 1px solid #dcdcdc;
    opacity: 0.85;
    transition: all 0.3s ease;
}

.top-nav > li > a:hover {
    background-color: #54b5fc;
    color: #000;
    opacity: 1;
}

/* Подсветка активного пункта */
.top-nav > li.current-menu-item > a,
.top-nav > li.current_page_item > a {
    font-weight: bold;
}

/* Подменю */
.top-nav .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 999;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    padding: 5px 0;
    min-width: 180px;
    border-radius: 3px;
    margin-top: 2px;
}

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

.top-nav .sub-menu li {
    display: block;
    border-bottom: 1px solid #eee;
}

.top-nav .sub-menu li a {
    display: block;
    padding: 10px 15px;
    white-space: nowrap;
    color: #333;
    text-decoration: none;
    background-color: #fff;
    font-weight: normal;
}

.top-nav .sub-menu li a:hover {
    background-color: #54b5fc;
    color: #000;
}

/* Для мобильных — меню складывается столбиком */


/* Messengers block */
.header-messengers {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    justify-content: flex-end;
}

.messenger-icon {
    width: 35px;
    height: 35px;
    fill: currentColor;
    transition: transform 0.2s ease;
}

.messenger-link {
    display: block;
    color: var(--primary-color);
}

.messenger-link:hover {
    transform: scale(1.1);
    color: #004499;
}

/* ==== Contact Form 7 Styles ==== */

/* Поля ввода */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 textarea {
    width: 100%;
    max-width: 500px;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    font-family: var(--wp--preset--font-family--scada, 'Scada', sans-serif);
    color: #333;
    margin-bottom: 15px;
    background-color: #fff;
    box-sizing: border-box;
}

/* Стили при фокусе */
.wpcf7 input:focus,
.wpcf7 textarea:focus {
    border-color: #0066cc;
    outline: none;
}

/* Ошибки и успех */
.wpcf7-response-output {
    margin-top: 10px;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 14px;
}

.wpcf7-response-output.wpcf7-validation-errors {
    color: #a94442;
    background-color: #f2dede;
    border: 1px solid #ebccd1;
}

.wpcf7-response-output.wpcf7-mail-sent-ok {
    color: #3c763d;
    background-color: #dff0d8;
    border: 1px solid #d6e9c6;
}

/* Кнопка отправки */
.wpcf7 .wpcf7-submit {
    display: inline-block;
    color: white;
    text-decoration: none;
    text-align: center;
    padding: .5em 2em;
    outline: none;
    border-width: 2px 0;
    border-style: solid none;
    border-color: #FDBE33 #000 #D77206;
    border-radius: 6px;
    background: linear-gradient(#F3AE0F, #E38916) #E38916;
    transition: 0.2s;
    cursor: pointer;
    margin: 0 .5em;
    font-family: var(--wp--preset--font-family--pt-sans-narrow, 'PT Sans Narrow', sans-serif);
    font-size: 16px;
    font-weight: bold;
}

.wpcf7 .wpcf7-submit:hover {
    background: linear-gradient(#E38916, #D77206);
}


/* Footer Styles */
.site-footer {
    background: var(--light-gray);
    padding: 30px 0;
    margin-top: 50px;
    font-size: 14px;
    color: #666;
    text-align: center;
}

.footer-copyright {
    margin-bottom: 15px;
    line-height: 1.5;
}

.footer-links {
    margin-top: 15px;
    font-weight: 500;
}

/* Responsive Styles */

/* ================= MEDIA QUERIES ================= */


/* ---- @media (max-width: 768px) ---- */
@media (max-width: 768px) {
    .top-nav {
        flex-direction: column;
        align-items: flex-start;
    }

    .top-nav > li {
        width: 100%;
    }

    .top-nav .sub-menu {
        position: static;
        box-shadow: none;
        margin: 0;
        min-width: 100%;
    }
}
@media (max-width: 768px) {
    .site-logo img {
        max-height: 50px;
    }
    
}

/* ---- @media (max-width: 992px) ---- */
@media (max-width: 992px) {
    .page-layout {
        flex-direction: column;
    }

    .sidebar-right,
    .header-right-col {
        width: 100% !important;
        max-width: 100%;
        padding: 15px;
    }

    .sidebar-right .widget {
        max-width: 360px;
        margin: 0 auto;
    }

    .header-top .col-md-4 {
        margin-bottom: 15px;
        text-align: center !important;
    }

    .header-contacts,
    .header-messengers {
        justify-content: center;
    }


}
