/* /public/css/public-styles.css */

.adt-product-container { 
    display: grid; 
    gap: 20px; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}
.adt-product-item a { text-decoration: none; }

/* --- Layout 1: Klasik Grid --- */
.adt-layout-1 { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.adt-layout-1 .adt-product-item { display: flex; flex-direction: column; border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.adt-layout-1 .adt-product-image { position: relative; }
.adt-layout-1 .adt-product-image img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: contain; padding: 10px; }
.adt-layout-1 .adt-discount-badge { position: absolute; top: 10px; left: 10px; background: #e74c3c; color: #fff; padding: 5px 8px; border-radius: 4px; font-size: 14px; font-weight: bold; }
.adt-layout-1 .adt-product-content { padding: 15px; flex-grow: 1; display: flex; flex-direction: column; }
.adt-layout-1 .adt-product-title { font-size: 16px; margin: 0 0 10px; line-height: 1.4; height: 3.6em; overflow: hidden; flex-grow: 1; }
.adt-layout-1 .adt-product-title a { color: #333; }
.adt-layout-1 .adt-sales-rank { font-size: 13px; color: #777; margin-bottom: 10px; }
.adt-layout-1 .adt-product-price { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 15px; }
.adt-layout-1 .adt-new-price { font-size: 20px; font-weight: bold; color: #27ae60; }
.adt-layout-1 .adt-old-price { font-size: 14px; color: #95a5a6; text-decoration: line-through; }
.adt-layout-1 .adt-product-actions { padding: 0 15px 15px; }
.adt-layout-1 .adt-buy-button { display: block; width: 100%; text-align: center; padding: 10px; border-radius: 5px; text-decoration: none; font-weight: bold; background: #ff0000; color: #fff; transition: background-color 0.2s; }
.adt-layout-1 .adt-buy-button:hover { background: #e67e22; }


/* --- Layout 2: Mini Liste (YENİ GÖRÜNÜM) --- */
/* Layout 2 - Liste görünümü için geliştirilmiş CSS */
.adt-layout-2 { 
    display: grid;
    grid-template-columns: 1fr; /* Her öğe tam genişlik kaplar */
    gap: 12px;
    width: 100%; /* Açık genişlik tanımı */
    box-sizing: border-box; /* Padding ve border dahil hesaplama */
}

.adt-layout-2 .adt-product-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #f9f9f9;
    width: 100%; /* Tam genişlik */
    box-sizing: border-box; /* Padding ve border dahil hesaplama */
    min-width: 0; /* Flex öğelerinin küçülmesine izin ver */
}

.adt-layout-2 .adt-product-image {
    flex: 0 0 60px; /* Sabit 60px genişlik */
    width: 60px; /* Açık genişlik tanımı */
    height: 60px; /* Açık yükseklik tanımı */
    position: relative;
    overflow: hidden; /* Taşan görüntüleri kırp */
}

.adt-layout-2 .adt-product-image img {
    width: 100%;
    height: 100%; /* Tam yükseklik */
    object-fit: cover; /* Görüntüyü orantılı olarak sığdır */
    border-radius: 4px;
    background: #fff;
    border: 1px solid #eee;
    display: block; /* Inline boşlukları kaldır */
}

.adt-layout-2 .adt-discount-badge {
    position: absolute;
    top: -5px;
    left: -5px;
    font-size: 11px;
    padding: 2px 5px;
    border-radius: 4px;
    background: #e74c3c;
    color: #fff;
    font-weight: bold;
    z-index: 1; /* Görsel üzerinde kalmasını sağla */
    line-height: 1; /* Tutarlı yükseklik */
}

.adt-layout-2 .adt-product-content {
    flex: 1; /* Kalan alanı kapla */
    min-width: 0; /* Flex küçülmesine izin ver */
    padding: 0;
    overflow: hidden; /* Taşmaları önle */
    display: flex;
    flex-direction: column;
    justify-content: center; /* İçeriği dikey olarak ortala */
}

.adt-layout-2 .adt-product-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 5px 0;
    white-space: nowrap; /* Tek satırda kalmasını sağla */
    overflow: hidden; /* Taşan kısmı gizle */
    text-overflow: ellipsis; /* Taşan kısmın sonuna ... ekle */
    line-height: 1.3; /* Tutarlı satır yüksekliği */
    width: 100%; /* Tam genişlik */
}

.adt-layout-2 .adt-product-title a { 
    color: #333; 
    text-decoration: none;
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.adt-layout-2 .adt-product-title a:hover { 
    color: #3498db; 
}

.adt-layout-2 .adt-product-price {
    display: flex;
    gap: 8px;
    align-items: baseline;
    flex-wrap: nowrap; /* Sarmalanmayı engelle */
    margin: 0;
    overflow: hidden; /* Taşan fiyatları gizle */
}

.adt-layout-2 .adt-new-price { 
    font-size: 16px; 
    font-weight: bold; 
    color: #27ae60;
    white-space: nowrap; /* Fiyatın bölünmesini engelle */
}

.adt-layout-2 .adt-old-price { 
    font-size: 12px; 
    color: #95a5a6; 
    text-decoration: line-through;
    white-space: nowrap; /* Fiyatın bölünmesini engelle */
}

.adt-layout-2 .adt-sales-rank { 
    display: none; /* Mini liste için sales rank gizlendi */
}

.adt-layout-2 .adt-product-actions {
    flex: 0 0 auto; /* Sabit boyut, küçülmesin */
    padding: 0;
    margin-left: auto; /* Butonu en sağa yasla */
}

.adt-layout-2 .adt-buy-button {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 5px;
    background: #3498db;
    color: #fff;
    font-weight: bold;
    white-space: nowrap;
    transition: background-color 0.2s;
    border: none; /* Varsayılan border'ı kaldır */
    cursor: pointer; /* Tıklanabilir göster */
    text-decoration: none; /* Link olarak kullanılırsa */
    display: inline-block;
}

.adt-layout-2 .adt-buy-button:hover { 
    background: #2980b9; 
}

/* Responsive tasarım - küçük ekranlar için */
@media (max-width: 480px) {
    .adt-layout-2 .adt-product-item {
        gap: 10px;
        padding: 8px;
    }
    
    .adt-layout-2 .adt-product-image {
        flex: 0 0 50px;
        width: 50px;
        height: 50px;
    }
    
    .adt-layout-2 .adt-product-title {
        font-size: 14px;
    }
    
    .adt-layout-2 .adt-new-price {
        font-size: 15px;
    }
    
    .adt-layout-2 .adt-buy-button {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* Diğer layoutlar için stilleri buraya ekleyebilirsiniz (3, 4, 5) */

/* ... layout-1 ve layout-2 stilleri aynı kalacak ... */

/* ... layout-1 ve layout-2 stilleri aynı kalacak ... */

/* --- Layout 3: 4'lü Galeri Görünümü (GÜNCELLENDİ) --- */
.adt-layout-3 {
    grid-template-columns: repeat(4, 1fr); /* Geniş ekranlarda 4 sütun */
}
.adt-layout-3 .adt-product-item {
    display: flex;
    flex-direction: column;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.adt-layout-3 .adt-product-image {
    position: relative;
    padding: 10px;
}
.adt-layout-3 .adt-product-image img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1; /* Görseli kare yapar */
    object-fit: contain; /* Oranları bozmadan sığdırır */
}
.adt-layout-3 .adt-discount-badge {
    position: absolute; top: 15px; left: 15px; background: #e74c3c; color: #fff; padding: 5px 8px; border-radius: 4px; font-size: 14px; font-weight: bold;
}
.adt-layout-3 .adt-product-content {
    padding: 0 10px; /* Boşlukları azalttık */
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Kartların eşit yükseklikte kalmasını sağlar */
}
.adt-layout-3 .adt-product-title {
    font-size: 15px;
    margin: 0 0 5px; /* Alt boşluğu azalttık */
    line-height: 1.4;
    height: 4.2em; /* 3 satır */
    overflow: hidden;
}
.adt-layout-3 .adt-product-title a { color: #333; }

/* Fiyat stilleri güncellendi */
.adt-layout-3 .adt-product-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: auto;
    padding-top: 5px; /* Boşluğu azalttık */
    margin-bottom: 5px; /* Butonla arasındaki boşluğu azalttık */
}
.adt-layout-3 .adt-new-price { font-size: 18px; font-weight: bold; color: #27ae60; }
.adt-layout-3 .adt-old-price { font-size: 13px; color: #95a5a6; text-decoration: line-through; }

/* Buton stilleri güncellendi */
.adt-layout-3 .adt-product-actions {
    padding: 0 0px 0px; /* Tüm boşlukları azalttık */
}
.adt-layout-3 .adt-buy-button {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px 5px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    background: #ff0000;  
    color: #fff;  
    transition: background-color 0.2s;
}
.adt-layout-3 .adt-buy-button:hover { background: #e67e22; }

/* YENİ: Tekil "Tümünü Gör" butonu için container */
.adt-show-all-container {
    grid-column: 1 / -1; /* Grid'in tüm genişliğini kapla */
    text-align: center;
    margin-top: 2px;
}
.adt-show-all-button {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    background: #009FA7;
    border: 1px solid #ccc;
    color: #f7f7f7;
    transition: background-color 0.2s, color 0.2s;
}
.adt-show-all-button:hover {
    background: #009FA7;
    border-color: #aaa;
}

/* Diğer layoutlarda bu buton görünmesin */
.adt-show-all-button { display: none; }
.adt-show-all-container .adt-show-all-button { display: inline-block; }


/* Mobil ve Tablet için Duyarlılık (Responsive) */
@media (max-width: 960px) {
    .adt-layout-3 {
        grid-template-columns: repeat(2, 1fr); /* Tabletlerde 2 sütun */
    }
}
@media (max-width: 500px) {
    .adt-layout-3 {
        grid-template-columns: 1fr; /* Mobilde tek sütun */
    }
}

/* LAYOUT 4 */

/* Layout 4 - Masonry Card Layout (Pinterest tarzı) */
.adt-layout-4 {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    box-sizing: border-box;
    /* Masonry efekti için flexbox kullanıyoruz */
    flex-wrap: wrap;
    align-content: flex-start;
    height: fit-content;
}

/* Container için CSS Columns kullanarak masonry efekti */
.adt-layout-4 {
    column-count: auto;
    column-width: 280px;
    column-gap: 20px;
    column-fill: balance;
}

.adt-layout-4 .adt-product-item {
    display: inline-block;
    width: 100%;
    margin-bottom: 20px;
    break-inside: avoid; /* Column kırılmasını önle */
    page-break-inside: avoid; /* Sayfa kırılmasını önle */
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid transparent;
}

.adt-layout-4 .adt-product-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    border-color: #3498db;
}

.adt-layout-4 .adt-product-image {
    position: relative;
    width: 100%;
    height: auto;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.adt-layout-4 .adt-product-image img {
    width: 100%;
    height: auto;
    min-height: 180px;
    max-height: 300px;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
}

.adt-layout-4 .adt-product-item:hover .adt-product-image img {
    transform: scale(1.1);
}

.adt-layout-4 .adt-discount-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
    z-index: 2;
}

/* Yeni özellik: Favoriler butonu */
.adt-layout-4 .adt-favorite-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 2;
}

.adt-layout-4 .adt-favorite-btn:hover {
    background: #fff;
    transform: scale(1.1);
}

.adt-layout-4 .adt-favorite-btn::before {
    content: "♡";
    font-size: 16px;
    color: #666;
    transition: all 0.3s ease;
}

.adt-layout-4 .adt-favorite-btn.active::before {
    content: "♥";
    color: #e74c3c;
}

.adt-layout-4 .adt-product-content {
    padding: 20px;
    background: #fff;
}

.adt-layout-4 .adt-product-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 12px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 44px; /* İki satır için sabit yükseklik */
}

.adt-layout-4 .adt-product-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.adt-layout-4 .adt-product-title a:hover {
    color: #3498db;
}

/* Yeni özellik: Ürün özellikleri */
.adt-layout-4 .adt-product-features {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 15px;
}

.adt-layout-4 .adt-feature-tag {
    background: #ecf0f1;
    color: #7f8c8d;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: capitalize;
}

.adt-layout-4 .adt-product-price {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.adt-layout-4 .adt-new-price {
    font-size: 20px;
    font-weight: 700;
    color: #27ae60;
    margin: 0;
}

.adt-layout-4 .adt-old-price {
    font-size: 14px;
    color: #95a5a6;
    text-decoration: line-through;
    margin: 0;
}

.adt-layout-4 .adt-price-save {
    background: #e8f5e8;
    color: #27ae60;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    margin-left: auto;
}

/* Yeni özellik: Değerlendirme yıldızları */
.adt-layout-4 .adt-product-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.adt-layout-4 .adt-stars {
    display: flex;
    gap: 2px;
}

.adt-layout-4 .adt-star {
    color: #f39c12;
    font-size: 14px;
}

.adt-layout-4 .adt-rating-text {
    font-size: 12px;
    color: #7f8c8d;
}

.adt-layout-4 .adt-sales-rank {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    display: inline-block;
}

.adt-layout-4 .adt-product-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.adt-layout-4 .adt-buy-button {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 12px 16px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.adt-layout-4 .adt-buy-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.adt-layout-4 .adt-buy-button:hover::before {
    left: 100%;
}

.adt-layout-4 .adt-buy-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.adt-layout-4 .adt-quick-view {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ecf0f1;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #7f8c8d;
}

.adt-layout-4 .adt-quick-view:hover {
    background: #3498db;
    color: #fff;
    transform: scale(1.1);
}

.adt-layout-4 .adt-quick-view::before {
    content: "👁";
    font-size: 16px;
}

/* Responsive tasarım */
@media (max-width: 1200px) {
    .adt-layout-4 {
        column-width: 250px;
        column-gap: 16px;
    }
}

@media (max-width: 768px) {
    .adt-layout-4 {
        column-width: 100%;
        column-count: 2;
        column-gap: 12px;
    }
    
    .adt-layout-4 .adt-product-item {
        margin-bottom: 16px;
    }
    
    .adt-layout-4 .adt-product-content {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .adt-layout-4 {
        column-count: 1;
        column-gap: 0;
    }
    
    .adt-layout-4 .adt-product-item {
        margin-bottom: 12px;
    }
    
    .adt-layout-4 .adt-product-content {
        padding: 12px;
    }
    
    .adt-layout-4 .adt-product-title {
        font-size: 15px;
    }
    
    .adt-layout-4 .adt-new-price {
        font-size: 18px;
    }
}