/* ============================================
   header.css — шапка, навігація, панелі,
                бургер-меню, перемикач теми
   ============================================ */

/* ── Шапка ── */
header {
    background: linear-gradient(135deg, var(--header-from) 0%, var(--header-to) 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 100;
    animation: slideDown 0.5s ease-out;
    isolation: isolate;
    transition: background 0.35s ease;
    width: 100%;
}

/* Золоті полоски — тільки десктоп */
@media (min-width: 1025px) {
    header {
        --stripe-gap: 34px;
        --stripe-lower-gap: calc(var(--stripe-gap) - 2.5px);
        --stripe-hover-increment: 5px;
        --stripe-height: 3px;
    }
    header::before,
    header::after {
        content: '';
        position: absolute;
        left: 0; right: 0;
        height: var(--stripe-height);
        pointer-events: none;
        background: linear-gradient(90deg, #d4af37 0%, #f7d77f 50%, #d4af37 100%);
        opacity: 0.95;
        transition: top 180ms ease, opacity 160ms ease;
    }
    header::before { top: calc(50% - var(--stripe-gap)); box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
    header::after  { top: calc(50% + var(--stripe-lower-gap)); }
    header.cart-hover::before { top: calc(50% - (var(--stripe-gap) + var(--stripe-hover-increment))); }
    header.cart-hover::after  { top: calc(50% + (var(--stripe-lower-gap) + var(--stripe-hover-increment))); }
}
@media (max-width: 1024px) {
    header::before,
    header::after { display: none; }
}

/* ── Вміст шапки ── */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
}

.logo {
    font-family: 'Lavishly Yours', cursive;
    font-size: 2.3rem;
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: none;
    line-height: 1;
    margin: 0; padding: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

nav {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: nowrap;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    font-size: 1.05rem;
    white-space: nowrap;
}
.catalog-button {
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 0.15rem 0.25rem;
}

nav a:hover { transform: translateY(-2px); }
nav a::after {
    content: '';
    position: absolute;
    bottom: -5px; left: 0;
    width: 0; height: 2px;
    background: white;
    transition: width 0.3s ease;
}
nav a:hover::after  { width: 100%; }
.cart-link::after   { display: none !important; }
.theme-toggle::after { display: none !important; }

/* ── Корзина ── */
.cart-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255,255,255,0.2);
    padding: 0.45rem 0.85rem;
    border-radius: 50px;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.cart-link:hover { background: rgba(255,255,255,0.3); transform: scale(1.05); }
.cart-icon  { font-size: 1.2rem; }
.cart-count {
    background: var(--secondary-color);
    color: white;
    padding: 0.2rem 0.55rem;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
}

/* ── Перемикач теми ── */
.theme-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px; min-width: 38px;
    background: var(--theme-btn-bg);
    border: 1.5px solid rgba(255,255,255,0.30);
    border-radius: 50%;
    cursor: pointer;
    color: white;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.3s ease, transform 0.35s ease, border-color 0.3s ease;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.theme-toggle:hover {
    background: var(--theme-btn-hover);
    border-color: rgba(255,255,255,0.55);
    transform: rotate(18deg) scale(1.12);
}
.theme-toggle:active { transform: scale(0.93); }

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    position: absolute;
    transition: opacity 0.3s ease, transform 0.35s ease;
    line-height: 1;
    font-style: normal;
}
.theme-toggle .icon-sun  { top: 52%; left: 52%; }
.theme-toggle .icon-moon { top: 50%; left: 50%; }

[data-theme="light"] .theme-toggle .icon-sun  { opacity: 0; transform: translate(-52%,-52%) rotate(90deg)  scale(0.4); }
[data-theme="light"] .theme-toggle .icon-moon { opacity: 1; transform: translate(-50%,-50%) rotate(0deg)   scale(1);   }
[data-theme="dark"]  .theme-toggle .icon-sun  { opacity: 1; transform: translate(-52%,-52%) rotate(0deg)   scale(1);   }
[data-theme="dark"]  .theme-toggle .icon-moon { opacity: 0; transform: translate(-50%,-50%) rotate(-90deg) scale(0.4); }

/* ── Панель каталогу / соцмереж ── */
.catalog-panel {
    position: absolute;
    left: 0; right: 0; top: 100%;
    background: var(--panel-bg);
    color: var(--panel-text);
    box-shadow: var(--panel-shadow);
    transform-origin: top center;
    transform: translateY(-8px) scaleY(0.98);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease, background 0.35s ease;
    z-index: 120;
    padding: 18px 0 28px;
}
.catalog-panel.open { transform: translateY(0) scaleY(1); opacity: 1; pointer-events: auto; }

.catalog-inner { max-width: 1200px; margin: 0 auto; padding: 0 16px; position: relative; }
.catalog-close {
    position: absolute; right: 0; top: -8px;
    background: transparent; border: none;
    font-size: 1.1rem; cursor: pointer;
    color: var(--panel-text);
    transition: color 0.2s;
}
.catalog-close:hover { color: var(--primary-color); }
.catalog-title { margin: 8px 0 14px; font-family: 'Roboto', sans-serif; font-weight: 700; color: var(--primary-color); }

.catalog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 28px; }

.catalog-item {
    display: block;
    padding: 10px 12px;
    background: var(--panel-item-bg);
    border-radius: 6px;
    color: var(--panel-text);
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}
.catalog-item:hover { background: var(--primary-color); color: white; transform: translateY(-1px); }

/* ── Соціальні мережі ── */
.social-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}
.social-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 30px 20px;
    background: linear-gradient(135deg, var(--social-bg-from) 0%, var(--social-bg-to) 100%);
    border-radius: 12px;
    color: var(--panel-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: var(--social-shadow);
    -webkit-tap-highlight-color: transparent;
}
.social-item:hover { transform: translateY(-5px); box-shadow: var(--social-hover-shadow); }
.social-icon { font-size: 3rem; line-height: 1; }
.social-name { font-family: 'Roboto', sans-serif; font-weight: 600; }
.social-item.tiktok:hover    { background: linear-gradient(135deg, #ff0050 0%, #00f2ea 100%); color: white; }
.social-item.instagram:hover { background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); color: white; }
.social-item.facebook:hover  { background: linear-gradient(135deg, #1877f2 0%, #0d5dbf 100%); color: white; }

/* ── Бургер-кнопка ── */
.burger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px; height: 40px; min-width: 40px;
    background: rgba(255,255,255,0.15);
    border: 1.5px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    cursor: pointer;
    padding: 9px 8px;
    flex-shrink: 0;
    transition: background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.burger-btn:hover  { background: rgba(255,255,255,0.28); }
.burger-btn:active { background: rgba(255,255,255,0.35); }
.burger-btn span {
    display: block;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: transform 0.28s ease, opacity 0.2s ease;
    transform-origin: center;
    pointer-events: none;
}
.burger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger-btn.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.burger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Мобільне меню ── */
.mobile-nav-menu {
    position: fixed;
    left: 0; right: 0;
    z-index: 99;
    background: var(--header-from);
    box-shadow: 0 8px 28px rgba(0,0,0,0.45);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.32s ease;
}
.mobile-nav-menu.open { max-height: 320px; }

.mobile-nav-item {
    display: block;
    width: 100%;
    text-align: left;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    font-family: 'Roboto', sans-serif;
    padding: 0.9rem 1.5rem;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.09);
    background: transparent;
    cursor: pointer;
    transition: background 0.18s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    box-sizing: border-box;
}
.mobile-nav-item:last-child { border-bottom: none; }
.mobile-nav-item:hover,
.mobile-nav-item:active { background: rgba(255,255,255,0.13); }
