/* 
  Premium E-commerce Design System 
  Typography: Inter (Google Fonts)
*/
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Color Palette - Modern & Premium */
    --primary-color: #0f172a;
    /* Slate 900 */
    --secondary-color: #334155;
    /* Slate 700 */
    --accent-color: #3b82f6;
    /* Blue 500 */
    --accent-hover: #2563eb;
    /* Blue 600 */
    --background-color: #f8fafc;
    /* Slate 50 */
    --surface-color: #ffffff;
    --text-main: #1e293b;
    /* Slate 800 */
    --text-muted: #64748b;
    /* Slate 500 */
    --border-color: #e2e8f0;
    /* Slate 200 */

    /* Spacing & Layout */
    --container-width: 1350px;
    --header-height: 70px;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-hover: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Transitions */
    --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-base);
}

ul {
    list-style: none;
}

/* Layout Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.grid {
    display: grid;
    gap: 24px;
}

/* Header */
header {
    background: var(--surface-color);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

/* Main Layout (Sidebar + Content) */
.main-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 40px;
    padding: 40px 0;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: calc(var(--header-height) + 40px);
    height: fit-content;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    background: var(--surface-color);
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.category-tree ul {
    list-style: none;
    padding-left: 0;
}

/* Sadece alt kategorileri (bir li'nin içindeki ul) gizle */
.category-tree li ul {
    padding-left: 12px;
    border-left: 1px solid var(--border-color);
    margin-left: 8px;
    display: none;
}

.category-tree li {
    margin-bottom: 4px;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-base);
}

.category-item:hover {
    background-color: #f1f5f9;
    color: var(--primary-color);
}

.category-item.active {
    background-color: #eff6ff;
    color: var(--accent-color);
    font-weight: 600;
}

.category-item.has-children::after {
    content: '+';
    font-size: 1.2em;
    font-weight: 300;
    margin-left: 8px;
}

.category-item.has-children.open::after {
    content: '-';
}

/* Alt kategorisi olmayan (yaprak) kategoriler link gibi davranır */
.category-link {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
}

/* Product Grid */
.product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.product-card {
    background: var(--surface-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition-base);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Kartların eşit boyda olmasını sağlar */
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-color);
}

.product-image-wrapper {
    width: 100%;
    height: 260px;
    /* Sabit yükseklik */
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid #f1f5f9;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Görseli kesmeden sığdır */
    padding: 10px;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-info {
    padding: 20px;
    flex-grow: 1;
    /* İçeriği aşağı iter */
    display: flex;
    flex-direction: column;
}

.product-category {
    font-size: 0.8rem;
    color: var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--primary-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8em;
    /* Başlık için sabit alan */
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: auto;
    /* Fiyatı en alta iter */
}

.btn-view {
    display: inline-block;
    width: 100%;
    text-align: center;
    margin-top: 16px;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: var(--transition-base);
}

.btn-view:hover {
    background-color: var(--accent-color);
}

/* Product Detail Page */
.product-detail-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    padding: 40px 0;
}

.detail-image img {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.detail-info h1 {
    font-size: 2.5rem;
    margin-bottom: 16px;
    color: var(--primary-color);
    line-height: 1.2;
}

.detail-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 24px;
}

.detail-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 32px;
    line-height: 1.8;
}

.detail-meta {
    padding: 24px;
    background: #f8fafc;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.meta-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.meta-label {
    font-weight: 600;
    color: var(--primary-color);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
    grid-column: 1 / -1;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-weight: 500;
    transition: var(--transition-base);
}

.page-link:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.page-link.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-link.disabled {
    opacity: 0.5;
    pointer-events: none;
    background: #f1f5f9;
}

/* Responsive */
@media (max-width: 900px) {
    .main-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        margin-bottom: 30px;
    }

    .product-detail-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}