/* custom.css */

/* =========================
   Fonts: Noto Sans Georgian
   ========================= */

@font-face {
    font-family: 'Noto Sans Georgian';
    /* Основной формат для современных браузеров */
    src: url('/fonts/noto/noto-sans-georgian-v48-latin-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Noto Sans Georgian';
    src: url('/fonts/noto/noto-sans-georgian-v48-latin-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Noto Sans Georgian';
    src: url('/fonts/noto/noto-sans-georgian-v48-latin-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Глобальный стек для грузинских страниц */
html[lang="ka"] body,
html[lang="ka"] .font-sans {
    font-family: 'Noto Sans Georgian', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* Вспомогательный класс для принудительного использования грузинского шрифта */
.georgian-font {
    font-family: 'Noto Sans Georgian', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    font-feature-settings: 'liga'1, 'kern'1;
}

/* =========================
   Custom UI polish (EN + KA)
   ========================= */

/* 0) Background */
body {
    background-color: #f1f5fe;
    background: linear-gradient(135deg, #e0e7ff 0%, #f1f5fe 60%, #fff 100%);
}

/* Header height variable */
:root {
    --header-h: 72px;
}

/* 1) Anchor jumps & Smooth Scroll */
html {
    scroll-padding-top: var(--header-h);
    scroll-behavior: smooth;
}

/* 2) Sun pulse animation */
@keyframes sunpulse {

    0%,
    100% {
        opacity: .6;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.18);
    }
}

.animate-sunpulse {
    animation: sunpulse 2.5s infinite cubic-bezier(.6, 0, .6, 1.1);
}

@media (prefers-reduced-motion:reduce) {
    .animate-sunpulse {
        animation: none !important;
    }
}

/* 3) Cards (Пружинящая анимация) */
.card {
    position: relative;
    background: rgba(255, 255, 255, .98);
    border-radius: 1rem;
    box-shadow: 0 4px 16px rgba(50, 50, 93, .08), 0 12px 32px rgba(70, 130, 255, .08);
    padding: 1.75rem;
    text-align: center;
    transition: transform .18s cubic-bezier(.4, 2, .6, 1), box-shadow .25s cubic-bezier(.4, 2, .6, 1), border-color .25s;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(60, 99, 255, .06);
    overflow: hidden;
    z-index: 1;
}

.card .card-overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.card .relative,
.card .icon,
.card h3,
.card p,
.card span {
    z-index: 2;
    position: relative;
}

.card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 24px 48px rgba(50, 50, 93, .13), 0 32px 64px rgba(70, 130, 255, .20);
    border-color: #377cfb;
}

/* 3.1) Unified media height for product cards */
.img-wrap {
    height: 16rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 4) Header polish — sticky by default */
#site-header,
header.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(23, 32, 66, .06);
    box-shadow: 0 8px 12px -8px rgba(23, 32, 66, .08), 0 1px 0 rgba(23, 32, 66, .05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Polyfill for fixed header JS logic */
#site-header.fixed,
header.site-header.fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
}

/* 5) Desktop dropdown animation */
#desktop-nav .group>div>.pt-2>.bg-white\/95 {
    transform-origin: top;
    transform: translateY(6px) scale(.98);
    opacity: 0;
    transition: opacity .18s ease, transform .18s ease;
}

#desktop-nav .group:hover .pt-2>.bg-white\/95,
#desktop-nav .group:focus-within .pt-2>.bg-white\/95 {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* 6) Mobile backdrop */
.mobile-backdrop {
    background: rgba(24, 32, 48, .35);
    backdrop-filter: blur(1.5px);
    -webkit-backdrop-filter: blur(1.5px);
    z-index: 49;
}

/* 8) Links polish */
a:hover {
    text-underline-offset: 4px;
}

/* 9) Banner readability overlay helper */
.banner-overlay-dark::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(23, 32, 66, .55), rgba(23, 32, 66, .35) 60%, rgba(23, 32, 66, 0) 100%);
    pointer-events: none;
}

/* 10) Images & logos */
.img-sharp {
    image-rendering: crisp-edges;
    image-rendering: -webkit-optimize-contrast;
}

.object-cover {
    object-fit: cover;
}

.object-contain {
    object-fit: contain;
}

img[src$=".svg"] {
    image-rendering: auto !important;
}

/* --- LOGO FIX START --- */
.site-logo {
    width: auto !important;
    height: auto;
    /* Увеличили максимальную высоту до 5rem (~80px) */
    max-height: 5rem !important;
    object-fit: contain;
}

/* --- LOGO FIX END --- */

/* Lazy reserve to reduce CLS */
.img-lazy {
    content-visibility: auto;
    contain-intrinsic-size: 1px 300px;
}

/* 11) Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .65rem 1rem;
    border-radius: .75rem;
    background: #2563eb;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 6px 14px rgba(37, 99, 235, .18);
    transition: background-color .18s ease, box-shadow .18s ease;
}

.btn:hover {
    background: #1e40af;
    box-shadow: 0 8px 16px rgba(37, 99, 235, .20);
}

.btn:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(147, 197, 253, .35);
}

.btn--download {
    position: relative;
    padding-left: 2.25rem;
}

.btn--download::before {
    content: "";
    position: absolute;
    left: .8rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M12 3v10.17l3.59-3.58L17 11l-5 5-5-5 1.41-1.41L11 13.17V3z'/><path d='M5 19h14v2H5z'/></svg>");
    opacity: .95;
}

/* 12) Tables */
.table-clean th,
.table-clean td {
    padding: .75rem 1rem;
}

.table-clean thead {
    background: rgba(37, 99, 235, .06);
}

.table-clean tbody tr:nth-child(odd) {
    background: rgba(23, 32, 66, .02);
}

/* 13) Footer safety */
#site-footer .container {
    max-width: 80rem;
    margin-inline: auto;
    padding-inline: 1rem;
}

#site-footer p {
    text-align: center;
}

/* ---------- Chargers-only helpers ---------- */
.charger-media {
    height: 16rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .25rem;
    background: #fff;
    border-radius: .75rem;
    overflow: hidden;
}

.charger-media>img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.product-title {
    font-size: 1.02rem;
}

@media (min-width:768px) {
    .product-title {
        font-size: 1.12rem;
    }
}

/* ---------- HERO stacking & spacing FIX ---------- */
#hero {
    isolation: isolate;
}

#hero .hero-overlay {
    z-index: 1;
    pointer-events: none;
}

#hero .hero-text {
    z-index: 2;
}

/* Fallback: Layers */
#hero>.absolute+.absolute {
    z-index: 1;
    pointer-events: none;
}

/* Remove obsolete paddings */
#hero[class*="pt-"] {
    padding-top: 0 !important;
}

/* Header spacing compensation */
body:has(#site-header.fixed) #hero,
body:has(header.site-header.fixed) #hero {
    margin-top: var(--header-h);
}

#main-content>*:first-child {
    margin-top: 0;
}

/* On-grid vs Hybrid comparison layout */
.inverter-compare-grid {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .inverter-compare-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.inverter-compare .card.inverter-card {
    text-align: left;
    align-items: flex-start;
}

/* EV chargers: home vs business comparison */
.chargers-compare-grid {
    display: grid;
    gap: 2rem;
}

@media (min-width: 768px) {
    .chargers-compare-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.chargers-compare .card.chargers-card {
    text-align: left;
    align-items: flex-start;
}

/* Lang switch */
.lang-switch {
    display: flex;
    gap: .5rem;
    align-items: center;
}

.lang-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .25rem .55rem;
    border-radius: .5rem;
    line-height: 1;
    border: 1px solid #e5e7eb;
    background: rgba(255, 255, 255, .95);
    color: #172042;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .02);
    transition: background .15s ease, border-color .15s ease, transform .12s ease;
}

.lang-link:hover {
    background: #fff;
    border-color: #dbe3f0;
    transform: translateY(-1px);
}

.lang-link:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

.lang-active {
    background: #172042;
    color: #fff;
    border-color: transparent;
}

.lang-flag {
    width: 20px;
    height: 14px;
    display: inline-block;
    background-size: cover;
    background-position: center;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .08) inset;
}

.flag-en {
    background-image: url("/assets/flags/en.svg");
}

.flag-ka {
    background-image: url("/assets/flags/ka.svg");
}

/* EV chargers compare block style */
.chargers-compare {
    background: linear-gradient(to right, #e0e7ff, #ffffff 50%, #e0e7ff);
    padding: 3rem 1.5rem;
    border-radius: 20px;
    margin-bottom: 3rem;
}

.chargers-card {
    background: #fff;
    border-radius: 18px;
    padding: 28px;
    border: 1px solid #eef0f8;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.chargers-card h2 {
    color: #172042;
}

/* =========================
   NEW: Architecture Fixes
   ========================= */

/* Резервируем место под хедер, пока он не загрузился через include.js.
   Это предотвращает "прыжок" контента (CLS) при загрузке страницы.
*/
#header-placeholder {
    min-height: var(--header-h, 72px);
    display: block;
    width: 100%;
}

/* Класс, который добавляет header.js при открытии мобильного меню.
   Блокирует скролл фона.
*/
body.menu-open {
    overflow: hidden !important;
    touch-action: none;
}