/* === MODERN CSS RESET === */
/* Bu kod, tüm tarayıcıların varsayılan stillerini sıfırlayarak tutarlı bir temel oluşturur. */

/*
  1. Tüm elemanlar için daha sezgisel bir kutu boyutlandırma modeli kullan.
     Bu, genişlik ve yükseklik hesaplamalarına padding ve border'ı dahil eder.
*/
*, *::before, *::after {
  box-sizing: border-box;
}

/*
  2. Tarayıcıların elementlere verdiği varsayılan, tutarsız dış boşlukları (margin) kaldır.
*/
* {
  margin: 0;
}

/*
  3. Yüzde tabanlı yüksekliklerin doğru çalışmasına izin ver.
*/
html, body {
  height: 100%;
}

/*
  4. Erişilebilir satır yüksekliği ekle ve metin render kalitesini artır.
*/
body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/*
  5. Resim gibi medya elemanlarının varsayılan davranışlarını iyileştir.
*/
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

/*
  6. Form elemanlarının tarayıcılar tarafından atanan farklı font stillerini sıfırla.
*/
input, button, textarea, select {
  font: inherit;
}

/*
  7. Metinlerin, kutularından taşmasını önle.
*/
p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

.references-logos .logo-box img {
    height:100px;
    width: 195px;
    /* Bu satır logonun en boy oranını korur, bozulmasını engeller. 
       Mevcut kodunuzda zaten olabilir, ama burada olması önemlidir. */
    object-fit: contain; 
}

.html, body {
  scroll-behavior: smooth; /* Bu satır sayfa içi bağlantılar için yumuşak kaydırma sağlar */
  font-size: 16px;
}

/* Temel Stiller */
:root {
--primary-color: rgb(46, 107, 198);
--secondary-color: #444;
--blue-color: #00AEEF;
--text-color: #003366;
--background-color: #f5f5f5;
--shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
--transition: all 0.3s ease;
}

/* HTML ve Body için temel sıfırlamalar */
html,
body {
margin: 0;
padding: 0;
line-height: 1.6;
color: var(--secondary-color);
background-color: var(--background-color);
overflow-x: hidden;
font-family: 'Segoe UI', sans-serif;
scroll-behavior: smooth;
}

/* Evrensel box-sizing kuralı */
* {
box-sizing: border-box;
}

/* Navbar Stilleri */
.navbar {
position: relative;
top: 0;
left: 0;
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px 5% 12px 5%;
background-color: white;
box-shadow: var(--shadow);
z-index: 1000;
}

.navbar .logo a img {
width: 150px;
max-width: 100%;
height: auto;
transition: var(--transition);
}

.navbar nav ul {
list-style: none;
display: flex;
gap: 30px;
margin: 0;
padding: 0;
align-items: center;
}

.navbar nav ul li a {
text-decoration: none;
color: var(--text-color);
font-weight: 500;
transition: var(--transition);
position: relative;
padding: 5px 0;
display: flex;
align-items: center;
}

.navbar nav ul li a:hover {
color: var(--blue-color);
}

.navbar nav ul li a::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
width: 0;
height: 2px;
background-color: var(--blue-color);
transition: var(--transition);
}

.navbar nav ul li a:hover::after {
width: 100%;
}

.search-bar-container {
    position: relative;
    margin-bottom: 30px; 
}

#productSearchInput {
    width: 21.5rem;
    padding: 12px 15px 12px 40px; 
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    -webkit-appearance: none; 
    appearance: none;
}

#productSearchInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 107, 198, 0.2);
}

.search-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: #aaa;
    transition: color 0.3s ease;
    z-index: 2; 
}

#productSearchInput:focus ~ .search-icon {
    color: var(--primary-color);
}

.menu-toggle {
display: none;
background: none;
border: none;
cursor: pointer;
padding: 10px;
z-index: 1001;
}

.menu-toggle .bar {
display: block;
width: 25px;
height: 3px;
background-color: var(--text-color);
margin: 5px 0;
transition: var(--transition);
}

/* Ana İçerik Alanı */
main {
padding-top: 80px;
position: relative;
z-index: 1;
}

#backToTopBtn {
    display: none; /* JavaScript ile görünür yapacağız */
    position: fixed; /* Sayfa kaysa bile yerinde sabit kalır */
    bottom: 20px; /* Ekranın altından 20px yukarıda */
    right: 30px; /* Ekranın sağından 30px içeride */
    z-index: 99; /* Diğer tüm elemanların üzerinde kalır */
    border: none;
    outline: none;
    background-color: var(--primary-color); /* Ana tema rengi */
    color: white;
    cursor: pointer;
    padding: 15px;
    border-radius: 50%; /* Yuvarlak bir buton */
    font-size: 18px;
    width: 50px;  /* Genişlik ve yüksekliği eşitleyerek tam daire yapıyoruz */
    height: 50px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    
    /* Yumuşak bir belirip kaybolma efekti için */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, background-color 0.3s;
}

#backToTopBtn.visible {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
}

#backToTopBtn:hover {
    background-color: var(--blue-color); /* Üzerine gelince renk değişimi */
}

/* Footer Stilleri */
.light-footer {
background-color: var(--background-color);
color: var(--text-color);
padding: 40px 5%;
font-family: 'Segoe UI', sans-serif;
border-top: 2px solid var(--primary-color);
}

.footer-wrapper {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
max-width: 1200px;
margin: auto;
}

.footer-left {
max-width: 400px;
margin-bottom: 20px;
}

.footer-left h2 {
color: var(--text-color);
font-size: 1.8rem;
margin-bottom: 10px;
}

.footer-links {
display: flex;
gap: 60px;
flex-wrap: wrap;
}

.footer-links h4 {
margin-bottom: 10px;
color: var(--text-color);
font-size: 1.1rem;
}

.footer-links a {
display: block;
color: var(--text-color);
text-decoration: none;
margin-bottom: 6px;
font-size: 0.95rem;
transition: color 0.3s;
}

.footer-links a:hover {
color: var(--blue-color);
}

.footer-bottom {
margin-top: 30px;
text-align: center;
font-size: 0.9rem;
color: var(--secondary-color);
}

/* Ürünler Sayfası Stilleri */
.products-container {
display: flex;
padding: 0 5% 60px 5%;
background-color: var(--background-color);
gap: 30px;
}

.category-sidebar {
flex: 0 0 250px;
background-color: white;
border-radius: 12px;
box-shadow: var(--shadow);
padding: 20px;
height: fit-content;
position: sticky;
top: 100px;
}

.sidebar-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
padding-bottom: 10px;
border-bottom: 1px solid #eee;
}

.sidebar-header h3 {
font-size: 1.5rem;
color: var(--text-color);
}

.toggle-filter-btn {
display: flex;
font-size: 1.5rem;
color: var(--primary-color);
cursor: pointer;
}

.category-list {
list-style: none;
padding: 0;
margin: 0;
}

.category-list > li {
margin-bottom: 5px;
position: relative;
overflow: hidden;
}

.category-list > li > .category-button {
background: none;
border: none;
font-size: 1.1rem;
color: var(--secondary-color);
width: 100%;
text-align: left;
padding: 1px 15px;
border-radius: 8px;
cursor: pointer;
transition: var(--transition);
font-weight: 500;
display: flex;
align-items: center;
justify-content: space-between;
}

.category-list > li > .category-button:hover {
background-color: var(--background-color);
color: var(--primary-color);
}

.category-list > li > .category-button.active {
background-color: var(--primary-color);
color: white;
font-weight: 600;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.toggle-submenu-icon {
margin-left: 10px;
transition: transform 0.3s ease;
}

.category-list > li.submenu-open > .category-button > .toggle-submenu-icon {
transform: rotate(90deg);
}

.submenu {
list-style: none;
padding: 0;
margin-top: 5px;
margin-left: 15px;
max-height: 0;
opacity: 0;
overflow: hidden;
transition: max-height 0.4s ease-in-out, opacity 0.4s ease-in-out;
}

.submenu.active {
max-height: 500px;
opacity: 1;
}

.submenu li .category-button {
background: none;
border: none;
font-size: 1rem;
color: var(--secondary-color);
width: 100%;
text-align: left;
padding: 8px 10px;
border-radius: 6px;
cursor: pointer;
transition: var(--transition);
font-weight: 400;
}

.submenu li .category-button:hover {
background-color: var(--background-color);
color: var(--primary-color);
}

.submenu li .category-button.active {
background-color: var(--blue-color);
color: white;
font-weight: 500;
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.08);
}

.product-listing-area {
flex: 1;
min-width: 0;
}

.product-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 25px;
opacity: 0;
visibility: hidden;
transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

.product-grid.loaded {
opacity: 1;
visibility: visible;
}

.product-card {
background-color: white;
border-radius: 12px;
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
overflow: hidden;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
text-align: center;
transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
height: 100%;
text-decoration: none;
color: inherit;
}

.product-card.hidden-product-card {
opacity: 0;
visibility: hidden;
}

.product-card:hover {
transform: translateY(-8px);
box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.product-card img {
    width: 100%;
    height: 200px;
    border-bottom: 1px solid #eee;
    border-top: 1px solid #eee;
    object-fit: scale-down;
    background: #efefef;
}

.product-card h3 {
font-size: 1.4rem;
color: var(--text-color);
margin-bottom: 15px;
padding: 0 15px;
}

.product-card .product-card-button {
margin-bottom: 25px;
display: inline-block;
padding: 12px 25px;
margin-top: auto;
background-color: var(--primary-color);
color: white;
text-align: center;
text-decoration: none;
font-weight: 600;
border-radius: 8px;
transition: all 0.3s ease;
cursor: pointer;
border: 2px solid var(--primary-color);
align-self: center;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.product-card .product-card-button:hover {
background-color: var(--blue-color);
border-color: var(--blue-color);
transform: translateY(-2px);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* Ürün Detay Sayfası Stilleri */
.product-detail-page-main {
padding-top: 100px;
background-color: var(--background-color);
min-height: calc(100vh - 200px);
}

.product-detail-section {
display: flex;
flex-wrap: wrap;
gap: 40px;
padding: 40px 5%;
background-color: white;
margin-bottom: 30px;
box-shadow: var(--shadow);
}

.product-detail-gallery {
flex: 1;
min-width: 300px;
max-width: 550px;
text-align: center;
}

.product-detail-gallery .main-image {
width: 100%;
height: auto;
max-height: 450px;
object-fit: contain;
border: 1px solid #eee;
border-radius: 8px;
margin-bottom: 15px;
}

.thumbnail-container {
display: flex;
justify-content: center;
gap: 10px;
flex-wrap: wrap;
}

.thumbnail-container .thumbnail {
width: 80px;
height: 80px;
object-fit: contain;
border: 1px solid #ddd;
border-radius: 5px;
cursor: pointer;
transition: all 0.2s ease;
}

.thumbnail-container .thumbnail:hover,
.thumbnail-container .thumbnail.active {
border-color: var(--primary-color);
transform: translateY(-2px);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.product-detail-content {
flex: 2;
min-width: 300px;
max-width: 700px;
}

.product-detail-content h1 {
font-size: 2.5rem;
color: var(--text-color);
margin-bottom: 20px;
}

.product-detail-content p {
font-size: 1.1rem;
color: var(--secondary-color);
line-height: 1.6;
margin-bottom: 30px;
}

.product-features {
margin-top: 30px;
}

.product-features h3 {
font-size: 1.6rem;
color: var(--text-color);
margin-bottom: 15px;
border-bottom: 2px solid var(--blue-color);
padding-bottom: 5px;
display: inline-block;
}

.product-features ul {
list-style: none;
padding: 0;
}

.product-features ul li {
font-size: 1rem;
color: var(--secondary-color);
margin-bottom: 8px;
padding-left: 25px;
position: relative;
}

.product-features ul li::before {
content: '\f00c';
font-family: 'Font Awesome 5 Free';
font-weight: 900;
color: var(--blue-color);
position: absolute;
left: 0;
top: 0;
}

.product-technical-details {
padding: 40px 5%;
background-color: white;
box-shadow: var(--shadow);
margin-bottom: 30px;
}

.product-technical-details h2 {
font-size: 2.2rem;
color: var(--text-color);
text-align: center;
margin-bottom: 40px;
}

.product-data-table-section h3 {
font-size: 1.6rem;
color: var(--text-color);
margin-bottom: 15px;
border-bottom: 2px solid var(--blue-color);
padding-bottom: 5px;
display: inline-block;
}

.product-data-table {
overflow-x: auto;
margin-bottom: 40px;
border: 1px solid #eee;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.product-data-table table {
width: 100%;
border-collapse: collapse;
min-width: 600px;
}

.product-data-table th,
.product-data-table td {
padding: 12px 15px;
text-align: left;
border-bottom: 1px solid #eee;
color: var(--secondary-color);
font-size: 0.95rem;
}

.product-data-table th {
background-color: var(--background-color);
color: var(--text-color);
font-weight: 600;
white-space: nowrap;
}

.product-data-table tbody tr:nth-child(even) {
background-color: #f9f9f9;
}

.additional-info-images-section h3 {
font-size: 1.6rem;
color: var(--text-color);
margin-bottom: 15px;
border-bottom: 2px solid var(--blue-color);
padding-bottom: 5px;
display: inline-block;
}

.additional-info-images {
display: flex;
flex-wrap: wrap;
gap: 20px;
justify-content: center;
}

.additional-info-images img {
max-width: 100%;
height: auto;
border: 1px solid #ddd;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.technical-drawing,
.performance-curves {
margin-top: 40px;
margin-bottom: 40px;
}

.technical-drawing h3,
.performance-curves h3 {
font-size: 1.6rem;
color: var(--text-color);
margin-bottom: 15px;
border-bottom: 2px solid var(--blue-color);
padding-bottom: 5px;
display: inline-block;
}

.technical-drawing img,
.curves-container img {
display: block;
max-width: 100%;
height: auto;
margin: 0 auto;
border: 1px solid #ddd;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.curves-container {
display: flex;
flex-wrap: wrap;
gap: 20px;
justify-content: center;
}

.navbar nav ul li img {
  display: none;
  visibility: hidden;
}


/* Responsive Tasarım */
@media (max-width: 1200px) {
    .product-detail-content h1 {
        font-size: 2.2rem;
    }
    .product-technical-details h2 {
        font-size: 2rem;
    }
}

@media (max-width: 992px) {

  .navbar nav ul li img {
    display: block;
    visibility: visible;
    }

    h1, .product-detail-content h1 {
        font-size: 2rem;
    }
    h2, .product-technical-details h2 {
        font-size: 1.8rem;
    }

    .menu-toggle {
        display: block;
        margin-right: -8rem;
    }

    .navbar nav ul {
        position: fixed;
        top: 75px;
        left: 0;
        width: 100%;
        height: calc(100vh - 75px);
        background: white;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding: 40px 20px;
        box-shadow: var(--shadow);
        z-index: 999;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
        visibility: hidden;
    }

    .navbar nav ul.active {
        transform: translateX(0);
        visibility: visible;
    }

    .menu-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .navbar nav ul li {
        justify-items: center;
        width: 100%;
        text-align: center;
        padding: 10px 0;
    }

    main {
        padding-top: 75px;
    }

    .products-container {
        flex-direction: column;
        padding-top: 20px;
    }

    .category-sidebar {
        position: relative;
        top: auto;
        width: 100%;
        margin-bottom: 30px;
        flex: 0 0 157px;
    }
    
    .toggle-filter-btn {
        display: flex;
    }
    
    .product-detail-section {
        flex-direction: column;
    }
    
    .product-detail-gallery, .product-detail-content {
        max-width: 100%;
    }

    .sidebar-header {
    display: flex;
    }

    /* @media (max-width: 992px) bloğunun İÇİNE ekle */

/* Başlangıçta kategori listesini animasyon için hazırla ve gizle */
.category-list {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-top: 0;
  transition: max-height 0.5s ease-in-out, opacity 0.4s ease-in-out, margin-top 0.5s ease-in-out;
}

/* JavaScript ile 'open' sınıfı eklendiğinde listeyi animasyonla göster */
.category-list.open {
  opacity: 1;
  max-height: 1500px; /* İçeriğin sığabileceği kadar büyük bir değer */
  margin-top: 15px; /* Açıldığında üstten biraz boşluk bırak */
}

/* Buton aktifken ikonu döndür (opsiyonel) */
.toggle-filter-btn.active {
  transform: rotate(45deg);
  transition: transform 0.3s ease;
}
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }

    .footer-wrapper {
        flex-direction: column;
        gap: 30px;
    }
    .footer-left, .footer-links {
        max-width: 100%;
        text-align: center;
    }
    .footer-links {
        justify-content: center;
        gap: 40px;
    }
}

@media (max-width: 576px) {
    .navbar {
        padding:15px;
    }
    .navbar .logo a img {
        width: 120px;
    }
    main {
        padding-top: 65px;
    }
    .navbar nav ul {
        top: 65px;
        height: calc(100vh - 65px);
    }

    h1, .product-detail-content h1 {
        font-size: 1.8rem;
    }
    h2, .product-technical-details h2 {
        font-size: 1.5rem;
    }
    
    .product-card h3 {
        font-size: 1.2rem;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }
}