/* ═══════════════════════════════════════════════════════════════════════════
   📌 LEPISTESEVI - COMPONENTS.CSS
   ═══════════════════════════════════════════════════════════════════════════
   
   Bu dosya tüm sayfalarda kullanılan bileşen stillerini içerir:
   - Ürün Kartları (.card)
   - Butonlar (.btn)
   - Toast Bildirimleri (.toast)
   - Ürün Grid (.product-grid)
   - Thumbnail ve Carousel
   - Form elemanları
   
   🔄 Modüler yapıya geçiş: Ocak 2026
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════════
   📦 KART BİLEŞENLERİ (PRODUCT CARDS)
   ═══════════════════════════════════════════════════════════════════════════ */

.card {
    /* Glassmorphism Background (Hakkımızda ile aynı) */
    background: var(--glass-bg);
    border-radius: var(--border-radius-md);
    text-align: center;
    border: 2px solid var(--text-faintest);
    transition: all var(--transition-smooth);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    height: auto !important;
    /* Stretch çalışması için auto */
    align-self: stretch !important;
    /* Kendini uzat */
    /* Flex container içinde stretch olması için */
    min-height: 480px;
    /* Minimum bir yükseklik belirleyelim */
    padding: 16px !important;
    overflow: hidden !important;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: relative;

    /* Flex grid içinde genişlik ayarları components.css sonunda yapıldı */
}

.card:hover {
    transform: scale(1.03) translateY(-8px);
    box-shadow: var(--shadow-glow), var(--shadow-card);
    border-color: var(--accent);
}

.card img {
    width: 100%;
    height: 100%;
    /* Wrapper yüksekliğini doldur */
    max-width: 100%;
    max-height: 100%;
    border-radius: var(--border-radius-sm);
    object-fit: contain !important;
    /* ASLA KIRPMA - Zorla */
    margin: 0 auto;
    display: block;
    transition: transform var(--transition-fast), opacity 0.3s ease;
}

.card img:hover {
    transform: scale(1.05);
}

.card h3 {
    margin: 10px 0;
    font-size: 0.9rem;
    /* Küçültüldü */
    color: var(--text);
    font-weight: 600;
    padding: 0;

    /* 2 satır sınırlaması */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-clamp: 2;
    /* Standart */
}

.card .product-desc {
    /* Açıklamayı 3 satıra sabitle */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
    font-size: 0.85rem;
    color: var(--muted);
}

.card .thumb-wrapper {
    display: flex !important;
    /* Grid yerine Flex - Daha güvenilir ortalama */
    align-items: center;
    justify-content: center;
    height: 220px !important;
    background: transparent;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    width: 100%;
    /* Genişlik container'a uysun */
}

/* 🖼️ ÜRÜN İÇ ÇERÇEVESİ (BAŞLIK + RESİM) */
.product-inner-frame {
    position: relative;
    border: 1px solid var(--border-medium);
    border-radius: 12px;
    padding: 10px;
    background: var(--surface-card);
    margin-bottom: 10px;
}

/* ☀️ Light Theme Inner Frame Visibility */
[data-theme="light"] .product-inner-frame {
    border: 2px solid var(--text-faintest);
    background: #ffffff;
}

/* 🏷️ Product Code Styling */
.product-card-code {
    font-size: 0.75rem;
    color: #aaa;
    /* Default Dark Mode */
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

[data-theme="light"] .product-card-code {
    color: #444;
    /* Darker for readability */
    font-weight: 700;
}

/* ⭐ Sepette Yıldızı - ORTALA */
.in-cart-star {
    position: absolute;
    top: 10px;
    left: 50% !important;
    transform: translateX(-50%) !important;
    right: auto !important;
    z-index: 10;
    font-size: 1.2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% {
        transform: scale(0) translateX(-50%);
        opacity: 0;
    }

    100% {
        transform: scale(1) translateX(-50%);
        opacity: 1;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   🔘 BUTONLAR
   ═══════════════════════════════════════════════════════════════════════════ */

.btn {
    display: inline-block;
    margin: 6px 5px 0;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.btn:disabled {
    background: gray;
    cursor: not-allowed;
}

.btn.success {
    background: #4db8ff;
    color: #fff;
    /* Modern Pill Shape */
    border-radius: 50px;
    font-weight: 700;
    /* text-transform: uppercase; -- KALDIRILDI, sadece ilk harf büyük */
    letter-spacing: 0.5px;
    padding: 10px 20px;
    box-shadow: 0 4px 15px rgba(77, 184, 255, 0.3);
    transition: all 0.3s ease;
    border: 1px solid transparent;
    /* Border geçişi için */
}

.btn.success:hover {
    background: #fff;
    color: #4db8ff;
    border: 1px solid #4db8ff;
    /* Modern Hover Effect */
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(77, 184, 255, 0.5);
}

/* ═══════════════════════════════════════════════════════════════════════════
   🏷️ FİYAT ALANI
   ═══════════════════════════════════════════════════════════════════════════ */

.product-prices {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    /* Kullanıcı isteği: Fiyatın altında boşluk */
}

.old-price {
    text-decoration: line-through;
    color: var(--old-price-color);
    font-size: 0.9rem;
}

.new-price {
    color: #4db8ff;
    font-size: 1.1rem;
    font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════════════════
   � ÜRÜN İÇİ BUTONLAR (ACTIONS) - Eşit Boyutlandırma
   ═══════════════════════════════════════════════════════════════════════════ */

.product-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
    width: 100%;
    padding: 0 5px;
    /* Kenarlardan biraz boşluk */
}

.product-actions .btn {
    flex: 1;
    /* Eşit genişlik */
    height: 38px;
    /* Sabit yükseklik */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 30px;
    /* Pill shape */
    background: #4db8ff;
    color: #fff;
    border: 2px solid #4db8ff;
    /* Border ekle */
    transition: all 0.2s ease;
}

.product-actions .btn:hover {
    background: #fff;
    color: #4db8ff;
    border-color: #4db8ff;
}

/* ═══════════════════════════════════════════════════════════════════════════
   �📋 ÜRÜN GRİD
   ═══════════════════════════════════════════════════════════════════════════ */

/* Kategori Grupları - Her kategori alt alta */
.category-group {
    width: 100%;
    margin-bottom: 40px;
}

.category-group .category-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    /* Fallback for dark theme */
    margin-bottom: 20px;
    padding: 10px 20px;
    /* Added padding for frame */
    text-align: center;
    border-radius: 12px;
    /* Smooth corners for frame */
    border: 2px solid transparent;
    /* default hidden border */
    display: inline-block;
    /* Wrap text for frame */
    width: auto;
    /* Allow auto width for frame */
    margin-left: auto;
    margin-right: auto;
    display: block;
    /* But center block */
    width: fit-content;
}

/* ☀️ Light Theme Styles for Category Title */
[data-theme="light"] .category-group .category-title {
    color: #4db8ff !important;
    /* Original light blue */
    border: 2px solid #4db8ff;
    /* Framed look requested */
    background: rgba(77, 184, 255, 0.05);
    /* Subtle bg */
}

/* Ana ürün container'ı */
#productGrid,
.collections {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Ürün Listesi - Flexbox ile ortalama */
.product-grid,
.product-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    /* Her zaman ortala */
    align-items: stretch !important;
    /* Kutuları eşit yüksekliğe zorla - ZORLA */
    gap: 20px;
}

/* Kart Genişliği - Grid yerine Flex Width */
.card {
    /* Masaüstü: 4 ürün yan yana => %25 (genişletildi) */
    /* Gap hesabı: (100% / 4) - gap payı. */
    flex: 0 0 calc(25% - 16px);
    max-width: calc(25% - 16px);
}

/* ═══════════════════════════════════════════════════════════════════════════
   🔔 TOAST BİLDİRİMLERİ
   ═══════════════════════════════════════════════════════════════════════════ */

.toast {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 26px;
    border-radius: 14px;
    color: #fff;
    font-weight: 600;
    font-size: 1.1rem;
    line-height: 1.4;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    z-index: 2147483647 !important;
    opacity: 0;
    min-width: 340px;
    text-align: center;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.toast.success {
    background: #4db8ff;
}

.toast.info {
    background: #4db8ff;
}

.toast.error {
    background: #4db8ff;
}

.toast.warning {
    background: #4db8ff;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translate(-50%, -20px);
    }

    10% {
        opacity: 1;
        transform: translate(-50%, 0);
    }

    90% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   🖼️ THUMBNAIL & CAROUSEL
   ═══════════════════════════════════════════════════════════════════════════ */

.thumbnail {
    width: 85px;
    height: 85px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--border-medium);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.thumbnail.active {
    border: 2px solid #4db8ff;
    transform: scale(1.05);
}

.thumbnail-carousel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
}

.thumbnail-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    width: 100%;
    padding-bottom: 6px;
}

.thumbnail-row::-webkit-scrollbar {
    height: 8px;
}

.thumbnail-row::-webkit-scrollbar-thumb {
    background: var(--hover-bg);
    border-radius: 4px;
}

.thumbnail-row::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb);
}

.thumb-arrow {
    background: var(--hover-bg-light);
    color: var(--text-primary);
    border: none;
    font-size: 1.8rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: background 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumb-arrow:hover {
    background: rgba(77, 184, 255, 0.5);
}

/* ═══════════════════════════════════════════════════════════════════════════
   ⭐ YILDIZ PUANLAMA
   ═══════════════════════════════════════════════════════════════════════════ */

.rating-stars {
    display: flex;
    gap: 2px;
    justify-content: center;
}

.rating-stars .star {
    color: var(--pr-star);
    font-size: 1rem;
}

.rating-stars .star.empty {
    color: var(--text-faintest);
}

/* ⭐ ÜRÜN KARTI DEĞERLENDİRME ROZETİ */
.product-rating-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.8rem;
    color: #ffa04d;
    padding: 4px 12px;
    background: rgba(255, 160, 77, 0.15);
    border: 1px solid rgba(255, 160, 77, 0.35);
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: 0.3px;
    /* Overlay positioning - yarım santim aşağıda */
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    white-space: nowrap;
}

/* Tıklanabilir rozet */
.product-rating-badge.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.product-rating-badge.clickable:hover {
    background: rgba(255, 160, 77, 0.3);
    border-color: #ffa04d;
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 2px 8px rgba(255, 160, 77, 0.3);
}

.product-rating-badge:empty,
.product-rating-badge[style*="display:none"],
.product-rating-badge[style*="display: none"] {
    display: none !important;
}

/* product-info-wrapper için alan */
.product-info-wrapper {
    position: relative;
    padding-top: 8px;
}

/* ⭐ Sayfa/Modal değerlendirme rozeti (product.html ve index modal için) */
.product-page-rating-badge {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.9rem;
    color: #ffa04d;
    padding: 10px 14px;
    background: rgba(255, 160, 77, 0.15);
    border: 1px solid rgba(255, 160, 77, 0.35);
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.product-page-rating-badge:hover {
    background: rgba(255, 160, 77, 0.3);
    border-color: #ffa04d;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ℹ️ ABOUT MODAL (Modern Glassmorphism Design)
   ═══════════════════════════════════════════════════════════════════════════ */
#aboutModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    backdrop-filter: blur(8px);
}

#aboutModal:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

#aboutModal>div {
    /* Glassmorphism Styling */
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 40px;
    border-radius: 24px;
    max-width: 550px;
    width: 100%;
    position: relative;
    border: 1px solid var(--border-medium);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    color: var(--text-primary);
    max-height: 80vh;
    overflow-y: auto;

    /* Animation Start State */
    transform: scale(0.95) translateY(10px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        box-shadow 0.3s ease,
        border-color 0.3s ease;
}

#aboutModal:not(.hidden)>div {
    transform: scale(1) translateY(0);
}

#aboutModal h2 {
    margin-top: 0;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #4db8ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    border-bottom: 1px solid var(--border-medium);
    padding-bottom: 20px;
    margin-bottom: 25px;
    text-align: center;
}

#aboutModal p {
    color: var(--text-secondary) !important;
    margin-bottom: 20px;
    font-size: 1.05rem;
    line-height: 1.7;
    display: block !important;
    text-align: center;
}

#aboutModal a {
    color: #4db8ff !important;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

#aboutModal a:hover {
    color: #fff !important;
    text-decoration: underline;
}

/* ✨ Modern Hover Effect (Popup Content) */
#aboutModal>div:hover {
    box-shadow: 0 30px 60px rgba(77, 184, 255, 0.2);
    border-color: rgba(77, 184, 255, 0.4);
    transform: scale(1.02);
}

/* 🔘 Modern Button Style */
#aboutModal button {
    background: var(--hover-bg);
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
    padding: 12px 30px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#aboutModal button:hover {
    background: linear-gradient(45deg, #4db8ff, #007cc0) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: 0 10px 25px rgba(77, 184, 255, 0.4);
    transform: translateY(-2px);
}

/* ☀️ Light Theme - Hakkımızda Modal okunabilirlik */
[data-theme="light"] #aboutModal h2 {
    background: linear-gradient(135deg, #1a1a2e 0%, #4db8ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    border-bottom: 2px solid rgba(0, 0, 0, 0.2);
}

[data-theme="light"] #aboutModal a:hover {
    color: #007cc0 !important;
}

[data-theme="light"] #aboutModal button {
    background: rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.2);
    color: #333;
}

/* ═══════════════════════════════════════════════════════════════════════════
   📦 TÜMÜNÜ GÖSTER BUTONU (Show All Button)
   ═══════════════════════════════════════════════════════════════════════════ */

.show-all-btn {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 20px auto 0;
    padding: 14px 28px;
    background: linear-gradient(135deg, rgba(77, 184, 255, 0.15), rgba(108, 99, 255, 0.15));
    border: 2px solid rgba(77, 184, 255, 0.4);
    border-radius: 50px;
    color: #4db8ff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.show-all-btn:hover {
    background: #4db8ff;
    color: #fff;
    border-color: #4db8ff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(77, 184, 255, 0.4);
}

.show-all-btn:active {
    transform: translateY(0);
}

/* Gizli ürün kartları için animasyon */
.card[data-hidden-card="true"]:not(.hidden) {
    animation: fadeInUp 0.4s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ❤️ FAVORİ BUTONU VE MODAL
   ═══════════════════════════════════════════════════════════════════════════ */

/* Favori Butonu - Ürün Kartlarında */
.favorite-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}

/* Favori Butonu - Ürün Detay Sayfalarında (resmin sağ alt köşesi) */
.favorite-btn.favorite-btn-page {
    top: auto !important;
    bottom: 12px !important;
    right: 12px !important;
}

.favorite-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.favorite-btn.active {
    background: rgba(255, 77, 106, 0.3);
}

.favorite-btn .heart-icon {
    font-size: 1.2rem;
    line-height: 1;
}

/* Pulse animasyonu - favori eklendiğinde */
.favorite-btn.favorite-pulse {
    animation: favoritePulse 0.3s ease;
}

@keyframes favoritePulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

/* Favoriler Grid - Modal içi */
.favorites-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 5px;
}

/* Favori Kartı */
.favorite-card {
    position: relative;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.favorite-card:hover {
    transform: translateY(-4px);
    border-color: rgba(77, 184, 255, 0.4);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.favorite-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.favorite-card-image {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-bottom: 1px solid var(--border-medium);
}

.favorite-card-info {
    padding: 10px;
    text-align: center;
}

.favorite-card-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.favorite-card-price {
    font-size: 0.85rem;
    color: #4db8ff;
    font-weight: 700;
    display: block;
    margin-top: 4px;
}

/* Favoriden Çıkar Butonu */
.favorite-remove-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    /* Mobilde biraz daha büyük */
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 77, 106, 0.9);
    /* Daha belirgin */
    border: none;
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 20;
    /* Üstte kalsın */
}

.favorite-card:hover .favorite-remove-btn {
    opacity: 1;
}

.favorite-remove-btn:hover {
    background: #ff4d6a;
    transform: scale(1.1);
}

/* 📱 MOBİL ÖZEL: Favori silme butonu her zaman görünür */
@media (max-width: 768px) {
    .favorite-remove-btn {
        opacity: 1 !important;
        width: 32px;
        height: 32px;
        background: rgba(255, 77, 106, 1);
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    }
}