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

/* iPhone ve mobil cihazlar için tam ekran optimizasyonu */
html {
    width: 100%;
    height: 100%;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    position: relative;
    
    /* iPhone safe area desteği */
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    
    /* iOS için yumuşak kaydırma */
    -webkit-overflow-scrolling: touch;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    overflow-x: hidden;
    padding-left: 12px;
    padding-right: 12px;
}

/* iPhone özel ayarları */
@supports (padding: max(0px)) {
    .container {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }
    
    .sticky-header {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }
}

/* ========== STICKY HEADER ========== */
.sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    z-index: 1000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    padding: 12px 20px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    
    /* iPhone safe area */
    padding-top: env(safe-area-inset-top, 12px);
}

.sticky-header.show {
    transform: translateY(0);
}

.sticky-content {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.sticky-header .category-wrapper {
    margin-bottom: 10px;
    width: 100%;
}

.sticky-header .search-container-sticky {
    margin-bottom: 0;
    width: 100%;
}

.sticky-header .search-box {
    max-width: 100%;
    width: 100%;
}

/* ========== KATEGORİ WRAPPER ========== */
.category-wrapper {
    margin-bottom: 15px;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    position: relative;
}

/* Scrollbar stilleri - sadece masaüstünde göster, mobilde gizle */
@media (hover: hover) {
    .category-wrapper::-webkit-scrollbar {
        height: 3px;
    }
    .category-wrapper::-webkit-scrollbar-track {
        background: rgba(255,255,255,0.2);
        border-radius: 10px;
    }
    .category-wrapper::-webkit-scrollbar-thumb {
        background: white;
        border-radius: 10px;
    }
}

.category-filter {
    display: flex;
    gap: 8px;
    padding: 4px 2px;
    min-width: min-content;
    width: max-content;
}

.category-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.8rem;
    white-space: nowrap;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
    flex-shrink: 0;
}

.category-btn.active {
    background: white;
    color: #667eea;
}

/* Arama */
.search-container {
    margin-bottom: 20px;
    width: 100%;
}

.search-container-sticky {
    margin-bottom: 0;
    width: 100%;
}

.search-box {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

#normalSearchInput, #stickySearchInput {
    width: 100%;
    padding: 12px 40px 12px 40px;
    border: none;
    border-radius: 50px;
    font-size: 0.9rem;
    background: white;
    -webkit-appearance: none;
    appearance: none;
}

.clear-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #999;
    cursor: pointer;
    display: none;
}

.search-stats {
    text-align: center;
    margin-top: 8px;
    color: white;
    font-size: 0.7rem;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 20px;
    color: white;
    padding-top: 20px;
    width: 100%;
}

.logo-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.company-logo {
    max-height: 40px;
    background: white;
    padding: 4px 10px;
    border-radius: 8px;
}

.header h1 {
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.subtitle {
    font-size: 0.75rem;
    opacity: 0.9;
}

/* Kontrol Çubuğu */
.controls-bar {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border-radius: 40px;
    padding: 6px 12px;
    margin-bottom: 20px;
    width: 100%;
}

.view-options {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.col-btn, .view-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.col-btn.active, .view-btn.active {
    background: white;
    color: #667eea;
}

/* Ürün Grid */
.product-grid {
    display: grid;
    gap: 12px;
    width: 100%;
}

.product-grid.grid-1 {
    grid-template-columns: 1fr;
}

.product-grid.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.product-grid.view-list {
    grid-template-columns: 1fr;
}

.product-grid.view-list .product-card {
    display: flex;
    gap: 12px;
    align-items: center;
}

.product-grid.view-list .product-image {
    width: 90px;
    height: 90px;
    flex-shrink: 0;
}

.product-grid.view-list .product-info {
    flex: 1;
    padding: 8px 8px 8px 0;
}

/* Ürün Kartı */
.product-card {
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: 0.2s;
    width: 100%;
    -webkit-tap-highlight-color: transparent;
}

.product-card:active {
    transform: scale(0.98);
}

.product-image {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #f5f5f5;
    cursor: pointer;
    overflow: hidden;
    width: 100%;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lazy {
    opacity: 0;
    transition: 0.2s;
}

.lazy.loaded {
    opacity: 1;
}

.no-img {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #aaa;
    gap: 6px;
    font-size: 0.7rem;
}

.no-img i {
    font-size: 1.5rem;
}

.discount-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #ff4b2b;
    color: white;
    padding: 5px 10px;
    border-radius: 25px;
    font-size: 0.7rem;
    font-weight: bold;
    z-index: 5;
}

.gallery-tag {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 3px 7px;
    border-radius: 20px;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    gap: 3px;
}

.product-info {
    padding: 10px;
}

.product-info h3 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 5px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-tag {
    font-size: 0.6rem;
    color: #667eea;
    margin-bottom: 6px;
    display: inline-block;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 12px;
}

.price {
    margin: 8px 0;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
}

.new-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ff4b2b;
}

.old-price {
    font-size: 0.75rem;
    color: #999;
    text-decoration: line-through;
}

.discount-badge-small {
    background: #ff4b2b;
    color: white;
    padding: 2px 6px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 600;
}

.price .new-price:only-child {
    color: #333;
}

.stock {
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}

.stock.in {
    color: #10b981;
}

.stock.out {
    color: #ef4444;
}

.whatsapp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #25D366;
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 25px;
    font-size: 0.7rem;
    font-weight: 600;
    transition: all 0.2s;
    margin-top: 8px;
    cursor: pointer;
    border: none;
    width: 100%;
}

.whatsapp-btn:active {
    transform: scale(0.98);
}

.product-grid.view-list .whatsapp-btn {
    padding: 6px 10px;
    font-size: 0.65rem;
    margin-top: 6px;
}

.scroll-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all 0.3s;
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
}

.scroll-top.show {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.scroll-top:active {
    transform: scale(0.95);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 1001;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    max-width: 95%;
    max-height: 90%;
}

.modal-content img {
    max-width: 100%;
    max-height: 65vh;
    object-fit: contain;
}

.modal .close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 35px;
    cursor: pointer;
}

.modal-thumbs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.modal-thumbs img {
    width: 45px;
    height: 45px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.6;
}

.modal-thumbs img:active {
    opacity: 1;
}

.modal-counter {
    text-align: center;
    color: white;
    margin-top: 10px;
    font-size: 0.75rem;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: white;
    width: 100%;
}

.no-results i {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

/* ========== iPhone 16e ve Modern iPhone'lar için Özel Ayarlar ========== */
@supports (padding-top: env(safe-area-inset-top)) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .sticky-header {
        padding-top: calc(env(safe-area-inset-top) + 12px);
    }
}

/* Dynamic Island ve çentikli iPhone'lar için */
@supports (padding-top: max(0px)) {
    .header {
        padding-top: max(20px, env(safe-area-inset-top));
    }
}

/* Mobil */
@media (max-width: 600px) {
    body {
        padding: 0;
    }
    
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    .sticky-header {
        padding: 10px 15px;
        padding-top: calc(env(safe-area-inset-top, 0px) + 10px);
    }
    
    .header {
        padding-top: calc(env(safe-area-inset-top, 0px) + 15px);
        margin-bottom: 15px;
    }
    
    .col-btn, .view-btn {
        padding: 6px 14px;
        font-size: 0.75rem;
    }
    
    .category-btn {
        padding: 6px 14px;
        font-size: 0.75rem;
    }
    
    .product-grid.grid-2 {
        gap: 10px;
    }
    
    .new-price {
        font-size: 0.9rem;
    }
    
    .scroll-top {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        bottom: 15px;
        right: 15px;
    }
}

@media (min-width: 601px) and (max-width: 900px) {
    .product-grid.grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 901px) {
    .product-grid.grid-2 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .product-grid.grid-1 {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin: 0 auto;
    }
}