﻿.tw {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: #0088cc; /* Telegram color */
    color: white;
    border-radius: 50%;
    font-size: 24px;
    text-decoration: none;
    transition: 0.3s;
}

    .tw:hover {
        background: #0077b5;
        transform: scale(1.1);
    }

/* ===== Flying image animation ===== */
.fly-img {
    position: fixed;
    z-index: 999999;
    width: 70px;
    height: 70px;
    border-radius: 16px;
    object-fit: cover;
    pointer-events: none;
    box-shadow: 0 20px 60px rgba(0,0,0,.45);
    transition: transform .85s cubic-bezier(.2,.9,.2,1), opacity .85s ease;
    opacity: 1;
}

    .fly-img.done {
        opacity: 0;
    }

/* ===== Small badge counter on cart button ===== */
.cart-btn {
    position: relative;
}

#cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 12px;
    color: gold;
    background: linear-gradient(135deg, green, black, green, black);
    box-shadow: 0 0 18px rgba(107,255,154,.45);
    transition: opacity .2s ease, transform .2s ease;
}

/* "скрыт" при 0, но НЕ display:none */
.cart-counter.is-hidden {
    opacity: 0;
    transform: scale(.85);
    pointer-events: none;
}

/*  Aнимация подпрыгивания корзины*/
.bump {
    animation: cartBump .28s ease;
}

@keyframes cartBump {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.18);
    }

    100% {
        transform: scale(1);
    }
}

/* ===== Burger button ===== */
.burger {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(110,231,183,.25);
    background: rgba(0,0,0,.18);
    cursor: pointer;
    padding: 0;
}

    .burger span {
        display: block;
        width: 18px;
        height: 2px;
        background: #cfeee0;
        margin: 6px auto;
        border-radius: 2px;
    }

/* ===== Mobile menu overlay ===== */
.mobile-menu {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    z-index: 99999;
}

    .mobile-menu.open {
        display: block;
    }

.mobile-menu__panel {
    position: absolute;
    left: 12px;
    right: 12px;
    top: 12px;
    margin: auto;
    max-width: 540px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(22,26,34,.96), rgba(10,14,20,.92));
    border: 1px solid rgba(110,231,183,.18);
    box-shadow: 0 25px 70px rgba(0,0,0,.55);
    padding: 16px;
}

.mobile-menu__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    margin-bottom: 10px;
}

.mobile-menu__title {
    font-weight: 900;
    color: var(--a1);
}

.mobile-close {
    border: none;
    background: transparent;
    color: #e5e7eb;
    font-size: 22px;
    cursor: pointer;
}

.mobile-menu__nav a {
    display: block;
    padding: 12px 10px;
    border-radius: 12px;
    color: #cfeee0;
    text-decoration: none;
    font-weight: 700;
}

    .mobile-menu__nav a:hover {
        background: rgba(110,231,183,.12);
        color: var(--a1);
    }

.mobile-menu__actions {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.w100 {
    width: 100%;
    justify-content: center;
}

/* ===== Responsive header layout ===== */
@media (max-width: 980px) {
    .main-nav {
        display: none;
    }

    .burger {
        display: inline-block;
    }
    /* На мобилке делаем правый блок компактнее */
    .header-inner {
        grid-template-columns: auto 1fr auto;
        gap: 12px;
    }

    .header-actions {
        gap: 10px;
    }

    .cart-btn {
        padding: 10px 12px;
    }
}

/* Чтобы длинные элементы не раздвигали хедер */
.logo a, .logo img {
    display: block;
}

/* ===== Mobile dropdown ===== */
.mobile-dropdown {
    width: 100%;
}

.mobile-dropbtn {
    width: 100%;
    text-align: left;
    padding: 12px 10px;
    border: none;
    background: none;
    color: #cfeee0;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .mobile-dropbtn:hover {
        background: rgba(110,231,183,.12);
    }

.mobile-dropdown-menu {
    display: none;
    flex-direction: column;
    padding-left: 12px;
}

    .mobile-dropdown-menu a {
        padding: 10px 8px;
        font-size: 14px;
        color: #cfeee0;
        text-decoration: none;
    }

        .mobile-dropdown-menu a:hover {
            color: var(--a1);
        }

/* ===== Dropdown menu ===== */
.dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.dropbtn {
    cursor: pointer;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 300px;
    display: none;
    flex-direction: column;
    padding: 8px 0;
    background: linear-gradient(180deg, rgba(10,40,45,.98), rgba(6,22,26,.98));
    border: 1px solid rgba(110,231,183,.16);
    box-shadow: 0 18px 40px rgba(0,0,0,.45);
    z-index: 9999;
}

    .dropdown-menu a {
        display: block;
        padding: 12px 16px;
        color: #fff;
        text-decoration: none;
        font-size: 14px;
        font-weight: 600;
        border-bottom: 1px solid rgba(255,255,255,.06);
    }

        .dropdown-menu a:last-child {
            border-bottom: none;
        }

        .dropdown-menu a:hover {
            background: rgba(110,231,183,.12);
            color: var(--a1);
        }

.dropdown:hover .dropdown-menu {
    display: flex;
}

/* Nav */
.main-nav {
    display: flex;
    justify-content: center;
    gap: 28px;
}

    .main-nav .nav-link,
    .main-nav > a {
        display: inline-flex;
        align-items: center;
        height: 44px;
        color: #e5e7eb;
        text-decoration: none;
        font-weight: 700;
        line-height: 1;
    }

    .main-nav a {
        color: #cfeee0;
        text-decoration: none;
        font-weight: 600;
        letter-spacing: .2px;
        position: relative;
        padding: 6px 0;
        opacity: .92;
        transition: color .2s ease, opacity .2s ease;
    }

        .main-nav a::after {
            content: "";
            position: absolute;
            left: 0;
            right: 0;
            bottom: -6px;
            width: 0%;
            height: 2px;
            margin: auto;
            background: linear-gradient(90deg, var(--a1), var(--a2));
            box-shadow: 0 0 10px rgba(107,255,154,.55);
            transition: width .25s ease;
        }

        .main-nav a:hover {
            color: var(--a1);
            opacity: 1;
        }

            .main-nav a:hover::after {
                width: 100%;
            }

/* ===== Responsive header layout ===== */
@media (max-width: 980px) {
    .main-nav {
        display: none;
        visibility: hidden;
        opacity: 0;
        height: 0;
        overflow: hidden;
    }
}