/* ==========================================
   ÜRÜNLER SAYFASI GENEL STİLLER
   ========================================== */

/* PAGE HEADER */
.page-header {
    height: 300px;
    background-image: url('../images/celikkategori.jpg');
    background-size: cover;
    background-position: center;
    position: relative;
    margin-top: 0;
}

.page-header-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(0,0,0,0.75) 0%,
        rgba(0,0,0,0.4) 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 80px;
    color: #fff;
}

.breadcrumb {
    font-size: 14px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.page-header-overlay h1 {
    font-size: 56px;
    font-weight: bold;
}

/* PRODUCTS PAGE LAYOUT */
.products-page {
    padding: 80px 60px;
    background: #f5f5f5;
    min-height: 80vh;
}

.products-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 40px;
}

/* ==========================================
   SIDEBAR (KATEGORİLER)
   ========================================== */
.products-sidebar {
    width: 280px;
    background: #fff;
    padding: 30px 20px;
    border-radius: 12px;
    height: fit-content;
    box-shadow: 0 2px 15px rgba(0,0,0,0.06);
}

.sidebar-title {
    font-size: 22px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid #0E300E;
    color: #1f232b;
}

.category-list {
    list-style: none;
}

.category-item {
    padding: 14px 18px;
    margin-bottom: 8px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 15px;
    color: #555;
}

.category-item:hover {
    background: #f0f0f0;
    transform: translateX(5px);
}

.category-item.active {
    background: #0E300E;
    color: #fff;
    font-weight: 600;
}

/* ==========================================
   PRODUCTS GRID
   ========================================== */
.products-main {
    flex: 1;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 35px;
    margin-bottom: 60px;
    contain: layout; /* Grid layout optimizasyonu */
}

/* PRODUCT CARD */
.product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    will-change: transform; /* Performans optimizasyonu */
    contain: layout style paint; /* Tarayıcıya layout/paint optimizasyonu için ipucu */
    content-visibility: auto; /* Görünmeyen kartları optimize et */
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.15);
}

.product-image-wrapper {
    width: 100%;
    height: 260px;
    overflow: hidden;
    position: relative;
    background: #f0f0f0; /* Placeholder arka plan */
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease, opacity 0.3s ease;
    will-change: transform; /* Performans optimizasyonu */
    opacity: 0; /* Başlangıçta gizli */
}

.product-card-image.loaded {
    opacity: 1; /* Yüklendiğinde göster */
}

.product-card:hover .product-card-image {
    transform: scale(1.1);
}

.product-info {
    padding: 25px;
    text-align: center;
}

.product-code {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #1f232b;
}

.product-category {
    color: #666;
    font-size: 14px;
    margin-bottom: 12px;
}

.product-price {
    font-size: 20px;
    font-weight: bold;
    color: #0E300E;
}

/* ==========================================
   PAGINATION
   ========================================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 50px;
}

.page-btn {
    width: 45px;
    height: 45px;
    border: 2px solid #ddd;
    background: #fff;
    color: #666;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.page-btn:hover {
    border-color: #0E300E;
    color: #0E300E;
    transform: translateY(-2px);
}

.page-btn.active {
    background: #0E300E;
    color: #fff;
    border-color: #0E300E;
}

/* ==========================================
   ÜRÜN DETAY SAYFASI
   ========================================== */
.product-detail-page {
    padding: 60px 80px;
    background: #f5f5f5;
    min-height: 80vh;
}

.detail-container {
    max-width: 1400px;
    margin: 0 auto;
}

.back-btn {
    display: inline-block;
    background: #0E300E;
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 40px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #0a2009;
    transform: translateX(-5px);
}

/* DETAIL GRID */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-bottom: 80px;
}

/* SOL TARAF */
.detail-left {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* ==========================================
   GALERI CONTAINER STİLLERİ
   ========================================== */
.gallery-container {
    position: relative;
    width: 100%;
    background: #f5f5f5;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 15px 50px rgba(0,0,0,0.12);
}

.detail-main-image {
    width: 100%;
    height: auto;
    min-height: 400px;
    display: block;
    cursor: zoom-in;
    transition: opacity 0.15s ease, transform 0.3s ease;
    object-fit: cover;
    background: #f0f0f0;
    opacity: 1;
    will-change: opacity;
}

.detail-main-image:hover {
    transform: scale(1.02);
}

.detail-main-image.loading,
.detail-main-image.image-loading {
    opacity: 0.6 !important;
    pointer-events: none;
}

/* İLERİ GERI TUŞLARI */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 24px;
    border-radius: 4px;
    transition: all 0.3s ease;
    z-index: 10;
    font-weight: bold;
}

.gallery-nav:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.gallery-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.gallery-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.gallery-prev {
    left: 15px;
}

.gallery-next {
    right: 15px;
}

/* GALERİ İNDİKATÖR */
.gallery-indicator {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 18px;
    border-radius: 25px;
    font-size: 14px;
    z-index: 10;
    font-weight: 500;
}

/* ==========================================
   LIGHTBOX MODAL STİLLERİ
   ========================================== */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.lightbox-overlay.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
    }
    to { 
        opacity: 1; 
    }
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    animation: zoomIn 0.3s ease;
    transition: opacity 0.3s ease;
    opacity: 1;
}

.lightbox-image.loading {
    opacity: 0.5;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* LIGHTBOX KAPAT BUTONU */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    background: none;
    border: none;
    z-index: 1001;
    transition: transform 0.2s ease;
    padding: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    transform: scale(1.2) rotate(90deg);
}

/* LIGHTBOX İLERİ GERI TUŞLARI */
.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 28px;
    border-radius: 4px;
    transition: all 0.3s ease;
    z-index: 1001;
    font-weight: bold;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev:active,
.lightbox-next:active {
    transform: translateY(-50%) scale(0.95);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* LIGHTBOX SAYAÇ */
.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 22px;
    border-radius: 25px;
    font-size: 14px;
    z-index: 1001;
    font-weight: 500;
}

/* ==========================================
   ÜRÜN DETAY İNFO KUTUSU
   ========================================== */
.detail-info-box {
    background: #fff;
    padding: 35px;
    border-radius: 14px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
}

.detail-code {
    font-size: 34px;
    margin-bottom: 12px;
    color: #1f232b;
}

.detail-price {
    font-size: 30px;
    font-weight: bold;
    color: #0E300E;
    margin-bottom: 30px;
}

.detail-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 35px;
    padding: 25px 0;
    border-top: 2px solid #f0f0f0;
    border-bottom: 2px solid #f0f0f0;
}

.meta-item {
    display: flex;
    gap: 15px;
    align-items: center;
}

.meta-icon {
    font-size: 32px;
}

.meta-item strong {
    display: block;
    font-size: 15px;
    color: #1f232b;
    margin-bottom: 5px;
}

.meta-item p {
    font-size: 18px;
    color: #666;
}

.detail-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn-primary,
.btn-secondary {
    padding: 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #0E300E;
    color: #fff;
}

.btn-primary:hover {
    background: #0a2009;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(14, 48, 14, 0.3);
}

.btn-secondary {
    background: transparent;
    color: #0E300E;
    border: 2px solid #0E300E;
}

.btn-secondary:hover {
    background: #0E300E;
    color: #fff;
}

/* SAĞ TARAF */
.detail-right {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.detail-section {
    background: #fff;
    padding: 35px;
    border-radius: 14px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title {
    font-size: 22px;
    margin-bottom: 20px;
    color: #0E300E;
    font-weight: 600;
}

.download-btn {
    background: #f2b10f;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.download-btn:hover {
    background: #d9a00d;
    transform: translateY(-2px);
}

.detail-description {
    line-height: 1.9;
    color: #555;
    margin-bottom: 25px;
    font-size: 15px;
}

.features-list {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px solid #f0f0f0;
}

.features-title {
    margin-bottom: 18px;
    color: #0E300E;
    font-size: 18px;
}

.features {
    list-style: none;
}

.features li {
    padding: 10px 0;
    padding-left: 30px;
    position: relative;
    color: #555;
    line-height: 1.6;
}

.features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #0E300E;
    font-weight: bold;
    font-size: 18px;
}

/* ICON SECTION */
.icon-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.icon-card {
    background: #fff;
    padding: 30px 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
}

.icon-card:hover {
    transform: translateY(-5px);
}

.icon-emoji {
    font-size: 45px;
    display: block;
    margin-bottom: 15px;
}

.icon-text {
    font-size: 13px;
    line-height: 1.7;
    color: #555;
}

/* DİĞER ÜRÜNLER */
.other-products {
    margin-top: 80px;
}

.other-title {
    font-size: 34px;
    margin-bottom: 40px;
    color: #1f232b;
}

.other-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */
@media (max-width: 1200px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .icon-section {
        grid-template-columns: 1fr;
    }
    
    .gallery-nav {
        padding: 10px 14px;
        font-size: 20px;
    }
    
    .lightbox-prev,
    .lightbox-next {
        padding: 12px 16px;
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .products-container {
        flex-direction: column;
    }
    
    .products-sidebar {
        width: 100%;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header-overlay {
        padding: 0 30px;
    }
    
    .page-header-overlay h1 {
        font-size: 36px;
    }
    
    .products-page,
    .product-detail-page {
        padding: 40px 20px;
    }
    
    .detail-meta {
        grid-template-columns: 1fr;
    }
    
    .detail-grid {
        gap: 30px;
    }
    
    .icon-section {
        grid-template-columns: 1fr;
    }
    
    .gallery-nav {
        padding: 8px 12px;
        font-size: 18px;
    }
    
    .gallery-prev {
        left: 8px;
    }
    
    .gallery-next {
        right: 8px;
    }
    
    .lightbox-prev,
    .lightbox-next {
        padding: 10px 14px;
        font-size: 20px;
    }
    
    .lightbox-close {
        font-size: 30px;
        top: 10px;
        right: 15px;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .page-header {
        height: 200px;
    }
    
    .page-header-overlay h1 {
        font-size: 24px;
    }
    
    .products-page,
    .product-detail-page {
        padding: 20px 15px;
    }
    
    .products-grid {
        gap: 20px;
    }
    
    .detail-info-box {
        padding: 20px;
    }
    
    .detail-section {
        padding: 20px;
    }
    
    .icon-section {
        gap: 15px;
    }
    
    .icon-card {
        padding: 20px 15px;
    }
}

/* ==========================================
   ANIMATIONS (OPTİMİZE EDİLMİŞ)
   ========================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeInUp 0.4s ease forwards;
    animation-fill-mode: both;
}

.detail-left,
.detail-right {
    animation: fadeInUp 0.8s ease forwards;
}