/* assets/css/components/product-card.css - Full Image Modern Design Fix */

/* Grid Layout */
.products-grid {
    display: grid !important;
    /* Mobilde tek, tablette 2, masaüstünde 3-4 kolon otomatik */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 32px !important;
    /* Row-gap: 60px, Col-gap: 32px - Daha fazla boşluk */

    /* Header (72px) + Filters (~60px) + Gap */
    margin-top: 140px !important;
    /* Header altından iyice kurtarmak için */
    margin-left: 260px !important;
    /* Sidebar width */
    /* Sidebar */
    padding: 24px !important;
    padding-bottom: 80px !important;
    width: auto !important;
}

@media (max-width: 1024px) {
    .products-grid {
        margin-left: 0 !important;
        margin-top: 130px !important;
        /* Mobilde header daha kısa olabilir */
        padding: 24px !important;
        gap: 24px !important;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    }
}

@media (max-width: 640px) {
    .products-grid {
        grid-template-columns: 1fr !important;
        /* Mobilde tek sütun */
        margin-top: 120px !important;
        padding: 16px !important;
        gap: 20px !important;
    }
}

/* Base Card - Full Image Style */
/* Base Card - Fixed Layout */
.product-card.premium-card {
    position: relative;
    background: #1f2937;
    border-radius: 24px;
    overflow: hidden;
    isolation: isolate;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    /* Sabit oran yerine esnek yapı ama min-height korumalı */
    width: 100%;
    height: 100%;
    min-height: 420px;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.3) !important;
}

.product-card.premium-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4) !important;
    z-index: 10;
}

/* Background Image Container - Now Relative to hold space */
.card-media-full {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
}

.product-card.premium-card:hover .product-img {
    transform: scale(1.08);
}

/* Gradient Overlay */
.card-overlay-gradient {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0) 0%,
            rgba(0, 0, 0, 0.2) 50%,
            rgba(0, 0, 0, 0.9) 100%);
    pointer-events: none;
}

/* Badges - Top Left */
.media-badges {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    -webkit-backdrop-filter: blur(8px);
}

.badge-premium {
    background: rgba(255, 193, 7, 0.9);
    color: #000;
}

.badge-discount {
    background: rgba(239, 68, 68, 0.9);
}

.badge-bundle {
    background: rgba(139, 92, 246, 0.9);
}

/* Actions - Top Right */
.media-actions-top {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transform: translateX(10px);
    opacity: 0;
    transition: all 0.3s ease;
}

.product-card.premium-card:hover .media-actions-top {
    transform: translateX(0);
    opacity: 1;
}

.media-actions-top .icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.media-actions-top .icon-btn:hover {
    background: #fff;
    color: #000;
    transform: scale(1.1);
}

/* Like butonu — SADECE kalp ikonu kırmızı, arka plan şeffaf */
.media-actions-top .like-btn.active,
.media-actions-top .like-btn.liked {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
}

.media-actions-top .like-btn.active i,
.media-actions-top .like-btn.liked i {
    color: #ef4444 !important;
    /* dolu kalp zaten kırmızı gösterir — animasyon sadece ilk beğenide */
}

.media-actions-top .like-btn.active:hover,
.media-actions-top .like-btn.liked:hover {
    background: rgba(239, 68, 68, 0.15) !important;
    transform: scale(1.1);
}

/* Beğenilmiş kartlarda kalp butonu DAİMA görünür (hover beklenmez) */
.product-card.premium-card:has(.like-btn.active) .media-actions-top,
.product-card.premium-card:has(.like-btn.liked) .media-actions-top {
    opacity: 1 !important;
    transform: translateX(0) !important;
}

@keyframes cardHeartPop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.4);
    }

    100% {
        transform: scale(1);
    }
}

/* Content Area - Bottom */
.card-content-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 5;
    padding: 24px;
    color: #fff;
    transform: translateY(10px);
    transition: transform 0.3s ease;
}

.product-card.premium-card:hover .card-content-overlay {
    transform: translateY(0);
}

/* Title & Category */
.card-header-info {
    margin-bottom: 2px;
}

.category-tag {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 1px;
    margin-bottom: 6px;
    display: block;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.product-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);

    /* 2 satır sınırı */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 48px;
    /* Fixed height for consistency */
}

.product-title a {
    color: inherit;
    text-decoration: none;
}

/* Footer Info (User, Price, Stats) */
.card-footer-info {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.author-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.author-avatar-small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.6);
    object-fit: cover;
}

.author-name {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.price-box {
    text-align: right;
}

.price-current {
    font-size: 20px;
    font-weight: 800;
    color: #34d399;
    /* Daha parlak yeşil */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    display: block;
    line-height: 1;
}

.price-old {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: line-through;
    display: block;
    margin-bottom: 2px;
}

/* FAB - Interactive Button */
.fab-action {
    position: absolute;
    bottom: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #10b981;
    color: #fff;
    border: 3px solid rgba(255, 255, 255, 0.2);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
    z-index: 20;
    opacity: 0;
    transform: scale(0.5) translateY(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.product-card.premium-card:hover .fab-action {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.fab-action:hover {
    background: #059669;
    transform: scale(1.1) rotate(90deg);
}

.fab-action.download-btn {
    background: #3b82f6;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
}

/* Mobile Tweaks */
@media (max-width: 640px) {
    .card-content-overlay {
        padding: 20px;
        transform: translateY(0);
    }

    .media-actions-top {
        display: none;
    }

    .fab-action {
        width: 44px;
        height: 44px;
        font-size: 16px;
        bottom: 16px;
        right: 16px;
        opacity: 1;
        transform: scale(1) translateY(0);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }

    .product-title {
        font-size: 16px;
        height: 44px;
    }

    .price-current {
        font-size: 18px;
    }

    .product-card.premium-card {
        min-height: 320px;
        /* Mobilde daha kısa olabilir */
    }
}



/* Grid Toggle Menu Logic */
.header-grid-wrapper {
    position: relative;
    display: inline-block;
}

.grid-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    padding: 6px;
    display: none;
    z-index: 1000;
    transform-origin: top right;
    animation: gridMenuIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    flex-direction: row;
    gap: 4px;
}

.grid-menu.active {
    display: flex;
}

@keyframes gridMenuIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.grid-option {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    color: #64748b;
    font-size: 13px;
    transition: all 0.2s;
}

.grid-option:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.grid-option.active {
    background: #ecfdf5;
    color: #10b981;
}

.grid-option i {
    font-size: 16px;
    color: inherit;
}

/* Dark Theme Support */
body.dark-theme .grid-menu {
    background: #1e1e1e;
    border-color: #333;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

body.dark-theme .grid-option {
    color: #94a3b8;
}

body.dark-theme .grid-option:hover {
    background: #2a2a2a;
    color: #f1f5f9;
}

body.dark-theme .grid-option.active {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

/* Global Grid Layouts — header toggle'ı her sayfada çalışır */
@media (min-width: 1024px) {

    body.grid-2 .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    body.grid-3 .products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    body.grid-4 .products-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    body.grid-5 .products-grid {
        grid-template-columns: repeat(5, 1fr) !important;
    }
}

/* Mobilde Grid Menüyü Gizle */
@media (max-width: 1024px) {
    .header-grid-wrapper {
        display: none !important;
    }
}