/* --- Genel Ayarlar ve Font --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,400;0,700;1,400&display=swap');

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    background-color: #dfe6e9;
    color: #2d3436;
    overflow: hidden;
}

/* --- Ana Konteyner --- */
.catalog-container {
    display: flex;
    height: 100vh;
}

/* --- PDF Export Controls --- */
.flipbook-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 50;
}

.export-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #2980b9;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(41, 128, 185, 0.3);
}

.export-btn:hover:not(:disabled) {
    background: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(41, 128, 185, 0.4);
}

.export-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.export-btn svg {
    flex-shrink: 0;
}

/* --- Kategori Menüsü --- */
#category-menu {
    flex-shrink: 0;
    width: 280px;
    background-color: #ffffff;
    padding: 25px 25px 120px 25px;
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
    z-index: 100;
    border-right: 1px solid #f0f0f0;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 100vh;
}

.menu-close {
    display: none; /* Varsayılan olarak gizli */
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 50%;
    cursor: pointer;
    z-index: 102;
    transition: all 0.3s ease;
}

.menu-close:hover {
    background: #e9ecef;
    transform: scale(1.1);
}

.menu-close span {
    font-size: 20px;
    color: #6c757d;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.menu-close:hover span {
    color: #dc3545;
}

.menu-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.menu-logo {
    width: 250px;
    height: 125px;
    object-fit: contain;
    border-radius: 8px;
}

/* Menü kapatılabilir durumda iken */
#category-menu.menu--collapsible {
    width: 60px;
    padding: 15px 10px;
    transition: width 0.4s ease, padding 0.4s ease;
}

#category-menu.menu--collapsible .menu-header,
#category-menu.menu--collapsible #category-list,
#category-menu.menu--collapsible .menu-footer {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#category-menu.menu--collapsible .menu-close {
    display: block;
    right: 15px;
}

/* Menü açma butonu - kapatılmış menü için */
.menu-expand {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    background: #6c5ce7;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
}

.menu-expand:hover {
    background: #5a4fcf;
    transform: scale(1.1);
}

.menu-expand span {
    color: white;
    font-size: 20px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

#category-list {
    list-style: none;
    padding: 0;
    margin: 20px 0 0 0;
}

#category-list li {
    padding: 15px 20px;
    margin-bottom: 8px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

#category-list li:hover {
    background-color: #000;
    color: #fff;
    transform: translateX(5px);
}

/* Aktif kategori için özel stil */
#category-list li.active {
    background-color: #000;
    color: white;
    box-shadow: 0 4px 10px rgba(108, 92, 231, 0.4);
    transform: translateX(5px);
}

/* --- Flipbook Alanı --- */
.flipbook-wrapper {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
    overflow: hidden;
    min-height: 0; /* Flex item'in küçülmesine izin verir */
}

#flipbook {
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border-radius: 5px;
    max-width: 100%;
    max-height: 100%;
    transition: all 0.3s ease;
}

/* --- Sayfa Stilleri --- */
.page {
    background-color: #fdfdfd;
    overflow: hidden;
}

.page-content {
    background: linear-gradient(135deg, #c40028, #9b2d83, #0055a4);
    width: 100%;
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
    overflow: hidden;
}

/* Kapak Sayfası Özel Stili */
.page--cover .page-content {
    background: linear-gradient(135deg, #0013b8 0%, #0d6efd 100%);
    display: flex;
    justify-content: center;
    align-items: center;
}

.page--cover h1 {
    color: white;
    font-size: 3rem;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.2);
}
.page--cover h4 {
    color: white;
    font-size: 1rem;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.2);
    font-style: italic;
}


/* --- Ürün Kartı Tasarımı --- */
.product-card {
    border: 1px solid #e0e0e0;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    width: 90%;
    height: 95%;
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.product-card img {
    max-width: 100%;
    height: 60%;
    object-fit: contain;
}

.product-card h3 {
    font-size: 1.1rem;
    color: #2d3436;
}
.product-card h5 {
    margin: 5px 0 5px 0;
    font-size: 0.8rem;
    font-style: italic;
    color: #2d3436;
}

.product-card p {
    font-size: 0.9rem;
    color: #636e72;
    line-height: 1.4;
}
.product-card p.p-alt {
  font-size: 0.7rem;
  font-style: italic; 
  color: #7f8c8d;    
  margin-top: -10px  
}

.product-card span {
    font-size: 0.8rem;
    font-weight: 700;
    color: #b2bec3;
}

/* --- Mobil Menü Butonu (Hamburger) --- */
.menu-toggle {
    display: none; /* Varsayılan olarak gizli */
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001; /* Her şeyin üstünde */
    width: 40px;
    height: 40px;
    background: #000000;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: left 0.4s ease; /* Pozisyon değişimi için animasyon */
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: white;
    margin: 4px auto;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Menü açıldığında hamburger ikonunu X'e dönüştür */
.menu-toggle.menu-button--moved span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.menu-button--moved span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.menu-toggle.menu-button--moved span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

/* Menü açıldığında buton sağa kayar */
.menu-toggle.menu-button--moved {
    left: 300px; /* Menü genişliği + 20px */
    background: #000000; /* Kapatma butonunu vurgulamak için kırmızı */
}

/* --- Karartma Perdesi (Overlay) --- */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

.overlay.active {
    display: block;
}

.page--front-cover .page-content {
    /* Mor-mavi tonlarında, hafif şeffaf bir gradyan */
    background: linear-gradient(135deg, #0013b8 0%, #0d6efd 100%);
    color: white;
    display: flex; /* İçeriği ortalamak için flex kullanıyoruz */
    justify-content: center;
    align-items: center;
}

.front-cover-content {
    text-align: center;
    border: 3px solid rgba(255, 255, 255, 0.8); /* Kenarlık da hafif şeffaf */
    padding: 40px 20px;
    width: 80%;
    background: rgba(0, 0, 0, 0.1); /* İçeriğe hafif karanlık bir fon */
    border-radius: 5px;
}

.front-cover-content .logo {
    max-width: 200px;
    margin-bottom: 20px;
}

.front-cover-content h1 {
    font-size: 2.5rem;
    margin: 0 0 10px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.front-cover-content p {
    font-size: 1rem;
    margin: 0;
}

/* --- Hakkımızda Sayfası Stili (Daha Sade ve Okunaklı) --- */
.page--about-us .page-content {
    /* Yazının kolay okunması için çok açık tonlarda bir gradyan */
    background: linear-gradient(160deg, #ffffff, #f7f8fa);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 40px;
}

.page--about-us h2 {
    font-size: 2rem;
    color: #2d3436; /* Ana metin rengiyle uyumlu */
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(108, 92, 231, 0.5); /* Ana renge referans */
}

.page--about-us p {
    font-size: 0.9rem;
    line-height: 1.6;
    text-align: left;
    color: #636e72; /* Okunaklı bir gri tonu */
}

/* --- TABLET UYUMLULUK (900px - 1300px) --- */
@media (min-width: 901px) and (max-width: 1300px) {
    .flipbook-wrapper {
        padding: 20px;
    }
    
    #flipbook {
        max-width: calc(100vw - 320px); /* Menü genişliği + padding */
        max-height: calc(100vh - 40px);
    }
    
    .page-content {
        padding: 15px;
    }
}

/* --- MOBİL UYUMLULUK (MEDIA QUERY) --- */
/* 900px'den daha dar ekranlar için */
@media (max-width: 1300px) {
    /* Sol menüyü gizle */
    #category-menu {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        max-height: 100vh;
        transform: translateX(-100%); /* Ekranın dışına taşı */
        transition: transform 0.4s ease;
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    /* Menü açıldığında ekrana geri getir */
    #category-menu.menu--open {
        transform: translateX(0);
    }

    /* Hamburger menü butonunu göster */
    .menu-toggle {
        display: block;
    }

    /* Masaüstü menü kontrol butonlarını gizle */
    .menu-close,
    .menu-expand {
        display: none !important;
    }

    /* Menü her zaman açık olsun mobilde */
    #category-menu.menu--collapsible {
        width: 280px;
        padding: 25px 25px 120px 25px;
    }

    #category-menu.menu--collapsible .menu-header,
    #category-menu.menu--collapsible #category-list,
    #category-menu.menu--collapsible .menu-footer {
        opacity: 1;
        pointer-events: auto;
    }

    /* Kitabın kapladığı alanı ayarla */
    .flipbook-wrapper {
        padding: 5px;
        min-height: 100vh;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    #flipbook {
        width: 100% !important;
        max-width: calc(100vw - 10px) !important;
        height: auto !important;
        max-height: calc(100vh - 40px) !important;
        margin: 0 auto;
    }
    
    .page-content {
        padding: 10px; /* İç boşlukları azalt */
    }

    /* Kapak sayfasındaki başlığı küçültelim */
    .page--cover h1 {
        font-size: 2rem;
    }

    /* Menü başlığını mobilde küçültelim */
    .menu-header {
        gap: 10px;
        margin-bottom: 15px;
        padding-bottom: 10px;
    }
    
    .menu-logo {
        width: 170px;
        height: 80px;
    }
    
    .menu-header h2 {
        font-size: 1.2rem;
    }

    /* Ürün kartındaki elemanları küçültelim */
     .product-card {
        padding: 8px; /* Dış padding'i daha da azalttık */
        width: 100%;
    }

    .product-card h3 {
        font-size: 1rem;
        margin: 2px 0; /* Üst ve alt boşluğu azalttık */
    }
    .product-card h5 {
        font-size: 0.8rem;
        margin: 2px 0; /* Üst ve alt boşluğu azalttık */
    }
    
    .product-card p {
        font-size: 0.8rem;
        margin-bottom: 4px; /* Alt boşluğu azalttık */
        line-height: 1.3; /* Satır yüksekliğini biraz azalttık */
    }
    .product-card p.p-alt {
        font-size: 0.6rem;
        line-height: 1.3; /* Satır yüksekliğini biraz azalttık */
        margin-top: 4px; /* Üst boşluğu biraz azalttık */
    }

    .product-card img {
        height: 60%;
    }

    .page--about-us h2 {
    font-size: 1rem;
    color: #2d3436; /* Ana metin rengiyle uyumlu */
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(108, 92, 231, 0.5); /* Ana renge referans */
}

.page--about-us p {
    font-size: 0.6rem;
    line-height: 1.6;
    text-align: left;
    color: #636e72; /* Okunaklı bir gri tonu */
}

    /* Mobilde PDF export butonu */
    .flipbook-controls {
        top: 10px;
        right: 10px;
    }
    
    .export-btn {
        padding: 10px 16px;
        font-size: 12px;
        border-radius: 20px;
    }
    
    .export-btn svg {
        width: 16px;
        height: 16px;
    }
    
    /* Mobilde PDF indirme listesi */
    .menu-footer h3 {
        font-size: 1rem;
    }
    
    .pdf-download-btn {
        padding: 8px 12px;
        font-size: 11px;
    }
}

/* --- Menü Footer (PDF İndirme Bölümü) --- */
.menu-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.menu-footer h3 {
    font-size: 1.1rem;
    color: #2d3436;
    margin-bottom: 15px;
    text-align: center;
}

#pdf-download-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pdf-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #2980b9, #3498db);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(41, 128, 185, 0.2);
    text-decoration: none;
}

.pdf-download-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #3498db, #5dade2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(41, 128, 185, 0.3);
}

.pdf-download-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.pdf-download-btn svg {
    flex-shrink: 0;
}

.pdf-download-btn .loading-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Scrollbar Stilleri --- */
#category-menu::-webkit-scrollbar {
    width: 8px;
}

#category-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#category-menu::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

#category-menu::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Firefox scrollbar */
#category-menu {
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}