/* 🔥 Son Görüntülenen Ürünler & Ürün Karşılaştırma CSS */
/* Spesh E-ticaret Sitesi - Modern UI Design */

/* ==================== SON GÖRÜNTÜLENEN ÜRÜNLER ==================== */

.recently-viewed-widget {
    background: linear-gradient(135deg, #fff 0%, #fafafa 100%);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 24px;
    margin: 32px 0;
    position: relative;
    overflow: hidden;
}

.recently-viewed-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--accent-color) 100%);
}

.recently-viewed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.recently-viewed-header h3 {
    color: var(--text-dark);
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.recently-viewed-header i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.btn-clear-recent {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-clear-recent:hover {
    background: #f5f5f5;
    color: #666;
}

.recently-viewed-products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.recently-viewed-item {
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.recently-viewed-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.recently-viewed-item .product-image {
    width: 100%;
    height: 120px;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    position: relative;
}

.recently-viewed-item .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.recently-viewed-item:hover .product-image img {
    transform: scale(1.05);
}

.recently-viewed-item .product-info {
    padding: 0;
}

.recently-viewed-item .product-info h5 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 8px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recently-viewed-item .price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
}

.recently-viewed-item .btn-compare {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    transform: scale(0.8);
}

.recently-viewed-item:hover .btn-compare {
    opacity: 1;
    transform: scale(1);
}

.recently-viewed-item .btn-compare:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

/* ==================== ÜRÜN KARŞILAŞTIRMA ==================== */

.mini-compare-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    max-width: 300px;
    z-index: 1000;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    animation: slideInRight 0.4s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.compare-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.compare-header .btn-clear {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.compare-header .btn-clear:hover {
    background: rgba(255, 255, 255, 0.2);
}

.compare-products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 12px;
}

.compare-item {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.compare-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.compare-item .btn-remove {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.compare-item .btn-remove:hover {
    transform: scale(1.2);
    background: #ff3742;
}

.compare-actions {
    padding: 12px;
    border-top: 1px solid #f0f0f0;
}

.btn-compare-now {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-compare-now:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(var(--primary-color-rgb), 0.3);
}

.btn-compare-now:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ==================== KARŞILAŞTIR BUTONLARI ==================== */

.btn-add-compare {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--primary-color) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-add-compare:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(var(--accent-color-rgb), 0.4);
}

.btn-add-compare i {
    font-size: 0.9rem;
}

/* Ürün kartlarında karşılaştır butonu */
.product-card .btn-add-compare {
    position: absolute;
    bottom: 12px;
    right: 12px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.product-card:hover .btn-add-compare {
    opacity: 1;
    transform: translateY(0);
}

/* ==================== KARŞILAŞTIRMA SAYFASI ==================== */

.compare-page {
    padding: 32px 0;
    background: #f8f9fa;
}

.compare-header-section {
    text-align: center;
    margin-bottom: 40px;
}

.compare-header-section h1 {
    font-size: 2.5rem;
    color: var(--text-dark);
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.compare-table-wrapper {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
}

.compare-table th,
.compare-table td {
    padding: 20px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #f0f0f0;
}

.compare-table th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    font-weight: 600;
    color: var(--text-dark);
    width: 200px;
}

.compare-table .product-header {
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    padding: 24px;
}

.compare-table .product-image {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    margin: 0 auto 16px;
}

.compare-table .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.compare-table .product-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.compare-table .product-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
}

/* ==================== BADGE & NOTIFICATIONS ==================== */

.compare-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ==================== RESPONSİVE DESIGN ==================== */

@media (max-width: 768px) {
    .recently-viewed-products {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
    
    .recently-viewed-item {
        padding: 8px;
    }
    
    .recently-viewed-item .product-image {
        height: 100px;
    }
    
    .mini-compare-widget {
        bottom: 10px;
        right: 10px;
        max-width: 280px;
    }
    
    .compare-products {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .compare-table th {
        width: 120px;
        font-size: 0.9rem;
    }
    
    .compare-table td {
        padding: 12px;
        font-size: 0.9rem;
    }
    
    .compare-table .product-header {
        padding: 16px;
    }
    
    .compare-table .product-image {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 480px) {
    .recently-viewed-products {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .compare-table {
        font-size: 0.8rem;
    }
    
    .compare-table th,
    .compare-table td {
        padding: 8px;
    }
    
    .compare-header-section h1 {
        font-size: 2rem;
    }
}

/* ==================== DARK MODE DESTEĞI ==================== */

@media (prefers-color-scheme: dark) {
    .recently-viewed-widget {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
        color: white;
    }
    
    .recently-viewed-item {
        background: #4a5568;
        border-color: #718096;
    }
    
    .recently-viewed-item:hover {
        border-color: var(--primary-color);
    }
    
    .compare-table-wrapper {
        background: #2d3748;
    }
    
    .compare-table th {
        background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
        color: white;
    }
    
    .compare-table td {
        border-color: #4a5568;
        color: #e2e8f0;
    }
}

/* ==================== ANIMASYONLAR ==================== */

.recently-viewed-widget {
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.recently-viewed-item {
    animation: fadeInScale 0.4s ease;
    animation-fill-mode: backwards;
}

.recently-viewed-item:nth-child(1) { animation-delay: 0.1s; }
.recently-viewed-item:nth-child(2) { animation-delay: 0.2s; }
.recently-viewed-item:nth-child(3) { animation-delay: 0.3s; }
.recently-viewed-item:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}