:root {
    --primary: #3498db;
    --dark: #2c3e50;
    --light: #f4f4f4;
    --white: #ffffff;
    --border: #ddd;
    --success: #27ae60;
    --danger: #e74c3c;
    --whatsapp: #25d366;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light);
    color: #333;
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

header {
    background: var(--white);
    color: var(--dark);
    padding: 0.5rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo Styling */
.logo {
    height: 60px;
    width: auto;
    display: block;
}

/* Header Search */
.header-search {
    flex: 1;
    max-width: 500px;
    margin: 0 2rem;
    position: relative;
}

.header-search form {
    position: relative;
}

.header-search input {
    width: 100%;
    padding: 0.75rem 1.2rem;
    border: 1px solid #e0e0e0;
    border-radius: 50px;
    outline: none;
    font-size: 0.95rem;
    background: #f8f9fa;
    transition: all 0.3s;
}

.header-search input:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--white);
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    z-index: 1000;
    display: none;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 5px;
}

.search-suggestions.active {
    display: block;
}

.suggestion-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    color: inherit;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: #f8f9fa;
}

.suggestion-img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    margin-right: 15px;
    border-radius: 4px;
    background: #eee;
}

.suggestion-info {
    flex: 1;
}

.suggestion-info h4 {
    margin: 0 0 3px;
    font-size: 0.9rem;
    color: var(--dark);
    font-weight: 600;
    line-height: 1.2;
}

.suggestion-info span {
    font-size: 0.8rem;
    color: #888;
}

.suggestion-price {
    font-weight: bold;
    color: var(--primary);
    font-size: 0.9rem;
    margin-left: 10px;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s;
}

.btn-sync {
    background: var(--primary);
    color: var(--white);
}

.btn-sync:hover {
    background: #2980b9;
}

.btn-contact {
    background: var(--success);
    color: var(--white);
    font-weight: bold;
}

.btn-contact:hover {
    background: #219150;
}

.main-content {
    display: flex;
    gap: 2rem;
}

/* Sidebar Navigation */
.sidebar {
    flex: 0 0 250px; /* Sabit genişlik */
    background: var(--white);
    padding: 0; /* Padding'i sıfırladık, iç elemanlar halledecek */
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    height: fit-content;
    position: relative;
    z-index: 100;
}

.sidebar h3 {
    margin: 0;
    padding: 1rem;
    background: #2c3e50;
    color: #fff;
    border-radius: 8px 8px 0 0;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Parent Category Items */
.sidebar > ul > li {
    position: relative;
    border-bottom: 1px solid #eee;
}

.sidebar > ul > li:last-child {
    border-bottom: none;
}

.sidebar > ul > li > a, 
.sidebar > ul > li > span.nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    color: #333;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    font-weight: 500;
}

.sidebar > ul > li > a:hover, 
.sidebar > ul > li:hover > a,
.sidebar > ul > li:hover > span.nav-header {
    background: #f8f9fa;
    color: var(--primary);
}

.sidebar > ul > li > a.active {
    color: var(--primary);
    font-weight: bold;
}

/* Arrow for items with submenus */
.has-children > span.nav-header::after {
    content: '›';
    font-size: 1.2rem;
    font-weight: bold;
    color: #ccc;
}

.sidebar > ul > li:hover > span.nav-header::after {
    color: var(--primary);
}

/* Submenu (Flyout) Styles */
.sub-menu {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    width: 600px; /* Geniş flyout panel */
    min-height: 100%;
    background: var(--white);
    box-shadow: 5px 0 15px rgba(0,0,0,0.1);
    border: 1px solid #eee;
    border-left: 3px solid var(--primary);
    padding: 1.5rem;
    z-index: 101;
    border-radius: 0 8px 8px 8px;
    
    /* Grid layout for subcategories */
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    align-content: start;
}

.sidebar > ul > li:hover .sub-menu {
    display: grid;
}

.sub-menu li a {
    display: block;
    padding: 0.5rem 0;
    color: #555;
    text-decoration: none;
    transition: color 0.2s;
    font-size: 0.95rem;
}

.sub-menu li a:hover {
    color: var(--primary);
    transform: translateX(5px);
}

/* Empty message inside main content styling update */
.empty-msg {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    background: var(--white);
    border-radius: 8px;
    color: #777;
    border: 1px dashed #ddd;
}

.product-list {
    flex: 3;
}

.search-bar {
    margin-bottom: 1.5rem;
}

.search-bar form {
    display: flex;
    gap: 0.5rem;
}

.search-bar input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.search-bar button {
    padding: 0.75rem 1.5rem;
    background: var(--dark);
    color: var(--white);
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

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

.card {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.2s;
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.card:hover {
    transform: translateY(-5px);
}

.card-img {
    height: 200px;
    overflow: hidden;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.card-body {
    padding: 1rem;
}

.code {
    font-size: 0.8rem;
    color: #888;
}

.card-body h4 {
    margin: 0.5rem 0;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.price {
    font-weight: bold;
    color: var(--dark);
}

.stock {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.instock {
    background: #e8f8f5;
    color: var(--success);
}

.outstock {
    background: #fdedec;
    color: var(--danger);
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .header-search {
        margin: 0;
        width: 100%;
        max-width: 100%;
    }

    .sidebar {
        flex: auto;
        width: 100%;
    }

    .sidebar-header-mobile {
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
    }

    .sidebar ul {
        display: none;
    }

    .sidebar ul.show {
        display: block;
    }
    
    .btn-toggle-sidebar {
        background: none;
        border: none;
        color: white;
        font-size: 1.2rem;
        cursor: pointer;
    }
    
    /* Mobile Submenu Adjustment */
    .sub-menu {
        position: static;
        width: 100%;
        box-shadow: none;
        border: none;
        padding: 0.5rem 1rem;
        background: #f9f9f9;
        display: none; /* Hide by default on mobile too */
        grid-template-columns: 1fr; /* Single column on mobile */
    }
    
    .sidebar > ul > li:hover .sub-menu {
        display: none; /* Disable hover on mobile */
    }
    
    .sidebar > ul > li.active-mobile .sub-menu {
        display: block; /* Show when clicked */
    }
}

/* WhatsApp Floating Button */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 40px;
    right: 40px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 3px #999;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    background-color: #20b857;
}

.whatsapp-float img {
    width: 35px;
    height: 35px;
}
