/* =====================================================
   SHARED PRODUCT CARD STYLES
   Used across: products.php, index.php, search.php,
   store.php, favorites.php, manage.php
   ===================================================== */

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Product Card */
.product-card {
    background: var(--bg-card, #1a1a2e);
    border: 1px solid var(--border-primary, #2a2a4a);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    animation: slideUp 0.5s ease-in-out;
}

.product-card:hover {
    border-color: var(--primary, #05d6c1);
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3), 0 0 32px rgba(5, 214, 193, 0.1);
    scale: 1.02;
}

/* Product Image */
.product-image {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    background: var(--bg-elevated, #0f0f1a);
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-image .no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #6b7280);
    font-size: 48px;
    background: linear-gradient(135deg, var(--bg-elevated, #0f0f1a) 0%, var(--bg-tertiary, #1a1a2e) 100%);
}

/* Discount Tag */
.discount-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-radius: 20px;
    color: white;
    font-size: 11px;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Product Gallery Back Button */
.product-gallery__back {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(15, 15, 26, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.9);
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    z-index: 4;
    transition: all 0.2s ease;
}

.product-gallery__back:hover {
    background: rgba(15, 15, 26, 0.95);
    color: white;
    transform: translateY(-1px);
}

.product-gallery__back i {
    font-size: 11px;
}

/* Favorite Button */
.product-favorite-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(15, 15, 26, 0.6);
    backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.85);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    transition: transform 0.2s ease, background 0.2s ease;
}

.product-favorite-btn:hover {
    transform: scale(1.06);
    background: rgba(15, 15, 26, 0.8);
}

.product-favorite-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    transform: scale(1.1);
}

.product-favorite-btn i {
    font-size: 16px;
    color: #fff;
    transition: all 0.3s ease;
}

.product-favorite-btn.favorited {
    color: #ef4444; 
    border-color: #ef4444b4;
}
.product-favorite-btn.favorited i {
    color: #ef4444; 
    border-color: #ef4444;
}

.product-favorite-btn.favorited:hover {
    background: rgba(239, 68, 68, 0.25);
}
/* Out of Stock */
.out-of-stock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.out-of-stock-badge {
    padding: 8px 16px;
    background: rgba(239, 68, 68, 0.9);
    border-radius: 20px;
    color: white;
    font-size: 12px;
    font-weight: 700;
}

/* Store Overlay on Image */
.product-store {
    position: absolute;
    left: 10px;
    bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: calc(100% - 20px);
    padding: 3px 3px;
    background: rgba(15, 15, 26, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    z-index: 2;
}

.product-store__logo {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-store__logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-store__fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary, #05d6c1);
    font-size: 11px;
}

.product-store__name {
    min-width: 0;
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 2px;
    padding-right: 6px;
}

/* Product Content */
.product-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.product-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #fff);
    margin: 0;
    line-height: 1.35;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.product-card:hover .product-name {
    color: var(--primary, #05d6c1);
}

/* Color Swatches */
.product-colors {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 18px;
}

.product-color-dot,
.product-color-more {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}

.product-color-dot {
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 0 0 1px rgba(15, 15, 26, 0.45) inset;
}

.product-color-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary, #a0a0b0);
    font-size: 8px;
    font-weight: 700;
}

/* Meta Row (price + colors) */
.product-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--border-primary, #2a2a4a);
}

.product-price-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.product-price {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary, #05d6c1);
    letter-spacing: 0;
    white-space: nowrap;
}

.product-price-old {
    font-size: 10px;
    color: var(--text-muted, #6b7280);
    text-decoration: line-through;
    white-space: nowrap;
}

/* =====================================================
   RESPONSIVE - Products Grid
   ===================================================== */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
}
