/* Mega menu — e-ticaret kategori paneli */
.mega-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 45;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s;
}

.mega-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.mega-menu-backdrop {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s;
}

.mega-menu-backdrop.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mega-menu-panel {
    background: #fff;
    box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.2);
    border-top: 3px solid #ef233c;
    max-height: min(72vh, 540px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0 auto;
    max-width: 80rem;
}

.mega-type-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
    flex-shrink: 0;
}

/* Ürünler (kırmızı) / Cihazlar (petrol mavisi): iki tür her zaman kendi renginde, seçili olan dolu */
.mega-type-tab[data-mega-type="product"] {
    --tab-color: #c1121f;
    --tab-fill: linear-gradient(135deg, #a30d1a 0%, #c1121f 55%, #d91a2e 100%);
    --tab-soft: #fff0f3;
    --tab-soft-hover: #ffe0e6;
}
.mega-type-tab[data-mega-type="device"] {
    --tab-color: #0e7490;
    --tab-fill: linear-gradient(135deg, #0b5d74 0%, #0e7490 55%, #0e7c99 100%);
    --tab-soft: #ecfeff;
    --tab-soft-hover: #cffafe;
}

.mega-type-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--tab-color, #64748b);
    background: var(--tab-soft, #f8fafc);
    border: 0;
    cursor: pointer;
    transition: color 0.15s, background 0.15s, box-shadow 0.15s;
    position: relative;
    z-index: 1;
}

.mega-type-tab svg {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
}

.mega-type-tab:hover {
    background: var(--tab-soft-hover, #f1f5f9);
}

.mega-type-tab:focus-visible {
    outline: 2px solid var(--tab-color);
    outline-offset: -4px;
}

.mega-type-tab.is-active {
    color: #fff;
    background: var(--tab-fill);
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18);
}

.mega-type-tab.is-active:focus-visible {
    outline-color: #fff;
}

/* Panelin üst çizgisi ve içerideki vurgular seçili türün renginde */
.mega-menu-panel:has(.mega-type-tab[data-mega-type="device"].is-active) {
    border-top-color: #0e7490;
}
.mega-catalog[data-mega-catalog="device"] .mega-brands {
    background: linear-gradient(180deg, #0c1f26 0%, #0b3d4d 100%);
}
.mega-catalog[data-mega-catalog="device"] .mega-brand-btn:hover,
.mega-catalog[data-mega-catalog="device"] .mega-brand-btn.is-active {
    border-left-color: #22d3ee;
}
.mega-catalog[data-mega-catalog="device"] .mega-panel-link,
.mega-catalog[data-mega-catalog="device"] .mega-cat-group-title:hover,
.mega-catalog[data-mega-catalog="device"] .mega-cat-sub:hover {
    color: #0e7490;
}
.mega-catalog[data-mega-catalog="device"] .mega-panel-link:hover {
    color: #155e75;
}
.mega-catalog[data-mega-catalog="device"] .mega-cat-group-title {
    border-bottom-color: #a5f3fc;
}
.mega-catalog-stack {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
}

.mega-catalog {
    display: none;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.mega-catalog.is-active {
    display: flex;
    animation: megaFadeIn 0.2s ease;
}

.mega-brands {
    width: 280px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #1c1917 0%, #3d1219 100%);
    overflow-y: auto;
}

.mega-brand-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    text-align: left;
    padding: 0.875rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    border: none;
    border-left: 3px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.mega-brand-btn:hover,
.mega-brand-btn.is-active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-left-color: #ef233c;
}

.mega-brand-btn svg {
    width: 1rem;
    height: 1rem;
    opacity: 0.5;
    flex-shrink: 0;
}

.mega-brand-btn.is-active svg {
    opacity: 1;
}

.mega-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 1.75rem;
    background: #f8fafc;
}

.mega-panel {
    display: none;
    animation: megaFadeIn 0.2s ease;
}

.mega-panel.is-active {
    display: block;
}

@keyframes megaFadeIn {
    from { opacity: 0; transform: translateX(6px); }
    to { opacity: 1; transform: translateX(0); }
}

.mega-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

.mega-panel-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #171717;
}

.mega-panel-link {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #ef233c;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.mega-panel-link:hover {
    color: #c1121f;
    text-decoration: underline;
}

.mega-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem 2rem;
}

.mega-cat-group-title {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: #171717;
    margin-bottom: 0.5rem;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid #fecaca;
}

.mega-cat-group-title:hover {
    color: #ef233c;
}

.mega-cat-sub {
    display: block;
    font-size: 0.8125rem;
    color: #64748b;
    padding: 0.3rem 0;
    line-height: 1.4;
}

.mega-cat-sub:hover {
    color: #ef233c;
    padding-left: 0.25rem;
}

/* Kategori tetikleyici butonu — siyah/kırmızı (eski mavi gradyan kaldırıldı) */
.btn-all-categories {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0 1.25rem;
    height: 100%;
    min-height: 48px;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #fff !important;
    background: linear-gradient(135deg, #c1121f 0%, #ef233c 55%, #ff4d6d 100%) !important;
    background-color: #ef233c !important;
    border: none !important;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.btn-all-categories:hover,
.btn-all-categories.is-open,
.btn-all-categories:focus-visible {
    background: linear-gradient(135deg, #ef233c 0%, #ff4d6d 100%) !important;
    background-color: #ef233c !important;
    box-shadow: inset 0 -2px 0 rgba(255, 255, 255, 0.35) !important;
}

.btn-all-categories svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Ana navigasyon */
.site-nav-primary {
    border-top: 1px solid #e2e8f0;
    background: #fff;
    position: relative;
    z-index: 50;
}

.site-nav-inner {
    display: flex;
    align-items: stretch;
    min-height: 48px;
}

.site-nav-links {
    display: flex;
    align-items: stretch;
    flex: 1;
    min-width: 0;
}

.site-nav-item {
    position: relative;
}

.site-nav-link {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    height: 100%;
    padding: 0 1.125rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
    white-space: nowrap;
    transition: color 0.15s, background 0.15s;
}

.site-nav-link:hover,
.site-nav-item.is-open > .site-nav-link {
    color: #171717;
    background: #f5f5f5;
}

.site-nav-dropdown {
    position: absolute;
    left: 0;
    top: 100%;
    min-width: 240px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-top: 2px solid #ef233c;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    z-index: 50;
}

.site-nav-item:hover .site-nav-dropdown,
.site-nav-item.is-open .site-nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.site-nav-dropdown a {
    display: block;
    padding: 0.625rem 1.25rem;
    font-size: 0.8125rem;
    color: #475569;
}

.site-nav-dropdown a:hover {
    background: #f8fafc;
    color: #ef233c;
}

/* Mobil */
.mobile-drawer {
    position: fixed;
    inset: 0;
    z-index: 60;
    pointer-events: none;
}

.mobile-drawer.is-open {
    pointer-events: auto;
}

.mobile-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    opacity: 0;
    transition: opacity 0.25s;
}

.mobile-drawer.is-open .mobile-drawer-backdrop {
    opacity: 1;
}

.mobile-drawer-panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 88vw);
    background: #fff;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.mobile-drawer.is-open .mobile-drawer-panel {
    transform: translateX(0);
}

@media (max-width: 1023px) {
    .mega-menu-backdrop,
    .mega-overlay {
        display: none !important;
    }
    .site-nav-primary {
        display: none !important;
    }
}

@media (min-width: 1024px) {
    .mobile-menu-trigger {
        display: none !important;
    }
}
