/* Trendyol-Inspired Product Card Styles */
:root {
    --ty-orange: #f27a1a;
    --ty-orange-light: #fff4eb;
    --ty-green: #0bc15c;
    --ty-green-light: #e8f8ef;
    --ty-red: #f53b57;
    --ty-gray: #999;
    --ty-dark: #333;
    --ty-border: #e8e8e8;
    --ty-bg: #fafafa;
    --ty-star: #ffc107;
}

/* Product Card Container */
.ty-product-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid transparent;
}

.ty-product-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: var(--ty-border);
    transform: translateY(-2px);
}

/* Image Container */
.ty-product-card .ty-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--ty-bg);
}

.ty-product-card .ty-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.ty-product-card:hover .ty-image-container img {
    transform: scale(1.08);
}

/* Badges Container */
.ty-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 5;
}

html[dir="rtl"] .ty-badges {
    flex-direction: row-reverse;
}

.ty-badges-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Discount Badge */
.ty-discount-badge {
    background: var(--ty-red);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    direction: ltr;
}

/* Free Shipping Badge */
.ty-free-shipping-badge {
    background: var(--ty-green);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.ty-free-shipping-badge i {
    font-size: 11px;
}

/* Express Badge */
.ty-express-badge {
    background: var(--ty-orange);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 6px;
    border-radius: 4px;
}

/* Wishlist Heart Button */
.ty-wishlist-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    z-index: 10;
}

.ty-wishlist-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ty-wishlist-btn i {
    font-size: 16px;
    color: var(--ty-gray);
    transition: color 0.2s ease;
}

.ty-wishlist-btn:hover i,
.ty-wishlist-btn.active i {
    color: var(--ty-red);
}

.ty-wishlist-btn.active i::before {
    content: "\f004";
    font-weight: 900;
}

/* Quick View Overlay */
.ty-quick-view-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.3s ease;
}

.ty-product-card:hover .ty-quick-view-overlay {
    opacity: 1;
    transform: translateY(0);
}

.ty-quick-view-btn {
    width: 100%;
    background: #fff;
    color: var(--ty-dark);
    border: none;
    padding: 8px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ty-quick-view-btn:hover {
    background: var(--ty-bg);
}

/* Product Details */
.ty-product-details {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Brand Name */
.ty-brand-name {
    font-size: 11px;
    color: var(--ty-gray);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}

.ty-brand-name:hover {
    color: var(--ty-orange);
}

/* Product Title */
.ty-product-title {
    font-size: 13px;
    color: var(--ty-dark);
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 36px;
}

.ty-product-title:hover {
    color: var(--ty-orange);
}

/* Rating */
.ty-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}

.ty-rating-stars {
    display: flex;
    gap: 1px;
}

.ty-rating-stars i {
    font-size: 12px;
    color: var(--ty-star);
}

.ty-rating-stars i.empty {
    color: #ddd;
}

.ty-rating-count {
    font-size: 11px;
    color: var(--ty-gray);
}

/* Price Container */
.ty-price-container {
    margin-top: auto;
}

.ty-current-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--ty-orange);
    display: block;
    line-height: 1.2;
}

.ty-original-price {
    font-size: 13px;
    color: var(--ty-gray);
    text-decoration: line-through;
    margin-inline-start: 0;
    display: inline-block;
}

.ty-discount-percent {
    font-size: 12px;
    font-weight: 600;
    color: var(--ty-green);
    margin-inline-start: 6px;
}

/* Out of Stock Overlay */
.ty-out-of-stock {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15;
}

.ty-out-of-stock span {
    background: var(--ty-dark);
    color: #fff;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Product Grid Layout */
.ty-product-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

@media (max-width: 1199px) {
    .ty-product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 991px) {
    .ty-product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
}

@media (max-width: 767px) {
    .ty-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .ty-product-card {
        border-radius: 6px;
    }

    .ty-product-details {
        padding: 8px;
    }

    .ty-brand-name {
        font-size: 10px;
    }

    .ty-product-title {
        font-size: 12px;
        min-height: 32px;
    }

    .ty-current-price {
        font-size: 15px;
    }

    .ty-original-price {
        font-size: 11px;
    }

    .ty-discount-badge {
        font-size: 10px;
        padding: 3px 6px;
    }

    .ty-wishlist-btn {
        width: 28px;
        height: 28px;
    }

    .ty-wishlist-btn i {
        font-size: 14px;
    }
}

@media (max-width: 575px) {
    .ty-product-grid {
        gap: 6px;
    }

    .ty-badges {
        top: 6px;
        left: 6px;
        right: 6px;
    }

    .ty-free-shipping-badge {
        font-size: 9px;
        padding: 2px 4px;
    }

    .ty-rating {
        margin-bottom: 4px;
    }

    .ty-rating-stars i {
        font-size: 10px;
    }

    .ty-rating-count {
        font-size: 10px;
    }
}

/* Seller/Store Badge */
.ty-seller-badge {
    font-size: 10px;
    color: var(--ty-gray);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
}

.ty-seller-badge i {
    font-size: 11px;
}

.ty-seller-badge span:hover {
    color: var(--ty-orange);
}

/* Category Chip */
.ty-category-chip {
    background: var(--ty-bg);
    color: var(--ty-gray);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
    margin-bottom: 4px;
}

/* Loading Skeleton */
.ty-product-card.loading {
    pointer-events: none;
}

.ty-product-card.loading .ty-image-container,
.ty-product-card.loading .ty-brand-name,
.ty-product-card.loading .ty-product-title,
.ty-product-card.loading .ty-current-price {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Hover Actions Container */
.ty-hover-actions {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.ty-product-card:hover .ty-hover-actions {
    opacity: 1;
}

.ty-action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.ty-action-btn:hover {
    transform: scale(1.1);
    background: var(--ty-orange);
    color: #fff;
}

.ty-action-btn i {
    font-size: 16px;
}

/* Featured Product Card for Carousels */
.ty-featured-card {
    padding: 4px;
}

.ty-featured-card .ty-product-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Flash Deal Timer Badge */
.ty-flash-timer {
    background: var(--ty-red);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ty-flash-timer i {
    font-size: 12px;
}

/* Stock Warning */
.ty-low-stock {
    font-size: 11px;
    color: var(--ty-red);
    font-weight: 500;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ty-low-stock i {
    font-size: 12px;
}

/* Product Card in List View */
.ty-list-view .ty-product-card {
    flex-direction: row;
    max-height: 200px;
}

.ty-list-view .ty-image-container {
    width: 200px;
    min-width: 200px;
    aspect-ratio: auto;
    height: 100%;
}

.ty-list-view .ty-product-details {
    padding: 16px;
}

.ty-list-view .ty-product-title {
    -webkit-line-clamp: 3;
    min-height: auto;
}

@media (max-width: 767px) {
    .ty-list-view .ty-product-card {
        flex-direction: column;
        max-height: none;
    }

    .ty-list-view .ty-image-container {
        width: 100%;
        min-width: auto;
        aspect-ratio: 1;
    }
}

/* Add to Cart Button (visible on hover) */
.ty-add-to-cart {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    background: var(--ty-orange);
    color: #fff;
    border: none;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 10;
}

.ty-product-card:hover .ty-add-to-cart {
    opacity: 1;
    transform: translateY(0);
}

.ty-add-to-cart:hover {
    background: #e06c10;
}
