/* =======================
   HEADER 
======================= */

.header-dc {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0.75rem 0.75rem;
    background: linear-gradient(to right, #1e1e1f, #1e1e1f 50%, #2a2435);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

@media (min-width: 768px) {
    .header-dc {
        padding: 1rem 2rem;
    }
}

.header-dc__inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .header-dc__inner {
        gap: 1rem;
    }
}

/* Brand / Logo (navbar_brand include) */
.header-dc__brand {
    flex-shrink: 0;
}

.header-dc__brand .navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #fff;
    transition: opacity 0.2s;
}

.header-dc__brand .navbar-brand:hover {
    opacity: 0.9;
    color: #fff;
}

@media (min-width: 768px) {
    .header-dc__brand .navbar-brand {
        gap: 0.75rem;
    }
}

.header-dc__brand .navbar-brand-logo {
    height: 24px;
    width: 45px;
    object-fit: contain;
}

@media (min-width: 768px) {
    .header-dc__brand .navbar-brand-logo {
        height: 28px;
        width: 54px;
    }
}

.header-dc__brand .navbar-brand-text {
    font-size: 0.875rem;
    font-family: Inter, system-ui, sans-serif;
    font-weight: 500;
}

@media (min-width: 768px) {
    .header-dc__brand .navbar-brand-text {
        font-size: 1rem;
    }
}

/* Center: Categories + Search (desktop) */
.header-dc__center {
    align-items: center;
    gap: 1rem;
    flex: 1;
    justify-content: center;
    max-width: 520px;
}

/* Categories button */
.header-dc__btn-categories .close-icon {
    display: none;
}
.header-dc__btn-categories {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #fff;
    color: #1e1e1f;
    border: 1px solid #fff;
    border-radius: 1rem;
    font-size: 1rem;
    font-family: Inter, system-ui, sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.header-dc__btn-categories:hover {
    text-decoration: none;
    background: #f3f4f6;
    color: #1e1e1f;
}

body.categories-open .header-dc__btn-categories {
    background: #1e1e1f;
    color: #fff;
    border-color: #fff;
}
body.categories-open .header-dc__btn-categories .menu-icon {
    display: none;
}
body.categories-open .header-dc__btn-categories .close-icon {
    display: inline-flex !important;
}

/* Search */
.header-dc__search {
    position: relative;
    flex: 0 0 420px;
    max-width: 420px;
}

.header-dc__search-input {
    width: 100%;
    padding: 0.75rem 4rem 0.75rem 1rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 1rem;
    color: #fff;
    font-size: 1rem;
    font-family: Inter, system-ui, sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

.header-dc__search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.header-dc__search-input:focus {
    border-color: rgba(255, 255, 255, 0.5);
}

.header-dc__search-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #424242;
    border: none;
    border-radius: 0.5rem;
    color: #fff;
    cursor: pointer;
}

.header-dc__search-clear {
    position: absolute;
    right: 3.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.25rem;
    text-decoration: none;
    line-height: 1;
}

.header-dc__search-clear:hover {
    color: #fff;
}

/* Right: Profile + Cart (desktop) */
.header-dc__right {
    align-items: center;
    gap: 1.5rem;
}

.header-dc__link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
    font-family: Inter, system-ui, sans-serif;
    font-weight: 300;
    transition: color 0.2s;
}

.header-dc__link:hover {
    color: rgba(255, 255, 255, 0.8);
}

.header-dc__link--login,
.header-dc__link--register {
    font-weight: 500;
}

.header-dc__link--register {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
}

.header-dc__link--register:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Cart */
.header-dc__cart {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 1rem;
    color: #fff;
    text-decoration: none;
    transition: background 0.2s;
    position: relative;
}

.header-dc__cart:hover {
    background: rgba(255, 255, 255, 0.1);
}

.header-dc__cart-text {
    font-size: 1rem;
    font-family: Inter, system-ui, sans-serif;
}

.cart-badge {
    margin-left: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
}

.cart-badge--loading {
    min-width: 18px;
    height: 18px;
    background: linear-gradient(90deg, #404045 25%, #4a4a50 50%, #404045 75%);
    background-size: 200% 100%;
    animation: cart-badge-shimmer 1.2s ease-in-out infinite;
    border-radius: 9px;
}

.cart-badge--loading::before {
    content: '';
    display: block;
}

@keyframes cart-badge-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Mobile search */
.header-dc__mobile-search {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    overflow: hidden;
}

.header-dc__mobile-search-input {
    width: 0;
    min-width: 0;
    padding: 0.5rem 0;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 0.9rem;
    outline: none;
    transition: width 0.2s;
}

.header-dc__mobile-search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.header-dc__mobile-search.is-expanded .header-dc__mobile-search-input {
    width: 120px;
    padding: 0.5rem 0.75rem;
}

.header-dc__mobile-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
}

.header-dc__mobile-search-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Mobile actions */
.header-dc__mobile-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.header-dc__mobile-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: #fff;
    text-decoration: none;
    position: relative;
    border-radius: 0.75rem;
    transition: background 0.2s;
}

.header-dc__mobile-cart:hover {
    background: rgba(255, 255, 255, 0.1);
}

.header-dc__mobile-cart .cart-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    font-size: 0.7rem;
    line-height: 18px;
    text-align: center;
    background: #4854FC;
    border-radius: 9px;
}

.header-dc__mobile-cart .cart-badge--loading {
    background: linear-gradient(90deg, #404045 25%, #4a4a50 50%, #404045 75%);
    background-size: 200% 100%;
}

.header-dc__mobile-cart .header-dc__cart-text {
    display: none;
}

.header-dc__menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    color: #fff;
    cursor: pointer;
    border-radius: 0.75rem;
    transition: background 0.2s;
}

.header-dc__menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Bootstrap display utilities for responsive */
.d-none { display: none !important; }
.d-flex { display: flex !important; }
.d-lg-none { display: flex !important; }
@media (min-width: 992px) {
    .d-lg-none { display: none !important; }
    .d-none.d-lg-flex { display: flex !important; }
}

/* Main content offset for fixed header (в т.ч. для панели категорий) */
.dc-theme .main-content {
    padding-top: 80px;
}

@media (min-width: 768px) {
    .dc-theme .main-content {
        padding-top: 90px;
    }
}

/* =======================
   MOBILE SLIDE-OUT MENU
======================= */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.is-visible {
    display: block;
    opacity: 1;
}

.mobile-menu-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 320px;
    height: 100%;
    background: #1e1e1f;
    z-index: 1050;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
}

.mobile-menu-panel.is-visible {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.mobile-menu-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.mobile-menu-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.mobile-menu-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.mobile-menu-nav {
    padding: 1rem 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 1.25rem;
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
    transition: background 0.2s;
}

.mobile-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.mobile-menu-item i {
    font-size: 1.2rem;
    opacity: 0.9;
}

.mobile-menu-item-accent {
    background: rgba(255, 255, 255, 0.1);
    margin: 8px 1rem 0;
    border-radius: 12px;
}

.mobile-menu-item-accent:hover {
    background: rgba(255, 255, 255, 0.18);
}

.mobile-menu-item-form {
    margin: 0;
}

.mobile-menu-item-btn {
    width: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    text-align: left;
}

@media (min-width: 992px) {
    .mobile-menu-overlay,
    .mobile-menu-panel {
        display: none !important;
    }
}

/* =======================
   SEARCH AUTOCOMPLETE DROPDOWN
======================= */

.search-suggestions {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #232325;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 1rem;
    overflow: hidden;
    z-index: 200;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    animation: suggestions-fade-in 0.15s ease;
}

.search-suggestions.is-visible {
    display: block;
}

@keyframes suggestions-fade-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.search-suggestions__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    color: #fff;
    text-decoration: none;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
}

.search-suggestions__item:last-of-type {
    border-bottom: none;
}

.search-suggestions__item:hover,
.search-suggestions__item.is-active {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    text-decoration: none;
}

.search-suggestions__thumb {
    width: 44px;
    height: 44px;
    border-radius: 0.5rem;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
}

.search-suggestions__thumb--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
}

.search-suggestions__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.search-suggestions__name {
    font-size: 0.875rem;
    font-family: Inter, system-ui, sans-serif;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-suggestions__category {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    font-family: Inter, system-ui, sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-suggestions__price {
    font-size: 0.9rem;
    font-family: Inter, system-ui, sans-serif;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0;
}

.search-suggestions__all {
    display: block;
    padding: 0.625rem 1rem;
    text-align: center;
    font-size: 0.8rem;
    font-family: Inter, system-ui, sans-serif;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    transition: color 0.15s, background 0.15s;
}

.search-suggestions__all:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
    text-decoration: none;
}
