/* QuakeLogic Mega Menu v3.5 — Enhanced Desktop Layout & Product Showcase */

/* ════════════════════════════════════════
   1. GENEL / RESET
════════════════════════════════════════ */
.ql-mega-container {
    width: 100%;
    position: relative;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ════════════════════════════════════════
   2. DESKTOP VERSION (> 1024px)
════════════════════════════════════════ */
@media (min-width: 1025px) {
    .ql-m-mobile { display: none !important; }
    
    .ql-mega-wrap {
        display: flex;
        background: #fff;
        border-radius: 33px;
        box-shadow: 0 12px 40px rgba(0,0,0,.14);
        width: 920px; /* Genişlik sabitlendi */
        max-width: 1240px;
        position: absolute;
        top: 100%;
        left: 0; /* JS ile dinamik ayarlanacak */
        margin-top: 15px;
        overflow: visible; /* Köprü için önemli */
        z-index: 9999;
    }
    
    /* Buton ile menü arasındaki boşlukta kapanmamasını sağlayan "Hover Köprüsü" */
    .ql-mega-wrap::before {
        content: '';
        position: absolute;
        top: -25px; 
        left: 0;
        right: 0;
        height: 25px;
        background: transparent;
        z-index: -1;
    }

    .ql-mega-cats {
        width: 240px;
        flex-shrink: 0;
        background: #f8f8f8;
        border-right: 1px solid #eee;
        overflow-y: auto;
        padding: 8px 6px;
        max-height: 480px;
    }
    .ql-mega-cats-title {
        font-size: 10px; font-weight: 700; letter-spacing: .9px;
        text-transform: uppercase; color: #bbb; padding: 6px 10px 10px;
    }
    .ql-cat-btn {
        display: flex; align-items: center; width: 100%; gap: 6px;
        padding: 9px 10px; border: none; background: none;
        border-radius: 6px; cursor: pointer; font-family: inherit;
        font-size: 12.5px; color: #444; text-align: left;
        transition: background .12s, color .12s; line-height: 1.3;
    }
    .ql-cat-btn:hover { background: #fff; color: #111; }
    .ql-cat-btn.ql-active { background: #fff; color: #F26522; font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
    .ql-cat-name { 
        flex: 1; 
        white-space: normal; /* Alt satıra geçsin */
        overflow: visible; 
        text-overflow: clip; 
        text-transform: uppercase;
        word-wrap: break-word;
        padding-right: 4px;
    }
    .ql-cat-count {
        font-size: 10px; color: #bbb; background: #ebebeb;
        border-radius: 4px; padding: 1px 5px; flex-shrink: 0;
    }
    .ql-cat-btn.ql-active .ql-cat-count { background: rgba(242,101,34,.12); color: #F26522; }
    .ql-cat-arr { font-size: 9px; color: #ccc; flex-shrink: 0; }
    .ql-cat-btn.ql-active .ql-cat-arr { color: #F26522; }

    .ql-mega-subs {
        flex: 1; display: flex; flex-direction: column;
        min-width: 0; overflow: hidden; background: #fff;
    }
    .ql-m-scroll-wrap { 
        flex: 1; 
        overflow-y: auto; 
        max-height: 430px; 
        display: flex; 
        flex-direction: column;
    }
    
    .ql-mega-subs-inner {
        flex: 1; /* İçeriği yay ki footer'ı aşağı itebilsin */
        display: flex; gap: 0; padding: 16px 20px;
        flex-wrap: wrap; 
    }
    .ql-subs-col { width: 230px; flex-shrink: 0; padding-bottom: 5px; }
    .ql-subs-col + .ql-subs-col { border-left: 1px solid #eee; padding-left: 20px; }
    
    /* 2. Sütun çok uzunsa kendi içinde kaysın */
    .ql-scroll-col {
        max-height: 380px;
        overflow-y: auto;
        padding-right: 5px;
    }
    
    /* Özel Kaydırma Çubuğu Stili */
    .ql-scroll-col::-webkit-scrollbar { width: 4px; }
    .ql-scroll-col::-webkit-scrollbar-track { background: #f9f9f9; }
    .ql-scroll-col::-webkit-scrollbar-thumb { background: #eee; border-radius: 10px; }
    .ql-scroll-col::-webkit-scrollbar-thumb:hover { background: #F26522; }

    .ql-subs-title {
        font-size: 10px; font-weight: 700; letter-spacing: .7px;
        text-transform: uppercase; color: #bbb; padding-bottom: 8px;
        margin-bottom: 6px; border-bottom: 1px solid #f0f0f0;
    }
    .ql-sub-link {
        display: flex; align-items: center; gap: 8px; padding: 6px 6px;
        border-radius: 5px; font-size: 12.8px; color: #555;
        text-decoration: none; transition: background .1s, color .1s;
        margin-bottom: 1px;
    }
    .ql-sub-link:hover { background: #f8f8f8; color: #111; }
    .ql-sub-dot {
        width: 4px; height: 4px; border-radius: 50%;
        background: #F26522; flex-shrink: 0; opacity: 0; transition: opacity .12s;
    }
    .ql-sub-link:hover .ql-sub-dot { opacity: 1; }

    .ql-mega-preview {
        width: 220px; flex-shrink: 0; border-left: 1px solid #eee;
        padding: 24px 20px; display: flex; flex-direction: column; align-items: flex-start;
        background: #fafafa;
    }
    .ql-preview-img {
        width: 100%; aspect-ratio: 1/1; border-radius: 12px;
        background: #fff; border: 1px solid #eee;
        display: flex; align-items: center; justify-content: center;
        overflow: hidden; margin-bottom: 15px; flex-shrink: 0;
    }
    .ql-preview-img img { width: 90%; height: 90%; object-fit: contain; }
    .ql-preview-link {
        display: inline-flex; align-items: center; gap: 4px; margin-top: 12px;
        font-size: 13px; color: #F26522; text-decoration: none; font-weight: 700;
        white-space: nowrap; /* İki satır olmasını engelle */
    }

    .ql-mega-footer {
        display: flex; justify-content: flex-end; padding: 12px 20px;
        border-top: 1px solid #eee; background: #fff; flex-shrink: 0;
    }
    .ql-mega-footer-all {
        font-size: 13px; color: #F26522; text-decoration: none; font-weight: 700;
    }
    .ql-mega-footer-all:hover { text-decoration: underline; }
}

/* ════════════════════════════════════════
   3. MOBILE / TABLET VERSION (≤ 1024px)
════════════════════════════════════════ */
@media (max-width: 1024px) {
    .ql-m-desktop { display: none !important; }

    .ql-mobile-wrap {
        width: 98vw !important; margin: 0 auto !important;
        background: #fff; border-radius: 18px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.12);
        border: 1px solid #eee; overflow: hidden;
        position: relative; height: 540px;
    }

    .ql-mobile-main-panel, .ql-mobile-sub-panel {
        position: absolute; top: 0; left: 0; width: 100%; height: 100%;
        background: #fff; transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
        display: flex; flex-direction: column;
    }
    .ql-mobile-main-panel { z-index: 2; transform: translateX(0); }
    .ql-mobile-sub-panel { z-index: 3; transform: translateX(100%); background: #fdfdfd; }

    .ql-mobile-wrap.ql-m-drilled .ql-mobile-main-panel { transform: translateX(-30%); opacity: 0.5; }
    .ql-mobile-wrap.ql-m-drilled .ql-mobile-sub-panel { transform: translateX(0); }

    .ql-mobile-header {
        padding: 14px 16px; font-size: 10px; font-weight: 800;
        text-transform: uppercase; letter-spacing: 1.2px; color: #bbb;
        border-bottom: 1px solid #f2f2f2; flex-shrink: 0;
        background: #fafafa;
        border-top-left-radius: 18px; border-top-right-radius: 18px;
    }
    .ql-mobile-nav { 
        flex: 1; 
        overflow-y: auto !important; 
        -webkit-overflow-scrolling: touch; 
        padding: 10px 0;
    }

    .ql-mobile-cat-btn {
        width: 100%; display: flex; align-items: center; gap: 10px;
        padding: 12px 16px; border: none; background: none;
        border-bottom: 1px solid #f5f5f5; text-align: left;
        font-family: inherit; font-size: 14px; font-weight: 600; color: #222;
        transition: background .12s;
    }
    .ql-mobile-cat-btn:active { background: #f9f9f9; }
    .ql-m-name { flex: 1; text-transform: uppercase; letter-spacing: 0.2px; }
    .ql-m-count { font-size: 10px; color: #999; background: #f0f0f0; padding: 1px 6px; border-radius: 4px; font-weight: 400; }
    .ql-m-arr { color: #ddd; font-size: 14px; }

    .ql-m-back-btn {
        width: 100%; padding: 14px 16px; background: #F26522;
        color: #fff; border: none; text-align: left;
        font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 8px;
        border-top-left-radius: 18px; border-top-right-radius: 18px;
    }
    .ql-m-subs-content { 
        flex: 1; 
        overflow-y: auto; 
        display: flex;
        flex-direction: column;
    }
    
    .ql-m-sub-title {
        padding: 12px 16px 6px; font-size: 10px; font-weight: 800;
        text-transform: uppercase; letter-spacing: 1px; color: #bbb;
        background: #fafafa;
    }
    
    .ql-m-sub-link {
        width: 100%; display: flex; align-items: center; gap: 10px;
        padding: 11px 16px; border: none; background: none;
        border-bottom: 1px solid #f2f2f2; text-align: left;
        font-family: inherit; font-size: 13.5px; font-weight: 600; color: #444;
        text-decoration: none; transition: background .12s;
    }
    .ql-m-sub-link:active { background: #f9f9f9; }
    .ql-m-sub-name { flex: 1; }
}

/* ─── Product Showcase Grid (New) ─── */
.ql-m-prod-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    width: 100%;
}
.ql-m-prod-item {
    background: #fff; border: 1px solid #eee; border-radius: 12px;
    padding: 12px; transition: transform .2s, box-shadow .2s;
    text-decoration: none; color: inherit; display: flex; flex-direction: column;
}
.ql-m-prod-item:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.06); }
.ql-m-prod-img {
    width: 100%; aspect-ratio: 1/1; border-radius: 8px; margin-bottom: 10px;
    overflow: hidden; background: #f9f9f9;
}
.ql-m-prod-img img { width: 100%; height: 100%; object-fit: cover; }
.ql-m-prod-name {
    font-size: 12.5px; font-weight: 700; color: #222; margin-bottom: 5px;
    line-height: 1.3; height: 32px; overflow: hidden; display: -webkit-box;
    -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical;
}
.ql-m-prod-price { display: none !important; }

@media (max-width: 600px) {
    .ql-m-prod-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Common Loader & Global Utils ── */
.ql-mega-loading { padding: 40px; text-align: center; color: #aaa; }
.ql-spinner { width: 24px; height: 24px; margin: 0 auto 10px; border: 3px solid #eee; border-top-color: #F26522; border-radius: 50%; animation: qlSpin .8s linear infinite; }
@keyframes qlSpin { to { transform: rotate(360deg); } }

.ql-go-btn {
    display: inline-block; padding: 10px 20px; background: #F26522;
    color: #fff !important; border-radius: 8px; text-decoration: none;
    font-weight: 700; margin-top: 10px; transition: opacity .2s;
}
.ql-go-btn:hover { opacity: 0.9; }
