@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary: #000000;
    --primary-hover: #333333;
    --bg-color: #ffffff;
    --bg-secondary: #f3f4f6;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --error: #ef4444;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0; padding: 0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header */
.header {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 5px 0;
    position: sticky; top: 0; z-index: 100;
}
.header .container { display: flex; justify-content: space-between; align-items: center; }
.logo { text-decoration: none; display: flex; align-items: center; }
.logo span { font-size: 26px; font-weight: 700; color: var(--primary); letter-spacing: -0.5px;}

.cart-trigger { 
    cursor: pointer; 
    font-weight: 600; 
    font-size: 15px;
    color: var(--text-main); 
    display: flex; align-items: center; gap: 8px;
    text-decoration: none;
}


/* Typography */
h1, h2, h3 { font-weight: 600; letter-spacing: -0.025em; margin-top:0; color: var(--text-main); }
h1 { font-size: 2.25rem; margin-bottom: 1.5rem; }
h2 { font-size: 1.5rem; margin-bottom: 1.25rem; }
h3 { font-size: 1.25rem; }

.content { padding: 10px 0; }

/* Grids */
.category-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px;
    margin-bottom: 60px;
}
.category-card {
    background: var(--bg-secondary); padding: 25px 20px; border-radius: 12px;
    text-align: center; text-decoration: none; color: var(--text-main); font-weight: 600;
    transition: background 0.2s; font-size: 16px;
}
.category-card:hover { background: #e5e7eb; }

.product-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 30px 20px;
    margin-bottom: 60px;
}

/* Product Card */
.product-card {
    display: flex; flex-direction: column;
    text-align: left;
    group: hover;
}
.product-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 9/16;
    object-fit: cover;
    margin-bottom: 15px;
    transition: opacity 0.3s;
    border-radius: 8px;
}
.product-card:hover img { opacity: 0.9; }
.product-card h3 { 
    font-size: 15px; 
    margin: 0 0 8px 0; 
    font-weight: 500;
    line-height: 1.4;
    flex-grow: 1;
}
.product-card h3 a { text-decoration: none; color: var(--text-main); transition: color 0.2s;}
.product-card h3 a:hover { color: var(--text-muted); }
.product-card .price { 
    font-weight: 600; 
    color: var(--text-main); 
    font-size: 16px; 
    margin-bottom: 15px; 
}

/* Forms & Buttons */
.add-to-cart-group { display: flex; gap: 8px; }
.qty-input { 
    width: 65px; 
    text-align: center; 
    border: 1px solid var(--border-color); 
    border-radius: 4px; 
    font-weight: 500; 
    font-size: 15px;
    color: var(--text-main);
    font-family: inherit;
}
.qty-input:focus { outline: none; border-color: var(--text-muted); }

.btn {
    background: var(--primary); color: white; border: none; padding: 12px 24px; border-radius: 4px;
    cursor: pointer; font-weight: 600; font-size: 15px; width: 100%; transition: background 0.2s;
    text-align: center; text-decoration: none; font-family: inherit;
    display: inline-block; box-sizing: border-box;
}
.btn:hover { background: var(--primary-hover); }

/* Cart Page */
.cart-page { display: flex; gap: 40px; align-items: flex-start; }
.cart-left { flex: 2; padding-top: 10px;}
.cart-right { 
    flex: 1.2; 
    background: var(--bg-secondary); 
    padding: 30px; 
    border-radius: 12px; 
    position: sticky; top: 100px;
}

.cart-list-item { 
    display: flex; justify-content: space-between; align-items: stretch; 
    border-bottom: 1px solid var(--border-color); padding: 25px 0; 
}
.cart-list-item:first-child { border-top: 1px solid var(--border-color); }
.cart-list-item:last-child { border-bottom: none; }

.cart-item-image-wrapper { width: 90px; height: 90px; flex-shrink: 0; background: var(--bg-secondary); border-radius: 8px; overflow: hidden; border: 1px solid var(--border-color); }
.cart-item-image-wrapper img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-image-wrapper .placeholder { width: 100%; height: 100%; background: #e5e7eb; }

.cart-item-details { flex: 1; padding: 0 20px; display: flex; flex-direction: column; justify-content: center; min-width:0; }
.cart-item-title { font-weight: 600; font-size: 16px; margin-bottom: 8px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cart-item-meta { color: var(--text-muted); font-size: 14px; }

.cart-item-price-actions { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; min-width: 100px;}
.cart-item-price { font-weight: 600; font-size: 16px; color: var(--text-main); }
.remove-item { background: transparent; color: var(--text-muted); border: none; font-size: 14px; text-decoration: underline; cursor: pointer; padding: 0;}
.remove-item:hover { color: var(--error); }

.order-summary { margin-bottom: 25px; padding-bottom: 20px; border-bottom: 1px solid var(--border-color); }
.summary-row { display: flex; justify-content: space-between; font-weight: 700; font-size: 20px; color: var(--text-main); }

.checkout-form-page .form-group { margin-bottom: 18px; }
.checkout-form-page label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 500; color: var(--text-main);}
.checkout-form-page input, .checkout-form-page textarea { 
    width: 100%; padding: 12px 14px; 
    border: 1px solid var(--border-color); 
    border-radius: 6px; box-sizing: border-box; 
    font-family: inherit; font-size: 15px;
    background: #fff;
    transition: border-color 0.2s;
}
.checkout-form-page input:focus, .checkout-form-page textarea:focus { outline: none; border-color: var(--primary); }

/* Toast */
.toast {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(100px);
    background: var(--text-main); color: white; padding: 14px 28px; border-radius: 8px; font-weight: 500;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); z-index: 1001; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 15px;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* Product detail page */
.product-detail { display: flex; gap: 60px; }
.product-image { flex: 1; }
.product-image img { width: 100%; border-radius: 12px; object-fit: cover; }
.product-info { flex: 1; padding-top: 20px; position: sticky; top: 120px; align-self: flex-start; }
.product-info h1 { font-size: 2.5rem; margin-bottom: 20px; }
.product-info .price { font-size: 1.5rem; font-weight: 600; margin-bottom: 30px; }

@media (max-width: 768px) {
    .product-detail { flex-direction: column; gap: 30px;}
    .cart-page { flex-direction: column; gap: 30px;}
    .cart-right { position: static; }
    .product-info { position: static; }
    .cart-list-item { flex-direction: column; align-items: flex-start; gap: 15px;}
    .cart-item-details { padding: 0; }
    .cart-item-price-actions { flex-direction: row; width: 100%; justify-content: space-between; align-items: center;}
}

/* Store Controls */
.store-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
}
.search-box {
    flex: 1;
    position: relative;
}
.search-box input {
    width: 100%;
    padding: 14px 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    box-sizing: border-box;
    transition: all 0.2s;
    background: #fff;
}
.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}
.sort-box select {
    padding: 14px 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    background: #fff;
    cursor: pointer;
    outline: none;
}
.sort-box select:focus {
    border-color: var(--primary);
}

@media (max-width: 768px) {
    .store-controls {
        flex-direction: column;
    }
    .sort-box, .sort-box select {
        width: 100%;
    }
}

/* Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.data-table th, .data-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.data-table th {
    background: #f9fafb;
    font-weight: 600;
}
@keyframes cartShake {
    0% { transform: rotate(0) scale(1); }
    25% { transform: rotate(15deg) scale(1.1); }
    50% { transform: rotate(-15deg) scale(1.1); }
    75% { transform: rotate(15deg) scale(1.1); }
    100% { transform: rotate(0) scale(1); }
}
.cart-shake {
    animation: cartShake 0.4s ease-in-out;
    transform-origin: center;
}
.cart-trigger:hover { color: var(--text-muted); }
@media (max-width: 768px) {
    .main-nav { display: none !important; }
    .header .container { justify-content: space-between !important; }
}.nav-dropdown-wrapper:hover .nav-dropdown-content {
    opacity: 1 !important;
    visibility: visible !important;
    margin-top: 5px !important;
}
.nav-dropdown-content a:hover {
    background: #f9fafb !important;
    color: var(--primary) !important;
}
@media (max-width: 768px) {
    /* Product Grid Mobile: 2 columns */
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
    
    /* Product Card adjustments for mobile */
    .product-card h3 {
        font-size: 13px !important;
        margin-bottom: 5px !important;
    }
    .product-card .price {
        font-size: 14px !important;
        margin-bottom: 10px !important;
    }
    .add-to-cart-group {
        flex-direction: row;
        gap: 8px;
    }
    .qty-input {
        flex: 0 0 60px !important;
        width: 60px !important;
        height: 38px !important;
        text-align: center;
    }
    .btn-add {
        flex: 1 !important;
        height: 38px !important;
    }
    .btn-add {
        width: 100% !important;
        padding: 8px !important;
        font-size: 13px !important;
    }
    
    /* Product Page Layout */
    .product-page {
        flex-direction: column !important;
        gap: 20px !important;
    }
    .product-gallery, .product-info {
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .product-gallery img {
        aspect-ratio: 9/16;
        object-fit: cover;
    }
    
    /* Cart & Account pages */
    .cart-page {
        flex-direction: column !important;
        gap: 20px !important;
    }
    .cart-left, .cart-right {
        flex: none !important;
        width: 100% !important;
    }
    
    .category-scroll {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    .category-card {
        flex: 0 0 auto;
    }
}
/* Performans Optimizasyonu */
.product-card {
    content-visibility: auto;
    contain-intrinsic-size: 240px 400px;
}
@media (max-width: 768px) {
    .product-card {
        contain-intrinsic-size: 150px 300px;
    }
}@media (max-width: 768px) {
    /* Fix Pages padding for mobile */
    .card[style*="padding:40px"], 
    .card[style*="padding: 40px"] {
        padding: 20px !important;
    }
    
    /* Fix Cart Item Overflow */
    .cart-list-item {
        flex-direction: column !important;
        gap: 15px !important;
    }
    .cart-list-item > div:first-child {
        width: 100% !important;
    }
    .cart-item-details {
        padding: 0 0 0 15px !important;
    }
    .cart-item-title {
        white-space: normal !important;
        font-size: 14px !important;
        line-height: 1.4 !important;
    }
    .cart-item-price-actions {
        flex-direction: row !important;
        width: 100% !important;
        justify-content: space-between !important;
        align-items: center !important;
        border-top: 1px solid var(--border-color);
        padding-top: 10px;
        margin-top: 5px;
    }
}
@media (max-width: 768px) {
    /* Fix Cart Right Overflow */
    .cart-right {
        box-sizing: border-box !important;
        padding: 20px !important;
        width: 100% !important;
        max-width: 100vw !important;
        overflow: hidden !important;
    }
    
    .checkout-form-page input, .checkout-form-page textarea {
        max-width: 100% !important;
    }
    
    /* Bigger price on mobile */
    .product-card .price {
        font-size: 18px !important;
        margin-bottom: 10px !important;
        color: var(--text-main) !important;
        font-weight: 700 !important;
    }
    
    /* Add to cart row mobile */
    .add-to-cart-group {
        flex-direction: row !important;
        align-items: stretch !important;
        gap: 8px !important;
    }
    .qty-input {
        flex: 0 0 65px !important;
        width: 65px !important;
        height: 42px !important;
        text-align: center;
        font-size: 16px !important;
    }
    .btn-add {
        flex: 1 !important;
        height: 42px !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        padding: 0 !important;
    }
}