/* ==========================================================================
   MekanixApp Storefront - List Pages Standard CSS (v1.0)
   Bu dosya Firmalar, Kampanyalar ve Ä°ÅŸ Ä°lanlarÄ± gibi tÃ¼m listeleme
   sayfalarÄ±ndaki ortak arama Ã§ubuÄŸu, filtreler ve iskelet (skeleton) 
   yapÄ±larÄ±nÄ± standartlaÅŸtÄ±rmak iÃ§in oluÅŸturulmuÅŸtur.
   ========================================================================== */

/* â”€â”€ Sticky Search Toolbar & Smart Scroll â”€â”€ */
.kb-list-toolbar {
    position: sticky;
    top: var(--header-h, 60px);
    z-index: 90;
    background: #fff;
    border: 1px solid var(--kb-border);
    border-radius: 16px;
    padding: 14px 16px 10px;
    margin-bottom: 16px;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s, background 0.3s, border-radius 0.3s, border-color 0.3s;
    will-change: transform;
}
.kb-list-toolbar.is-stuck {
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    border-radius: 0 0 16px 16px;
    border-top-color: transparent;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.kb-list-toolbar.is-hidden {
    transform: translateY(-130%);
    pointer-events: none;
}

/* â”€â”€ Top Row (Search Input & Categories) â”€â”€ */
.kb-list-toolbar-top { display: flex; align-items: center; gap: 10px; margin-bottom: 0; }

.kb-list-search-wrap { 
    flex: 1; display: flex; align-items: stretch; background: #f1f5f9; 
    border-radius: 12px; border: 1px solid transparent; transition: all .2s; 
}
.kb-list-search-wrap:focus-within { 
    background: #fff; border-color: var(--kb-primary); 
    box-shadow: 0 0 0 3px var(--kb-shadow-light); 
}

.kb-list-cat-btn { 
    height: 100%; border: none; background: transparent; 
    border-radius: 12px 0 0 12px; padding: 10px 14px; 
    border-right: 1px solid #cbd5e1; font-weight: 600; color: #475569; 
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer; 
}
.kb-list-cat-btn:hover { background: #e2e8f0; }
.kb-list-cat-btn.active { background: var(--kb-light-bg); color: var(--kb-primary); border-right-color: var(--kb-primary); }
#catLabel { max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: bottom; }

.kb-list-input-area { flex: 1; position: relative; display: flex; align-items: center; }
.kb-list-input-area input { 
    width: 100%; border: none; background: transparent; 
    padding: 10px 40px 10px 16px; font-size: .9rem; outline: none; 
}
.kb-list-input-area .search-icon { position: absolute; right: 16px; color: var(--kb-primary); font-size: 1.1rem; }

/* â”€â”€ Filter Row (Totals & Sorting) â”€â”€ */
.kb-list-filter-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.kb-list-total { font-size: .82rem; color: var(--kb-text-muted); white-space: nowrap; font-weight: 500; }

/* â”€â”€ Sort Button & Dropdown â”€â”€ */
.kb-list-sort-btn {
    display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; 
    border-radius: 10px; border: 1px solid #e2e8f0; background: #f8fafc; 
    color: #475569; font-size: 0.82rem; font-weight: 500; cursor: pointer; 
    transition: all 0.2s; white-space: nowrap; user-select: none; position: relative;
}
.kb-list-sort-btn:hover { border-color: var(--kb-primary); color: var(--kb-primary); }
.kb-list-sort-btn.open { border-color: var(--kb-primary); color: var(--kb-primary); background: var(--kb-hover-bg); }
.kb-list-sort-btn .chevron { font-size: 0.65rem; transition: transform 0.2s; }
.kb-list-sort-btn.open .chevron { transform: rotate(180deg); }

.kb-list-sort-dropdown {
    position: absolute; top: calc(100% + 6px); right: 0; width: 220px; 
    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; 
    box-shadow: 0 12px 30px rgba(0,0,0,0.08); z-index: 1050; display: none; 
    flex-direction: column; overflow: hidden; font-family: 'Outfit', sans-serif;
}
.kb-list-sort-dropdown.show { display: flex; animation: ddSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
.kb-list-sort-item {
    padding: 10px 14px; font-size: 0.88rem; color: #475569; cursor: pointer; 
    transition: background 0.15s, color 0.15s; font-weight: 500;
}
.kb-list-sort-item:hover { background: #f8fafc; color: var(--kb-primary); }
.kb-list-sort-item.active { background: var(--kb-hover-bg); color: var(--kb-primary); font-weight: 600; }

/* â”€â”€ Category Dropdown with Search â”€â”€ */
.kb-list-cat-dropdown {
    position: absolute; top: calc(100% + 6px); left: 0; width: 380px; 
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 16px; 
    box-shadow: 0 12px 40px rgba(0,0,0,.12); z-index: 1060; display: none; 
    flex-direction: column; overflow: hidden; font-family: 'Outfit', sans-serif;
}
.kb-list-cat-dropdown.show { display: flex; animation: ddSlide .2s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes ddSlide { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

.kb-list-cat-search { padding: 14px; border-bottom: 1px solid #e2e8f0; display: flex; align-items: center; gap: 10px; background: #fff; flex-shrink: 0; }
.kb-list-cat-search-input-wrap { position: relative; flex: 1; }
.kb-list-cat-search-input-wrap i.bi-search { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: .9rem; }
.kb-list-cat-search-input-wrap input { 
    width: 100%; padding: 10px 14px 10px 36px; border: 1px solid #e2e8f0; 
    border-radius: 10px; font-size: .9rem; outline: none; background: #f8fafc; transition: all .2s; 
}
.kb-list-cat-search-input-wrap input:focus { border-color: var(--kb-primary); background: #fff; box-shadow: 0 0 0 3px var(--kb-shadow-light); }

.kb-list-cat-clear-all {
    display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; 
    border: 1px solid #e2e8f0; background: #fff; color: #64748b; 
    border-radius: 10px; font-size: 0.85rem; font-weight: 600; cursor: pointer; 
    transition: all 0.2s; white-space: nowrap; box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.kb-list-cat-clear-all:hover { background: #f8fafc; color: #ef4444; border-color: #fca5a5; }

.kb-list-cat-list { max-height: clamp(250px, 50vh, 400px); overflow-y: auto; padding: 8px 0; scrollbar-width: thin; }

.kb-list-cat-group-title {
    padding: 10px 16px; font-size: 0.85rem; font-weight: 800; color: #1e293b; 
    text-transform: uppercase; letter-spacing: 0.8px; background: #f1f5f9; 
    margin-top: 8px; display: flex; align-items: center; gap: 8px; transition: all 0.2s ease;
}
.kb-list-cat-group-title:first-child { margin-top: 0; }
.kb-list-cat-group-title:hover { color: var(--kb-primary); background: #f8fafc; padding-left: 20px; }
.kb-list-cat-group-title::before { content: ""; display: block; width: 4px; height: 14px; background: var(--kb-primary); border-radius: 2px; transition: all 0.2s ease; }
.kb-list-cat-group-title:hover::before { transform: scaleY(1.2); }
.kb-list-cat-group-title.active { color: var(--kb-primary); background: var(--kb-hover-bg); }
.kb-list-cat-group-title .count {
    font-size: 0.75rem; color: #64748b; font-weight: 700; background: #e2e8f0; 
    padding: 2px 8px; border-radius: 20px; margin-left: auto;
}
.kb-list-cat-group-title.active .count { background: var(--kb-light-bg); color: var(--kb-primary); }

.kb-list-cat-item {
    display: flex; align-items: center; justify-content: space-between; 
    padding: 10px 16px 10px 32px; font-size: 0.9rem; font-weight: 500; 
    color: #475569; cursor: pointer; transition: all 0.15s ease; position: relative;
}
.kb-list-cat-item::before {
    content: ""; position: absolute; left: 16px; top: 50%; transform: translateY(-50%); 
    width: 6px; height: 6px; border-radius: 50%; background: #cbd5e1; transition: all 0.15s ease;
}
.kb-list-cat-item:hover { background: #f8fafc; color: var(--kb-primary); padding-left: 36px; }
.kb-list-cat-item:hover::before { background: var(--kb-primary); transform: translateY(-50%) scale(1.3); }
.kb-list-cat-item.active { color: var(--kb-primary); font-weight: 700; background: var(--kb-hover-bg); }
.kb-list-cat-item.active::before { background: var(--kb-primary); width: 8px; height: 8px; left: 15px; }
.kb-list-cat-item .count { font-size: 0.75rem; color: #64748b; font-weight: 600; background: #f1f5f9; padding: 2px 8px; border-radius: 20px; }
.kb-list-cat-item.active .count { background: var(--kb-light-bg); color: var(--kb-primary); }

/* â”€â”€ Mobile 2-Column Responsive Layout â”€â”€ */
@media (max-width: 768px) {
    .kb-list-toolbar { padding: 10px 12px 8px; border-radius: 12px; top: 0; }
    
    /* On mobile, we use CSS Grid to split category and sort button */
    .kb-list-toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .kb-list-toolbar-top { display: contents; }
    .kb-list-search-wrap { display: contents; }
    .kb-list-filter-row { display: contents; }
    
    .cat-wrap { grid-column: 1; grid-row: 1; }
    .kb-list-cat-btn { 
        border-radius: 10px !important; border: 1px solid #e2e8f0 !important; 
        background: #f8fafc !important; justify-content: center; height: 42px; width: 100%; 
    }
    .sort-wrap { grid-column: 2; grid-row: 1; display: flex; }
    .kb-list-sort-btn { width: 100%; border-radius: 10px; justify-content: center; height: 42px; }
    
    .kb-list-input-area { 
        grid-column: 1 / -1; grid-row: 2; background: #f8fafc; border-radius: 10px; 
        border: 1px solid #e2e8f0; height: 42px; 
    }
    .kb-list-input-area input { padding: 10px 40px 10px 16px; height: 100%; }
    
    .kb-list-total { display: none; } /* Hide total on mobile for cleaner look */
    
    .kb-list-cat-dropdown { width: calc(100vw - 24px); max-width: 400px; max-height: 60vh; left: auto; }
    .kb-list-cat-list { max-height: calc(60vh - 70px); }
    .kb-list-cat-item { padding: 10px 16px 10px 32px; font-size: 0.95rem; }
}

/* â”€â”€ Skeleton Loaders â”€â”€ */
.kb-list-skel { background: linear-gradient(90deg,#f1f5f9 25%,#e2e8f0 50%,#f1f5f9 75%); background-size: 200% 100%; animation: skel-pulse 1.5s infinite; border-radius: 8px; }
.kb-list-skel-card { border-radius: 16px; overflow: hidden; border: 1px solid #e2e8f0; background: #fff; height: 320px; display: flex; flex-direction: column; padding: 0; }
.kb-list-skel-img { width: 100%; aspect-ratio: 16/10; height: 180px; }
.kb-list-skel-line { height: 14px; margin: 12px 16px; border-radius: 6px; }
.kb-list-skel-line.w60 { width: 60%; margin-top: 0; }
.kb-list-skel-line.w40 { width: 40%; margin-top: 0; }
.kb-list-skel-line.w80 { width: 80%; }
@keyframes skel-pulse { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Empty State ── */
.kb-list-empty { text-align: center; padding: 48px 20px; color: #94a3b8; background: #fff; border-radius: 16px; border: 1px dashed #cbd5e1; margin: 0; }
.kb-list-empty i { font-size: 3rem; margin-bottom: 12px; display: block; color: #94a3b8; }
.kb-list-empty h3 { font-size: 1.1rem; color: #475569; margin: 0 0 6px; font-weight: 700; }
.kb-list-empty p { font-size: .9rem; margin: 0; color: #64748b; }

/* ── Dynamic Cover (Auto-Generated Placeholder) ── */
.kb-dyn-cover { width: 100%; height: 100%; position: absolute; top: 0; left: 0; display: flex; overflow: hidden; color: #fff; font-family: 'Outfit', sans-serif; z-index: 1; padding: 24px; }
.kb-dyn-cover::after { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E"); opacity: 0.15; mix-blend-mode: overlay; pointer-events: none; z-index: 2; }
.kb-dyn-content { position: relative; z-index: 3; display: flex; flex-direction: column; width: 100%; height: 100%; }
.kb-dyn-subtitle { font-size: 0.8rem; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; opacity: 0.8; margin: 0 0 4px 0; }
.kb-dyn-title { font-size: clamp(1.2rem, 6vw, 1.8rem); font-weight: 900; line-height: 1.1; text-shadow: 0 4px 12px rgba(0,0,0,0.2); margin: 0; text-transform: uppercase; letter-spacing: -0.5px; }

@keyframes wmPulse { 0% { opacity: 0.03; } 50% { opacity: 0.08; } 100% { opacity: 0.03; } }

/* Themes Layouts & Colors */

/* Theme 1: Centered, Bold Gradient (Sunset) */
.kb-dyn-t1 { background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%); }
.kb-dyn-t1 .kb-dyn-content { justify-content: center; align-items: center; text-align: center; }
.kb-dyn-t1 .kb-dyn-wm { position: absolute; right: -5%; bottom: -15%; font-size: 12rem; color: rgba(255,255,255,1); opacity: 0.04; z-index: 1; transform: rotate(-15deg); pointer-events: none; animation: wmPulse 4s infinite ease-in-out; }

/* Theme 2: Bottom-Left Aligned, Dark Slate */
.kb-dyn-t2 { background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%); }
.kb-dyn-t2 .kb-dyn-content { justify-content: flex-end; align-items: flex-start; text-align: left; }
.kb-dyn-t2 .kb-dyn-wm { position: absolute; top: -10%; right: -5%; font-size: 14rem; color: rgba(255,255,255,1); opacity: 0.04; z-index: 1; pointer-events: none; animation: wmPulse 4.5s infinite ease-in-out; }
.kb-dyn-t2 .kb-dyn-title { font-size: clamp(1.4rem, 7vw, 2.2rem); }

/* Theme 3: Glass Box Center, Emerald */
.kb-dyn-t3 { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); padding: 16px; }
.kb-dyn-t3 .kb-dyn-content { justify-content: center; align-items: center; text-align: center; background: rgba(255,255,255,0.15); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: 12px; border: 1px solid rgba(255,255,255,0.3); padding: 16px; height: auto; margin: auto; }
.kb-dyn-t3 .kb-dyn-wm { display: none; }

/* Theme 4: Top-Right Aligned, Amethyst */
.kb-dyn-t4 { background: linear-gradient(135deg, #8E2DE2 0%, #4A00E0 100%); }
.kb-dyn-t4 .kb-dyn-content { justify-content: flex-start; align-items: flex-end; text-align: right; }
.kb-dyn-t4 .kb-dyn-wm { position: absolute; left: -10%; bottom: -10%; font-size: 12rem; color: rgba(255,255,255,1); opacity: 0.04; z-index: 1; transform: rotate(15deg); pointer-events: none; animation: wmPulse 3.5s infinite ease-in-out;}
.kb-dyn-t4 .kb-dyn-title { font-size: clamp(1.2rem, 5vw, 1.6rem); }

/* Theme 5: Split Diagonal, Fire */
.kb-dyn-t5 { background: linear-gradient(45deg, #f12711 50%, #f5af19 50%); }
.kb-dyn-t5 .kb-dyn-content { justify-content: center; align-items: flex-start; text-align: left; }
.kb-dyn-t5 .kb-dyn-title { font-size: clamp(1.6rem, 8vw, 2.4rem); transform: rotate(-5deg); text-shadow: 2px 2px 0 rgba(0,0,0,0.2); }
.kb-dyn-t5 .kb-dyn-wm { display: none; }

/* Theme 6: Bordered Minimalist, Cyber */
.kb-dyn-t6 { background: linear-gradient(135deg, #b224ef 0%, #7579ff 100%); padding: 12px; }
.kb-dyn-t6 .kb-dyn-content { justify-content: center; align-items: center; text-align: center; border: 2px dashed rgba(255,255,255,0.4); border-radius: 8px; height: 100%; }
.kb-dyn-t6 .kb-dyn-wm { position: absolute; right: 50%; top: 50%; transform: translate(50%, -50%); font-size: 10rem; color: rgba(255,255,255,1); opacity: 0.04; z-index: 1; pointer-events: none; animation: wmPulse 5s infinite ease-in-out;}

/* ── Load More ── */
.kb-list-load-more { text-align: center; padding: 20px 0; margin-top: 20px; }
.kb-list-load-more button { 
    padding: 12px 32px; border-radius: 999px; border: 2px solid var(--kb-primary); 
    background: transparent; font-size: 1rem; font-weight: 600; color: var(--kb-primary); 
    cursor: pointer; transition: all 0.2s; 
}
.kb-list-load-more button:hover:not(:disabled) { background: var(--kb-primary); color: #fff; }
.kb-list-load-more button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ¦¦ Page Header ¦¦ */
.kb-list-header { margin-bottom: 16px; }
.kb-list-header h1 { font-family: 'Outfit', sans-serif; font-size: 1.6rem; font-weight: 700; color: var(--kb-text-primary, #1e293b); margin: 0; display: flex; align-items: center; }
.kb-list-header h1 i { color: var(--kb-primary, #0d9488); margin-right: 8px; font-size: 1.5rem; }
.kb-list-header p { color: var(--kb-text-secondary, #64748b); font-size: 0.9rem; margin: 4px 0 0; line-height: 1.5; }

@media (max-width: 767px) {
    .kb-list-header h1 { font-size: 1.3rem; }
    .kb-list-header p { display: none; }
}

