:root {
    /* Ana Renk Paleti */
    --fm-primary: #198754;
    --fm-primary-dark: #0f5132;
    --fm-primary-light: #20c997;
    --fm-primary-hover: #157347;
    
    /* Arka Plan ve Arayüz Renkleri */
    --fm-bg-body: #f0f2f5;
    --fm-bg-light: #f8f9fa;
    --fm-white: #ffffff;
    
    /* Sınır ve Çizgi Renkleri */
    --fm-border-light: #eef2f6;
    --fm-border-dark: #e9ecef;
    --fm-border-input: #dee2e6;
    
    /* Metin Renkleri */
    --fm-text-dark: #212529;
    --fm-text-muted: #6c757d;
    --fm-text-light: #adb5bd;
    
    /* Uyarı ve Durum Renkleri */
    --fm-gold: #ffc107;
    --fm-gold-light: #FFD700;
    --fm-danger: #dc3545;
    --fm-blue: #0d6efd;
    --fm-orange: #fd7e14;
    --fm-purple: #6610f2;
    
    /* Gölgeler */
    --fm-shadow-sm: 0 2px 5px rgba(0,0,0,0.02);
    --fm-shadow-md: 0 4px 12px rgba(0,0,0,0.05);
    --fm-shadow-lg: 0 8px 24px rgba(25, 135, 84, 0.25);
    --fm-shadow-hover: 0 16px 40px rgba(0,0,0,0.12);
    
    /* Kenar Yuvarlaklıkları (Border Radius) */
    --fm-radius-sm: 8px;
    --fm-radius-md: 12px;
    --fm-radius-lg: 16px;
    --fm-radius-xl: 20px;
    --fm-radius-pill: 50px;
}

body { background-color: var(--fm-bg-body); font-family: 'Segoe UI', sans-serif; }
.main-content { margin-left: 0; padding: 20px; transition: 0.3s; }

/* Eğer sidebar varsa PHP'den style olarak margin eklenecek, varsayılan 0 */

/* MİSAFİR KARŞILAMA BANNER */
.guest-banner {
    background: linear-gradient(135deg, var(--fm-primary) 0%, var(--fm-primary-dark) 100%);
    border-radius: var(--fm-radius-lg);
    color: var(--fm-white);
    padding: 22px 30px;
    margin-bottom: 20px;
    box-shadow: 0 6px 20px rgba(25, 135, 84, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    position: relative;
    overflow: hidden;
}
/* Dekoratif arka plan ikonu */
.guest-banner::after {
    content: '\f4c4';
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    right: 260px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 6rem;
    opacity: 0.06;
    color: var(--fm-white);
    pointer-events: none;
}
.guest-banner-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}
.guest-banner-icon {
    width: 48px; height: 48px;
    background: rgba(255,255,255,0.15);
    border-radius: var(--fm-radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.guest-banner-title {
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0 0 4px 0;
    line-height: 1.3;
}
.guest-banner-sub {
    font-size: 0.875rem;
    margin: 0;
    opacity: 0.88;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.guest-banner-badge {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--fm-radius-xl);
    padding: 2px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}
.guest-banner-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}
.guest-banner-actions .btn {
    font-size: 0.9rem;
    padding: 8px 22px;
}

@media (max-width: 768px) {
    .guest-banner {
        flex-direction: column;
        text-align: center;
        padding: 18px 20px;
        gap: 14px;
    }
    .guest-banner::after { display: none; }
    .guest-banner-left { flex-direction: column; text-align: center; gap: 10px; }
    .guest-banner-sub { justify-content: center; }
    .guest-banner-actions { width: 100%; justify-content: center; }
    .guest-banner-actions .btn { flex: 1; }

    /* Sticky CTA mobil düzeltme */
    .guest-sticky-cta { padding: 10px 12px; }
    .guest-sticky-inner {
        flex-wrap: wrap;
        gap: 6px;
        align-items: center;
    }
    .guest-sticky-text {
        font-size: 0.82rem;
        flex: 1 1 auto;
        min-width: 0;
        order: 1;
    }
    .guest-sticky-text .text-muted { display: none; }
    .guest-sticky-close {
        order: 2;
        flex-shrink: 0;
    }
    .guest-sticky-actions {
        flex: 1 1 100%;
        order: 3;
        display: flex;
        gap: 8px;
    }
    .guest-sticky-actions .btn {
        flex: 1;
        font-size: 0.82rem;
        padding: 8px 10px;
        text-align: center;
    }

    .search-sticky-row {
        top: 0;
    }

    .main-content { padding-bottom: 80px; }
}

/* STİCKY ALT CTA BAR */
.guest-sticky-cta {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 1040;
    background: var(--fm-white);
    border-top: 2px solid var(--fm-border-dark);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.10);
    padding: 12px 20px;
    animation: slideUpCta 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes slideUpCta {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.guest-sticky-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.guest-sticky-text {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    color: var(--fm-text-dark);
    flex: 1;
    min-width: 0;
}
.guest-sticky-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.guest-sticky-close {
    background: none;
    border: none;
    color: var(--fm-text-light);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 1rem;
    line-height: 1;
    transition: color 0.2s;
    border-radius: 50%;
}
.guest-sticky-close:hover { color: var(--fm-text-muted); background: var(--fm-bg-light); }
.guest-sticky-close:focus-visible { outline: 2px solid var(--fm-primary); outline-offset: 2px; }

/* Sticky bar açıkken içerik alta kaçmasın */
body.has-guest-cta .main-content { padding-bottom: 70px; }
@media (max-width: 768px) {
    body.has-guest-cta .main-content { padding-bottom: 130px; }
}

.info-banner { background: linear-gradient(135deg, var(--fm-primary) 0%, var(--fm-primary-light) 100%); border-radius: var(--fm-radius-lg); color: var(--fm-white); padding: 25px; position: relative; overflow: hidden; margin-bottom: 25px; box-shadow: var(--fm-shadow-lg); }
.info-banner::after { content: '\f4c4'; font-family: "Font Awesome 6 Free"; font-weight: 900; position: absolute; right: 30px; top: 50%; transform: translateY(-50%); font-size: 5rem; opacity: 0.1; color: var(--fm-white); }

/* Alım İlanı Hero CTA */
.alim-hero-cta { backdrop-filter: blur(8px); transition: background 0.2s; }
.alim-hero-cta:hover { background: rgba(255,255,255,0.18) !important; }

.ticker-container { display: flex; align-items: center; background: var(--fm-white); border-radius: var(--fm-radius-md); overflow: hidden; border: 1px solid var(--fm-border-dark); margin-bottom: 20px; box-shadow: var(--fm-shadow-md); }
.ticker-label { background: var(--fm-primary); color: var(--fm-white); font-weight: 800; font-size: 0.85rem; padding: 8px 15px; white-space: nowrap; z-index: 2; }
.ticker-wrap { flex-grow: 1; overflow: hidden; white-space: nowrap; }
.ticker-move { display: inline-block; animation: ticker 60s linear infinite; }
.ticker-wrap:hover .ticker-move { animation-play-state: paused; }
.ticker-item { display: inline-block; padding: 8px 20px; font-size: 0.85rem; border-right: 1px solid #f0f0f0; }
@keyframes ticker { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* YAPIŞKAN (STICKY) ARAMA SATIRI */
.search-sticky-row {
    position: sticky;
    top: 0;
    z-index: 1025;
    background: var(--fm-bg-body);
    padding-top: 10px;
    padding-bottom: 6px;
    margin-left: -15px;
    margin-right: -15px;
    padding-left: 15px;
    padding-right: 15px;
}

/* YAPIŞKAN (STICKY) KATEGORİ BARI */
.category-scroll-wrapper {
    position: sticky; top: 72px; z-index: 1020;
    background: var(--fm-bg-body);
    margin-left: -15px; margin-right: -15px;
}
.category-scroll-wrapper::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 60px;
    background: linear-gradient(to right, transparent, var(--fm-bg-body));
    pointer-events: none;
    z-index: 1;
}
.category-scroll-container { 
    display: flex; gap: 12px; overflow-x: auto; padding: 10px 10px 15px 10px; 
    scroll-behavior: smooth; -webkit-overflow-scrolling: touch; 
    scrollbar-width: thin; 
    scrollbar-color: var(--fm-primary) var(--fm-border-dark); 
    position: relative;
    margin-left: 0; margin-right: 0;
}
.category-scroll-container::-webkit-scrollbar { height: 6px; }
.category-scroll-container::-webkit-scrollbar-track { background: var(--fm-border-dark); border-radius: 10px; }
.category-scroll-container::-webkit-scrollbar-thumb { background: var(--fm-primary); border-radius: 10px; }
.category-scroll-container::-webkit-scrollbar-thumb:hover { background: var(--fm-primary-hover); }

.modern-cat-btn { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; padding: 8px 20px; background: var(--fm-white); border: 2px solid var(--fm-border-light); border-radius: var(--fm-radius-pill); text-decoration: none; color: #555; transition: all 0.3s ease; box-shadow: var(--fm-shadow-sm); white-space: nowrap; font-weight: 600; font-size: 0.9rem; }
.modern-cat-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.08); color: var(--fm-primary); border-color: var(--fm-primary); }
.modern-cat-btn:focus-visible { outline: 3px solid var(--fm-primary); outline-offset: 2px; color: var(--fm-primary); border-color: var(--fm-primary); }
.modern-cat-btn.active { background: linear-gradient(145deg, var(--fm-primary), var(--fm-primary-hover)); color: var(--fm-white); border-color: var(--fm-primary); box-shadow: 0 4px 12px rgba(25, 135, 84, 0.3); }

/* SKELETON LOADER CSS */
.skeleton-card { border: 1px solid var(--fm-border-light); border-radius: var(--fm-radius-xl); background: var(--fm-white); overflow: hidden; height: 100%; display: flex; flex-direction: column; pointer-events: none; }
.skeleton-pulse { animation: shimmer 1.5s infinite linear; background: linear-gradient(90deg, var(--fm-bg-body) 25%, #e2e8f0 50%, var(--fm-bg-body) 75%); background-size: 200% 100%; }
.skeleton-img { height: 240px; width: 100%; }
.skeleton-body { padding: 15px; display: flex; flex-direction: column; flex-grow: 1; gap: 10px; }
.skeleton-title { height: 20px; width: 80%; border-radius: 4px; }
.skeleton-price { height: 24px; width: 40%; border-radius: 4px; align-self: flex-end; margin-top: -30px; }
.skeleton-line { height: 14px; width: 100%; border-radius: 4px; }
.skeleton-line.short { width: 60%; }
.skeleton-footer { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 15px; border-top: 1px solid #eee; }
.skeleton-avatar { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* VİTRİN SLIDER CSS */
.showcase-wrapper { margin-bottom: 30px; }
.showcase-header { display: flex; align-items: center; margin-bottom: 15px; padding-left: 5px;}
.showcase-header h5 { font-weight: 800; color: var(--fm-text-dark); margin: 0; display: flex; align-items: center; }
.showcase-scroll { display: flex; gap: 15px; overflow-x: auto; padding-bottom: 20px; padding-left: 5px; padding-right: 5px; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.showcase-scroll::-webkit-scrollbar { display: none; }
.showcase-item { flex: 0 0 280px; }
@media (max-width: 768px) { .showcase-item { flex: 0 0 240px; } }

/* PRODUCT CARDS */
.product-card { border: 1px solid var(--fm-border-light); border-radius: var(--fm-radius-xl); background: var(--fm-white); transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); overflow: hidden; height: 100%; position: relative; display: flex; flex-direction: column; }
.product-card:hover { transform: translateY(-8px); box-shadow: var(--fm-shadow-hover); border-color: #d0d7de; }

/* Düzeltme: Specificity Savaşı ( !important kuralı kaldırıldı) */
.product-card.showcase-card { 
    border: 2px solid var(--fm-gold); 
    box-shadow: 0 8px 25px rgba(255, 193, 7, 0.2); 
    background: linear-gradient(180deg, #fffdf5 0%, var(--fm-white) 100%); 
}

.product-card.pending-listing { border: 2px dashed var(--fm-gold); background-color: #fffdf5; opacity: 0.9; }
.badge-pending { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 30; background: rgba(0, 0, 0, 0.7); color: var(--fm-white); padding: 10px 20px; border-radius: var(--fm-radius-pill); font-weight: bold; white-space: nowrap; backdrop-filter: blur(4px); box-shadow: 0 4px 15px rgba(0,0,0,0.3); font-size: 0.9rem; pointer-events: none;}

.product-card.pro-listing { border: 2px solid var(--fm-border-light); background: linear-gradient(180deg, #fffefb 0%, var(--fm-white) 100%); }
.product-card.pro-listing::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--fm-gold), #ff9800); }
.pro-badge { position: absolute; top: 12px; left: 12px; z-index: 20; background: linear-gradient(135deg, var(--fm-gold) 0%, #ff9800 100%); color: #000; padding: 6px 12px; border-radius: var(--fm-radius-sm); font-size: 0.7rem; font-weight: 800; box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4); animation: pulse-badge 2s infinite; }

.firsat-badge { position: absolute; top: 12px; right: 12px; z-index: 25; background: linear-gradient(135deg, var(--fm-primary), var(--fm-primary-light)); color: var(--fm-white); padding: 6px 12px; border-radius: var(--fm-radius-sm); font-weight: 800; font-size: 0.75rem; letter-spacing: 0.5px; box-shadow: 0 3px 10px rgba(25, 135, 84, 0.5); animation: pulse 2s infinite; display:flex; align-items:center; gap:5px;}

@keyframes pulse-badge { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }

/* Düzeltme: Specificity Savaşı ( !important kuralı kaldırıldı) */
.product-card.sponsored-listing { border: 2px solid var(--fm-gold-light); background: linear-gradient(180deg, #fffff0 0%, var(--fm-white) 100%); box-shadow: 0 0 20px rgba(255, 215, 0, 0.25); z-index: 2; }
.product-card.sponsored-listing:hover { box-shadow: 0 0 25px rgba(255, 215, 0, 0.4); transform: translateY(-7px) scale(1.01); }

.badge-sponsored { position: absolute; top: 12px; left: 12px; z-index: 25; background: linear-gradient(135deg, var(--fm-gold-light), var(--fm-gold)); color: #000; padding: 6px 12px; border-radius: var(--fm-radius-sm); font-weight: 800; font-size: 0.75rem; letter-spacing: 0.5px; box-shadow: 0 3px 8px rgba(255, 193, 7, 0.4); animation: pulse 2s infinite; }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }
.btn-boost { background: linear-gradient(135deg, var(--fm-purple), #6f42c1); color: var(--fm-white); border: none; font-size: 0.8rem; font-weight: bold; padding: 5px 15px; border-radius: var(--fm-radius-xl); box-shadow: 0 4px 10px rgba(111, 66, 193, 0.3); transition: 0.3s; width: 100%; display: block; margin-top: 5px; }

.img-container { height: 240px; position: relative; overflow: hidden; background: linear-gradient(135deg, var(--fm-bg-light) 0%, var(--fm-border-dark) 100%); }
.img-container img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.product-card:not(.pending-listing):hover .img-container img { transform: scale(1.08); }
.price-badge { font-size: 1.3rem; font-weight: 800; color: var(--fm-primary); text-shadow: 0 1px 2px rgba(0,0,0,0.1); }

.seller-info-box { display: flex; flex-direction: column; justify-content: center;}
.seller-stars { color: var(--fm-gold); font-size: 0.75rem; display: flex; align-items: center; gap: 2px;}

.card-actions { position: absolute; top: 12px; right: 12px; z-index: 20; display: flex; gap: 8px; }
.has-firsat .card-actions { top: 45px; }

.action-btn { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,0.95); backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; color: #555; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); border: none; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.action-btn:focus-visible { outline: 3px solid var(--fm-primary); outline-offset: 2px; }
.action-btn.active { color: var(--fm-danger); background: var(--fm-white); }
.action-btn.fav-active { color: var(--fm-gold); background: var(--fm-white); }
.feature-badge { font-size: 0.7rem; padding: 4px 10px; border-radius: 6px; font-weight: 700; color: var(--fm-white); box-shadow: 0 2px 6px rgba(0,0,0,0.2); }
/* Tıklanabilir feature badge hover efekti */
a.feature-badge { transition: transform 0.15s, box-shadow 0.15s; cursor: pointer; }
a.feature-badge:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 4px 10px rgba(0,0,0,0.25); }

/* Misafir favori butonu — kalp ikonu */
.action-btn.fav-active { color: #dc3545; background: var(--fm-white); }

.bg-organic { background-color: var(--fm-primary); }
.bg-fast { background-color: var(--fm-blue); }
.bg-bulk { background-color: var(--fm-orange); }
.bg-shipping { background-color: var(--fm-purple); }
.bg-negotiate { background-color: var(--fm-primary-light); }

.desc-truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; font-size: 0.9rem; color: var(--fm-text-muted); height: 1.5em; line-height: 1.5; cursor: help; }
.modal-content { border-radius: 24px; border: none; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.type-option { display: none; }
.type-label { display: flex; align-items: center; justify-content: center; gap: 10px; border: 2px solid var(--fm-border-input); border-radius: var(--fm-radius-md); padding: 16px; cursor: pointer; transition: all 0.3s; background: var(--fm-white); height: 100%; color: #555; font-size: 1rem; font-weight: 600; }
.type-label:hover { background: var(--fm-bg-light); border-color: var(--fm-text-light); transform: translateY(-2px); }
.type-option:checked + .type-label.sell-label { border-color: var(--fm-primary); background: #d1e7dd; color: var(--fm-primary); box-shadow: 0 4px 12px rgba(25, 135, 84, 0.2); border-width: 3px; }
.type-option:checked + .type-label.buy-label { border-color: var(--fm-blue); background: #cfe2ff; color: var(--fm-blue); box-shadow: 0 4px 12px rgba(13, 110, 253, 0.2); border-width: 3px; }
.upload-area { border: 3px dashed var(--fm-border-input); border-radius: var(--fm-radius-lg); padding: 20px; text-align: center; background: var(--fm-bg-light); cursor: pointer; transition: all 0.3s; }
.upload-area:hover { border-color: var(--fm-primary); background: #f0fff4; }
.upload-area:focus-visible { outline: 3px solid var(--fm-primary); outline-offset: 2px; border-color: var(--fm-primary); background: #f0fff4; }

/* KOMPAKT ÜST MENÜ HİZALAMASI */
.compact-menu-wrapper {
    display: flex;
    flex-wrap: wrap; 
    align-items: center;
    gap: 15px; 
    width: 100%;
}

.compact-search-form {
    flex: 0 1 350px; 
    min-width: 200px;
    margin-bottom: 0 !important;
}

.compact-filter-group,
.compact-action-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (max-width: 991px) {
    .compact-search-form {
        flex: 1 1 100%; 
        max-width: 100%;
    }
    .compact-filter-group {
        flex: 1 1 auto; 
    }
}

/* Mobil için inline stilleri zorlamak amacıyla !important kullanımına izin verilir */
@media (max-width: 768px) {
    .main-content { margin-left: 0 !important; padding: 8px; padding-bottom: 100px; }
    #sidebar { display: none; }
    .desktop-actions { display: none !important; }
    .img-container { height: 200px; } 
    .modern-cat-btn { padding: 6px 14px; font-size: 0.8rem; }
    #itemModal .modal-body { padding-bottom: 100px !important; max-height: 80vh; overflow-y: auto; }
    .category-scroll-wrapper { margin-left: 0; margin-right: 0; top: 64px; }
    .category-scroll-wrapper::after { width: 40px; } 
    .category-scroll-container { padding-top: 15px; }
    .mobile-cat-dropdown {
        width: 260px !important;
        max-width: 85vw !important;
        z-index: 1050 !important;
        padding-right: 5px !important;
    }
    .mobile-cat-dropdown .dropdown-item { white-space: normal !important; }
}

/* ERİŞİLEBİLİRLİK: Harekete duyarlı kullanıcılar için animasyonları kapat */
@media (prefers-reduced-motion: reduce) {
    .ticker-move { animation: none; }
    .skeleton-pulse { animation: none; background: var(--fm-border-dark); }
    .pro-badge { animation: none; }
    .firsat-badge { animation: none; }
    .badge-sponsored { animation: none; }
    .guest-sticky-cta { animation: none; }
    .product-card { transition: none; }
    .product-card:hover { transform: none; }
    .img-container img { transition: none; }
    .product-card:not(.pending-listing):hover .img-container img { transform: none; }
    .modern-cat-btn { transition: none; }
    .modern-cat-btn:hover { transform: none; }
    .type-label { transition: none; }
    .upload-area { transition: none; }
}