/* 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 */
    /* Container izin veriyorsa kendi marginsiz genişlesin */
    width: 100% !important;
}

@media (max-width: 1024px) {
    .products-grid {
        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 */
        padding: 16px !important;
        gap: 20px !important;
    }
}

/* ══════════════════════════════════════════════════════════════
   BASE CARD — Glassmorphism + Temiz Lift Hover
══════════════════════════════════════════════════════════════ */
.product-card.premium-card {
    position: relative;
    background: rgba(15, 15, 22, 0.75);
    backdrop-filter: blur(18px) saturate(1.5);
    -webkit-backdrop-filter: blur(18px) saturate(1.5);
    border-radius: 24px;
    overflow: hidden;
    isolation: isolate;
    cursor: pointer;
    transition:
        transform 0.40s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.40s cubic-bezier(0.16, 1, 0.3, 1),
        border-color 0.30s ease;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: auto;
    aspect-ratio: 3/4;
    min-height: 380px;
    border: 1px solid rgba(255, 255, 255, 0.10) !important;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.30),
        inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

/* Hover: kart yükselir */
.product-card.premium-card:hover {
    transform: translateY(-10px) scale(1.012);
    border-color: rgba(255, 255, 255, 0.22) !important;
    box-shadow:
        0 28px 56px -10px rgba(0, 0, 0, 0.55),
        0 8px 24px -4px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.16) !important;
    z-index: 10;
}

/* ── Light Tema ── */
body:not(.dark-theme) .product-card.premium-card {
    background: rgba(255, 255, 255, 0.70);
    border-color: rgba(0, 0, 0, 0.07) !important;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.09),
        inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
}

body:not(.dark-theme) .product-card.premium-card:hover {
    border-color: rgba(180, 180, 195, 0.40) !important;
    box-shadow:
        0 24px 48px rgba(0, 0, 0, 0.13),
        inset 0 1px 0 rgba(255, 255, 255, 1.0) !important;
}



/* Background Image Container */
.card-media-full {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: #232330;
}

/* ── Skeleton shimmer: container üzerinde, img değil ── */
.card-media-full.is-loading {
    background: linear-gradient(90deg,
            #e2e8f0 25%,
            #cbd5e1 50%,
            #e2e8f0 75%);
    background-size: 300% 100%;
    animation: skeleton-pulse 1.7s ease-in-out infinite;
}

body.dark-theme .card-media-full.is-loading {
    background: linear-gradient(90deg,
            #262626 25%,
            #333333 50%,
            #262626 75%);
    background-size: 300% 100%;
    animation: skeleton-pulse 1.7s ease-in-out infinite;
}

.premium-card .skeleton-line,
.premium-card .skeleton-avatar {
    background: rgba(148, 163, 184, 0.3);
    /* Açık temada gri/gümüş arası şık bir ton */
    animation: skeleton-pulse 1.7s ease-in-out infinite;
}

body.dark-theme .premium-card .skeleton-line,
body.dark-theme .premium-card .skeleton-avatar {
    background: rgba(255, 255, 255, 0.05);
    /* Koyu temada uyumlu koyuluk */
}

@keyframes skeleton-pulse {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}

/* Resim yüklenene kadar görünmez (container shimmer arkasında) */
.product-img.lazy-img {
    opacity: 0;
    transition: none;
}

/* Yüklendi: container shimmer durur, img fade-in */
.card-media-full.is-loaded {
    animation: none;
    background: transparent;
}

.product-img.lazy-loaded {
    opacity: 1;
    transition: opacity 0.55s ease;
}


.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 {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 700;
    color: #f8fafc;
    /* Beyaz tonu */
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.category-tag:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
}

.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: 10px;
    background: rgba(0, 0, 0, 0.4);
    padding: 6px 12px;
    border-radius: 20px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.author-info:hover {
    background: rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.2);
}

.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;
    }
}