/* ==================================================================
   IP Customs — базови стилове (header, footer, общи елементи).
   Стиловете на отделните страници са в home.css, ppf.css, tint.css.
   ================================================================== */

:root {
    --ipc-black: #050505;
    --ipc-black-2: #0a0a0a;
    --ipc-panel: #101010;
    --ipc-panel-2: #151515;
    --ipc-card: #111111;
    --ipc-line: #292929;
    --ipc-border: rgba(255, 255, 255, .12);
    --ipc-white: #ffffff;
    --ipc-soft: #d8d8d8;
    --ipc-muted: #a3a3a3;
    --ipc-red: #ed0000;
    --ipc-red-dark: #a90000;
    --ipc-header-h: 76px;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--ipc-header-h) + 12px);
}

body {
    margin: 0;
    background: var(--ipc-black);
    color: var(--ipc-white);
    font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

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

.ipc-container {
    width: min(1200px, 100% - 40px);
    margin-inline: auto;
}

.ipc-skip {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 999;
    background: var(--ipc-red);
    color: #fff;
    padding: 12px 18px;
    border-radius: 0 0 8px 0;
}
.ipc-skip:focus { left: 0; }

/* ---------------------------------------------------------- HEADER */

.ipc-site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(5, 5, 5, .92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--ipc-border);
}

.ipc-site-header-inner {
    display: flex;
    align-items: center;
    gap: 30px;
    min-height: var(--ipc-header-h);
}

.ipc-brand { flex: 0 0 auto; display: flex; align-items: center; }
.ipc-brand img { display: block; width: 140px; height: auto; }
.ipc-brand .custom-logo { width: 140px; height: auto; }

.ipc-site-nav { margin-inline-start: auto; }

.ipc-menu {
    display: flex;
    align-items: center;
    gap: 26px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ipc-menu > li { position: relative; }

.ipc-menu a {
    display: inline-block;
    color: var(--ipc-soft);
    text-decoration: none;
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .03em;
    padding: 27px 0;
    position: relative;
    transition: color .2s;
}

.ipc-menu > li > a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 100%;
    bottom: 22px;
    height: 2px;
    background: var(--ipc-red);
    transition: right .25s ease;
}

.ipc-menu > li > a:hover::after,
.ipc-menu > li.current-menu-item > a::after,
.ipc-menu > li.current-menu-ancestor > a::after { right: 0; }

.ipc-menu a:hover,
.ipc-menu .current-menu-item > a { color: var(--ipc-white); }

/* --- падащо подменю --- */

.ipc-menu .menu-item-has-children > a::before {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 7px;
    vertical-align: 2px;
    border: 4px solid transparent;
    border-top-color: currentColor;
    border-bottom: 0;
}

.ipc-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: -18px;
    min-width: 264px;
    margin: 0;
    padding: 8px 0;
    list-style: none;
    background: var(--ipc-panel);
    border: 1px solid var(--ipc-border);
    border-radius: 12px;
    box-shadow: 0 22px 50px rgba(0, 0, 0, .55);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .2s, transform .2s, visibility .2s;
}

.ipc-menu > li:hover > .sub-menu,
.ipc-menu > li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ipc-menu .sub-menu a {
    display: block;
    padding: 11px 18px;
    font-weight: 500;
    font-size: .84rem;
    white-space: nowrap;
}
.ipc-menu .sub-menu a:hover { background: var(--ipc-panel-2); color: var(--ipc-white); }

/* --- действия вдясно --- */

.ipc-header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 0 0 auto;
}

.ipc-header-phone {
    display: none;
    align-items: center;
    gap: 8px;
    color: var(--ipc-white);
    text-decoration: none;
    font-weight: 700;
    font-size: .88rem;
    white-space: nowrap;
}
.ipc-header-phone svg { width: 17px; height: 17px; color: var(--ipc-red); }

.ipc-btn-contact {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    border-radius: 6px;
    background: var(--ipc-red);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: .82rem;
    white-space: nowrap;
    transition: background .2s, transform .2s;
}
.ipc-btn-contact:hover { background: var(--ipc-red-dark); transform: translateY(-1px); }
.ipc-btn-contact-block { display: flex; justify-content: center; margin: 16px 0 4px; }

.ipc-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
    border: 1px solid var(--ipc-border);
    border-radius: 8px;
    cursor: pointer;
}
.ipc-burger span {
    display: block;
    width: 20px;
    height: 2px;
    margin-inline: auto;
    background: var(--ipc-white);
    transition: transform .25s, opacity .25s;
}
.ipc-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.ipc-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.ipc-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- мобилно меню --- */

.ipc-mobile-nav {
    border-top: 1px solid var(--ipc-border);
    background: var(--ipc-black-2);
    padding: 8px 20px 20px;
    max-height: calc(100vh - var(--ipc-header-h));
    overflow-y: auto;
}
.ipc-mobile-nav[hidden] { display: none; }

.ipc-mobile-menu, .ipc-mobile-menu .sub-menu { list-style: none; margin: 0; padding: 0; }
.ipc-mobile-menu > li > a {
    display: block;
    padding: 14px 0;
    color: var(--ipc-white);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid var(--ipc-line);
}
.ipc-mobile-menu .sub-menu { display: none; padding: 4px 0 8px 16px; }
.ipc-mobile-menu .sub-menu a {
    display: block;
    padding: 10px 0;
    color: var(--ipc-muted);
    text-decoration: none;
    font-size: .92rem;
}

@media (max-width: 1080px) {
    .ipc-site-nav { display: none; }
    .ipc-burger { display: flex; }
    .ipc-header-phone { display: inline-flex; }
    .ipc-header-actions { margin-inline-start: auto; }
}

@media (max-width: 640px) {
    .ipc-btn-contact { display: none; }
    .ipc-btn-contact-block { display: flex; }
    .ipc-header-phone span { font-size: .84rem; }
}

/* ---------------------------------------------------------- FOOTER */

.ipc-site-footer {
    margin-top: 90px;
    background: var(--ipc-black-2);
    border-top: 1px solid var(--ipc-border);
    color: var(--ipc-muted);
    font-size: .92rem;
}

.ipc-footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 1.2fr;
    gap: 44px;
    padding: 62px 0 52px;
}

.ipc-footer-col h2 {
    margin: 0 0 18px;
    color: var(--ipc-white);
    font-size: 1rem;
    font-weight: 700;
}
.ipc-footer-col h2 a { color: inherit; text-decoration: none; }

.ipc-footer-brand img { width: 150px; height: auto; }

.ipc-socials {
    display: flex;
    gap: 10px;
    list-style: none;
    margin: 22px 0 0;
    padding: 0;
}
.ipc-socials a {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ipc-panel);
    border: 1px solid var(--ipc-border);
    color: var(--ipc-soft);
    transition: background .2s, color .2s;
}
.ipc-socials a:hover { background: var(--ipc-red); color: #fff; border-color: var(--ipc-red); }
.ipc-socials svg { width: 18px; height: 18px; }

.ipc-footer-menu, .ipc-footer-contacts {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.ipc-footer-menu a { color: var(--ipc-muted); text-decoration: none; }
.ipc-footer-menu a:hover { color: var(--ipc-white); }

.ipc-footer-contacts li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.55;
}
.ipc-footer-contacts svg { width: 17px; height: 17px; flex: 0 0 17px; margin-top: 3px; color: var(--ipc-red); }
.ipc-footer-contacts a { color: var(--ipc-muted); text-decoration: none; word-break: break-word; }
.ipc-footer-contacts a:hover { color: var(--ipc-white); }

.ipc-footer-bottom {
    border-top: 1px solid var(--ipc-line);
    padding: 22px 0;
    font-size: .84rem;
    text-align: center;
}
.ipc-footer-bottom p { margin: 0; }

@media (max-width: 980px) {
    .ipc-footer-grid { grid-template-columns: 1fr 1fr; gap: 38px; }
}
@media (max-width: 600px) {
    .ipc-footer-grid { grid-template-columns: 1fr; gap: 34px; text-align: center; }
    .ipc-socials { justify-content: center; }
    .ipc-footer-contacts li { justify-content: center; text-align: left; }
}

/* ------------------------------------------------- ОБИКНОВЕНИ СТРАНИЦИ */

.ipc-page { padding: 70px 0; }
.ipc-page h1 { font-size: clamp(2rem, 4vw, 3rem); margin: 0 0 26px; }
.ipc-page-content { line-height: 1.75; color: var(--ipc-soft); max-width: 74ch; }
.ipc-page-content a { color: var(--ipc-red); }

.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

/* ------------------------------------------------- ЗАЩИТИ ЗА МОБИЛЕН */

/* Нищо не бива да прави документа по-широк от екрана. Ако един елемент
   прелее, всичко центрирано се измества и текстът излиза извън кадър. */
html, body { max-width: 100%; overflow-x: hidden; }

/* Вградените карти и видеа с фиксирани width/height атрибути. */
iframe, embed, object, video { max-width: 100%; }

/* Аварийна мрежа: инлайн иконка без CSS не се раздува на цял екран. */
svg { max-width: 100%; }