/* =================================================================
   Aykar Metal Web Sitesi - CSS Dosyası
   Tasarım: Gemini AI
   ================================================================= */

/* 1. TEMEL AYARLAR VE DEĞİŞKENLER */
:root {
    --primary-color: #00aaff;  /* Logodaki mavi */
    --secondary-color: #f7b731; /* PDF'teki sarı (vurgu için) */
    --dark-color: #22252a;
    --medium-gray: #555;
    --light-gray: #f4f4f4;
    --white-color: #ffffff;
    --font-heading: 'Titillium Web', sans-serif;
    --font-body: 'Roboto', sans-serif;
    --header-height: 80px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    color: var(--medium-gray);
    line-height: 1.7;
    background-color: var(--white-color);
    /* YATAY TAŞMAYI GLOBAL OLARAK ENGELLE */
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--dark-color);
    font-weight: 700;
    margin-bottom: 0.8rem;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.5rem; }

p {
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--dark-color);
}

img {
    max-width: 100%;
    height: auto;
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-padding {
    padding: 80px 0;
}

.bg-light {
    background-color: var(--light-gray);
}

.text-center {
    text-align: center;
}

.section-subtitle {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.section-title {
    margin-bottom: 2rem;
}
.text-center.section-title {
    margin-bottom: 3rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

/* 2. BUTONLAR */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 5px;
    font-weight: 700;
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white-color);
}

.btn-primary:hover {
    background-color: #0088cc;
    color: var(--white-color);
}

.btn-secondary {
    background-color: var(--dark-color);
    color: var(--white-color);
}

.btn-secondary:hover {
    background-color: var(--medium-gray);
    color: var(--white-color);
}

.btn-lg {
    padding: 15px 35px;
    font-size: 1rem;
}

/* 3. HEADER VE NAVİGASYON */
.site-header {
    width: 100%;
    height: var(--header-height);
    background-color: var(--white-color);
    border-bottom: 1px solid #eee;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
}

.logo a {
    display: flex;
    align-items: center;
    color: var(--dark-color);
    font-weight: 700;
    font-family: var(--font-heading);
    font-size: 1.5rem;
}

.logo img {
    height: 30px;
    width: 200px;
    border-radius: 1%;
    margin-right: 15px;
    
}

.main-nav ul {
    display: flex;
}

.main-nav li {
    margin-left: 30px;
}

.main-nav a {
    display: block;
    padding: 10px 0;
    color: var(--dark-color);
    font-weight: 600;
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-size: 0.95rem;
    position: relative;
}

.main-nav a::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s;
    position: absolute;
    bottom: 5px;
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}

.main-nav a.active {
    color: var(--primary-color);
}

.header-actions {
    display: flex;
}

/* 4. MOBİL MENÜ */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--dark-color);
    margin: 5px 0;
    transition: all 0.3s ease;
}

.mobile-nav-menu {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background-color: var(--white-color);
    z-index: 999;
    border-bottom: 1px solid #eee;
    padding: 20px;
}

.mobile-nav-menu ul {
    display: flex;
    flex-direction: column;
}

.mobile-nav-menu li {
    margin-bottom: 15px;
    text-align: center;
}

.mobile-nav-menu a {
    font-size: 1.2rem;
    font-weight: 600;
    font-family: var(--font-heading);
    color: var(--dark-color);
}

.mobile-nav-menu .btn {
    width: 100%;
    text-align: center;
}

/* Body 'nav-open' class */
body.nav-open .nav-toggle span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
body.nav-open .nav-toggle span:nth-child(2) {
    opacity: 0;
}
body.nav-open .nav-toggle span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}
body.nav-open .mobile-nav-menu {
    display: block;
}


/* 5. ANA SAYFA: HERO */
.hero {
    height: 600px;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-top: var(--header-height);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(34, 37, 42, 0.7);
}

.hero-content {
    position: relative;
    z-index: 2;
    color: var(--white-color);
}

.hero h1 {
    color: var(--white-color);
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.3rem;
    font-weight: 300;
    max-width: 700px;
    margin: 0 auto 2rem auto;
}

/* 6. ANA SAYFA: DİĞER BÖLÜMLER */
.home-about-image img {
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.category-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    display: block;
    height: 250px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.category-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(0deg, rgba(34, 37, 42, 0.8) 0%, rgba(34, 37, 42, 0) 100%);
    z-index: 2;
}

.category-card h3 {
    color: var(--white-color);
    font-size: 1.25rem;
    margin: 0;
}

.category-card:hover img {
    transform: scale(1.1);
}

.why-us-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.why-us-item {
    text-align: center;
    padding: 30px;
    border: 1px solid #eee;
    border-radius: 10px;
    background-color: #fcfcfc;
}

.why-us-item .icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 700;
}

.why-us-item h3 {
    font-size: 1.25rem;
}

/* 7. GENEL SAYFA BAŞLIĞI */
.page-header {
    margin-top: var(--header-height);
    padding: 60px 0;
    background-color: var(--dark-color);
    color: var(--white-color);
}

.page-header h1 {
    color: var(--white-color);
    margin-bottom: 0.5rem;
}

.page-header p {
    color: #ccc;
    font-size: 1.1rem;
    margin: 0;
}

/* 8. ÜRÜNLER SAYFASI */
.product-filters {
    padding: 20px 0;
    background-color: var(--light-gray);
    border-bottom: 1px solid #ddd;
}

.product-filters .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.filter-btn {
    background-color: var(--white-color);
    border: 1px solid #ccc;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    color: var(--medium-gray);
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--primary-color);
    color: var(--white-color);
    border-color: var(--primary-color);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.product-card {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    background-color: var(--white-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.product-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.product-card-content {
    padding: 20px;
}

.product-card h3 {
    font-size: 1.3rem;
    margin-bottom: 5px;
}

.product-card p {
    font-size: 0.9rem;
    color: var(--medium-gray);
    margin-bottom: 15px;
}

.view-details {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 0.9rem;
}

/* ==========================================================
   9. ÜRÜN DETAY MODALI (TAŞMA DÜZELTMESİ BURADA)
   ========================================================== */
.modal-overlay {
    display: none; /* JS ile 'flex' yapılır */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background-color: var(--white-color);
    width: 100%;
    max-width: 900px;
    max-height: 90vh; /* Ekranın %90'ı kadar */
    border-radius: 10px;
    position: relative;
    
    /* Animasyon */
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    
    /* İçerik taşmasını engellemek için */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Çocuk elemanlar (modal-body) taşmasın */
}

/* JS ile modal açıldığında animasyonu tetikle */
.modal-overlay[style*="display: flex"] .modal-content {
    transform: scale(1);
    opacity: 1;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--medium-gray);
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    z-index: 10; /* Yazının üstünde kalsın */
}

.close-modal:hover {
    color: var(--dark-color);
}

.modal-body {
    display: grid;
    grid-template-columns: 40% 60%;
    width: 100%;
    overflow: hidden; /* Kenar yuvarlaklığı düzgün görünsün */
    border-radius: 10px;
    /* Yüksekliği esnet */
    flex: 1;
    min-height: 0; /* Flexbox kayma hatası için */
}

/* Resim Alanı */
.modal-body img {
    width: 100%;
    height: 100%; /* Konteynerin tüm yüksekliğini kapla */
    object-fit: cover;
}

/* Yazı Alanı */
.modal-text {
    padding: 30px;
    overflow-y: auto; /* ÖNEMLİ: Sadece bu alan kayar (Masaüstü) */
    -webkit-overflow-scrolling: touch; /* iOS akıcı kaydırma */
    
    /* --- YATAY TAŞMA DÜZELTMESİ (BU EKLENDİ) --- */
    /* Bu, .modal-text'in (grid sütunu) içeriğinden (tablodan) 
       daha geniş olmasını engeller ve overflow-x'in çalışmasını sağlar. */
    min-width: 0;
}

/* --- YAZI TAŞMASI DÜZELTMESİ (GÜNCELLENDİ) --- */
/* Bu kurallar h2, p, ve li'nin taşmasını engeller */
.modal-text h2,
.modal-text p,
.modal-text ul li {
    overflow-wrap: break-word;
    word-wrap: break-word; /* Eski tarayıcılar için */
    word-break: break-word; /* Daha güçlü zorlama */
}

.modal-text h2 {
    color: var(--primary-color);
    margin-top: 0;
    font-size: 1.8rem;
}

/* Açıklama paragrafı */
.modal-text p,
.modal-text #modal-description {
    font-size: 1rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 25px;
}

/* --- MOBİL İÇİN TABLO KAYDIRMA ÇÖZÜMÜ --- */
.modal-text #modal-table-container {
    margin: 20px 0;
    width: 100%;
    overflow-x: auto; /* ÖNEMLİ: Tablo taşarsa yatayda kaydır */
    border: 1px solid #eee;
    border-radius: 4px;

    /* --- MOBİLDE AKICI KAYDIRMA İÇİN EKLENDİ --- */
    -webkit-overflow-scrolling: touch; 
}

.product-table {
    width: 100%;
    min-width: 500px; /* Tablo 500px'ten küçükse bile genişle (kaydırmayı tetikler) */
    border-collapse: collapse;
    font-size: 0.9rem;
}

.product-table th, 
.product-table td {
    border: 1px solid #ddd;
    padding: 10px 14px;
    text-align: left;
    white-space: nowrap; /* Hücre içindeki yazı alt satıra inmesin */
}

.product-table th {
    background-color: var(--light-gray);
    font-weight: 700;
    color: var(--dark-color);
}

.modal-text ul {
    list-style: disc;
    padding-left: 20px;
    margin-top: 15px;
}

.modal-text ul li {
    margin-bottom: 5px;
}


@keyframes modal-fade-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 10. İLETİŞİM SAYFASI */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 40px;
}

.contact-item {
    margin-bottom: 20px;
}

.contact-item h3 {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.contact-item p {
    margin: 0;
    font-size: 1.05rem;
}

.contact-form-container {
    background-color: var(--light-gray);
    padding: 30px;
    border-radius: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--dark-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: var(--font-body);
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(0,170,255,0.3);
}

.map-section {
    border-top: 1px solid #eee;
}

/* 11. FOOTER */
.site-footer {
    background-color: var(--dark-color);
    color: #ccc;
    padding-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    padding-bottom: 40px;
}

.footer-widget h4 {
    color: var(--white-color);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.footer-widget p {
    color: #ccc;
    font-size: 0.95rem;
}

.footer-widget .footer-logo {
    max-width: 200px;
    margin-bottom: 15px;
}

.footer-widget ul li {
    margin-bottom: 10px;
}

.footer-widget ul a {
    color: #ccc;
    font-size: 0.95rem;
}

.footer-widget ul a:hover {
    color: var(--primary-color);
}

.footer-widget address p {
    margin-bottom: 10px;
}

.footer-widget address a {
    color: #ccc;
}
.footer-widget address a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid #444;
    padding: 25px 0;
    text-align: center;
    font-size: 0.9rem;
    color: #888;
}

/* ==========================================================
   12. RESPONSIVE TASARIM (MODAL DÜZELTMELERİ EKLENDİ)
   ========================================================== */

/* Tablet (max-width: 992px) */
@media (max-width: 992px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    .hero h1 { font-size: 3rem; }

    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .home-about-image {
        grid-row: 1; /* Resmi üste al */
        text-align: center;
    }

    .category-grid {
        grid-template-columns: 1fr 1fr;
    }

    .why-us-grid {
        grid-template-columns: 1fr;
    }

    .product-grid {
        grid-template-columns: 1fr 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* --- Modal Tablet Ayarları --- */
   
    .modal-body {
        grid-template-columns: 1fr;
        max-height: 85vh; 
        overflow-y: auto;
        overflow-x: hidden; /* <-- BU SATIRI EKLEYİN */
    }
    
    .modal-body img {
        height: 300px; /* Resme sabit yükseklik ver */
        object-fit: cover;
        border-radius: 10px 10px 0 0;
    }
    
    .modal-text {
        overflow-y: visible; /* İç kaydırmayı iptal et, gövde zaten kayıyor */
    }
}

/* Mobil (max-width: 768px) */
@media (max-width: 768px) {
    .main-nav, .header-actions {
        display: none;
    }

    .nav-toggle {
        display: block;
    }

    .logo span {
        font-size: 1.2rem;
    }
    .logo img {
        height: 30px;
        width: 200px;
    }

    .hero {
        height: 500px;
    }
    .hero h1 {
        font-size: 2.2rem;
    }
    .hero p {
        font-size: 1.1rem;
    }
    .btn-lg {
        padding: 12px 28px;
        font-size: 0.9rem;
    }

    .section-padding {
        padding: 50px 0;
    }
    
    .category-grid,
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .product-filters .container {
        gap: 5px;
    }
    .filter-btn {
        padding: 8px 15px;
        font-size: 0.85rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    /* --- Modal Mobil Ayarları --- */
    .modal-overlay {
        padding: 10px; /* Kenar boşluğunu azalt */
    }
    
    .modal-content {
        max-height: 90vh; /* Ekranın %90'ı */
        width: 100%; /* Tam genişlik */
    }
    
    .modal-body {
        max-height: 90vh; /* Ekranın %90'ı */
    }

    .modal-body img {
        height: 200px; /* Mobilde resim daha küçük olsun */
    }
    
    .modal-text {
        padding: 20px; /* Mobilde padding azalt */
    }
    
    .modal-text h2 {
        font-size: 1.5rem; /* Başlık küçülsün */
    }
    
    .modal-text p,
    .modal-text #modal-description {
        font-size: 0.95rem; /* Metin küçülsün */
    }
}