﻿/* ===== Product Carousel (pcx-*) ===== */

.pcx-carousel {
    --gap: 20px;
    --card-w: 220px;
    --radius: 12px;
    --border: #e7e7e7;
    --bg: #fff;
    --shadow: 0 8px 24px rgba(0,0,0,.06);
    --fade: linear-gradient(90deg, rgba(255,255,255,1), rgba(255,255,255,0));
    padding:15px;
}

.pcx-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.pcx-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #2d2d2f;
}

.pcx-actions {
    display: flex;
    gap: 10px;
}

.pcx-nav {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 999px;
    cursor: pointer;
    line-height: 36px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
}

    .pcx-nav:disabled {
        opacity: .35;
        cursor: not-allowed;
    }

.pcx-viewport {
    position: relative;
}

.pcx-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: var(--card-w);
    gap: var(--gap);
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    padding: 6px 2px 8px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

    .pcx-track:focus {
        outline: none;
    }

    .pcx-track::-webkit-scrollbar {
        height: 8px;
    }

    .pcx-track::-webkit-scrollbar-thumb {
        background: #cfcfcf;
        border-radius: 4px;
    }

    .pcx-track::-webkit-scrollbar-track {
        background: #f2f2f2;
    }

.pcx-card {
    scroll-snap-align: start;
    background: var(--bg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pcx-thumb {
    position: relative;
    display: block;
    overflow: hidden;
}

    .pcx-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: transform .25s ease;
    }

    .pcx-thumb:hover img {
        transform: scale(1.03);
    }

.pcx-badge {
    position: absolute;
    left: 8px;
    bottom: 8px;
    background: #e51;
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
    text-transform: lowercase;
}

.pcx-info {
    padding: 10px 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pcx-name {
    color: #2e2e33;
    text-decoration: none;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 42px;
}

    .pcx-name:hover {
        text-decoration: underline;
    }

.pcx-prices {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.pcx-old {
    color: #9c9c9c;
    text-decoration: line-through;
    font-size: 13px;
}

.pcx-price {
    color: #e65100;
    font-weight: 700;
    font-size: 16px;
}

/* kenar fade */
.pcx-fade {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 36px;
    pointer-events: none;
}

.pcx-fade-left {
    left: -2px;
    background: var(--fade);
}

.pcx-fade-right {
    right: -2px;
    background: linear-gradient(270deg, rgba(255,255,255,1), rgba(255,255,255,0));
}

/* responsive */
@media (max-width: 1200px) {
    .pcx-carousel {
        --card-w: 220px;
    }
}

@media (max-width: 992px) {
    .pcx-carousel {
        --card-w: 200px;
    }
}

@media (max-width: 768px) {
    .pcx-carousel {
        --card-w: 180px;
        --gap: 16px;
    }

    .pcx-title {
        font-size: 18px;
    }
}

/* Konum katmanları */
.pcx-viewport {
    position: relative;
}

.pcx-track {
    position: relative;
    z-index: 0;
}

.pcx-fade {
    z-index: 1;
    pointer-events: none;
}

.pcx-nav.pcx-overlay {
    z-index: 2;
}

/* Overlay oklar: dikey ortalı, şeffaf kapsül */
.pcx-nav.pcx-overlay {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 999px;
    background: rgba(255,255,255,.78); /* şeffaf beyaz */
    backdrop-filter: blur(4px); /* cam efekti (desteklendiği yerde) */
    box-shadow: 0 6px 16px rgba(0,0,0,.18);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

    .pcx-nav.pcx-overlay:hover {
        background: rgba(255,255,255,.95);
    }

    .pcx-nav.pcx-overlay:disabled {
        opacity: .35;
        cursor: not-allowed;
    }

.pcx-prev.pcx-overlay {
    left: 8px;
}

.pcx-next.pcx-overlay {
    right: 8px;
}

/* Mobile biraz küçültelim */
@media (max-width: 768px) {
    .pcx-nav.pcx-overlay {
        width: 36px;
        height: 36px;
        box-shadow: 0 4px 12px rgba(0,0,0,.16);
    }

    .pcx-prev.pcx-overlay {
        left: 6px;
    }

    .pcx-next.pcx-overlay {
        right: 6px;
    }
}
