/* ================================================
   KEFA STUDIO - MODERN PRODUCT CARDS
   Optimized for 6-column grid layout
   ================================================ */

/* ===== PRODUCT CARD BASE ===== */
.product-card {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(156, 132, 204, 0.2);
    z-index: 10;
}

/* ===== PRODUCT IMAGE ===== */
.product-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--gray-100);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.08);
}

/* ===== FAVORITE ICON ===== */
.product-favorite {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.product-favorite:hover {
    background: var(--white);
    transform: scale(1.15);
}

.product-favorite i {
    color: var(--gray-400);
    font-size: 14px;
    transition: color 0.2s ease;
}

.product-favorite:hover i,
.product-favorite.active i {
    color: var(--primary);
}

/* ===== PRODUCT BADGE ===== */
.product-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 10px;
    background: var(--primary);
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--radius-full);
    letter-spacing: 0.3px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(156, 132, 204, 0.4);
    z-index: 5;
}

/* ===== PRODUCT INFO ===== */
.product-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

/* ===== PRODUCT TITLE ===== */
.product-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.3;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 34px;
    transition: color 0.2s ease;
}

.product-title:hover {
    color: var(--primary);
}

/* ===== PRODUCT PRICE ===== */
.product-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 4px 0;
}

.old-price {
    font-size: 12px;
    color: var(--gray-400);
    text-decoration: line-through;
    font-weight: 400;
}

/* ===== PRODUCT ACTIONS ===== */
.product-actions {
    display: block;
    margin-top: auto;
}

/* ===== ADD TO CART BUTTON ===== */
.btn-add-cart {
    padding: 8px 12px;
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
    font-size: 12px;
    border-radius: 8px;
    border: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
}

.btn-add-cart:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(156, 132, 204, 0.3);
}

.btn-add-cart i {
    font-size: 12px;
}


/* ===== CATEGORY BADGE (Optional) ===== */
.category-badge {
    display: inline-block;
    padding: 3px 8px;
    background: var(--gray-100);
    color: var(--gray-600);
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 600;
    margin-bottom: 4px;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */

/* Large Desktop (6 columns) - Extra compact */
@media (min-width: 1200px) {
    .product-info {
        padding: 10px;
        gap: 4px;
    }

    .product-title {
        font-size: 12px;
        min-height: 31px;
    }

    .product-price {
        font-size: 14px;
    }

    .old-price {
        font-size: 11px;
    }

    .btn-add-cart {
        padding: 7px 10px;
        font-size: 11px;
    }

    .btn-quick-view {
        width: 32px;
        height: 32px;
    }

    .product-favorite {
        width: 28px;
        height: 28px;
    }

    .product-favorite i {
        font-size: 12px;
    }
}

/* Desktop (4 columns) */
@media (min-width: 992px) and (max-width: 1199px) {
    .product-info {
        padding: 12px;
    }

    .product-title {
        font-size: 13px;
    }

    .product-price {
        font-size: 16px;
    }
}

/* Tablet (3 columns) */
@media (min-width: 768px) and (max-width: 991px) {
    .product-info {
        padding: 14px;
    }

    .product-title {
        font-size: 14px;
        min-height: 38px;
    }

    .product-price {
        font-size: 18px;
    }

    .btn-add-cart {
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* Mobile (2 columns) */
@media (max-width: 767px) {
    .product-info {
        padding: 10px;
        gap: 6px;
    }

    .product-title {
        font-size: 12px;
        min-height: 31px;
    }

    .product-price {
        font-size: 15px;
    }

    .old-price {
        font-size: 11px;
    }

    .btn-add-cart {
        padding: 8px 10px;
        font-size: 11px;
    }

    .btn-quick-view {
        width: 32px;
        height: 32px;
    }

    .product-favorite {
        width: 28px;
        height: 28px;
        top: 6px;
        left: 6px;
    }

    .product-badge {
        top: 6px;
        right: 6px;
        padding: 3px 8px;
        font-size: 9px;
    }
}

/* Extra Small Mobile (single column fallback) */
@media (max-width: 480px) {
    .product-card {
        max-width: 100%;
    }

    .product-info {
        padding: 12px;
    }

    .product-title {
        font-size: 14px;
        min-height: 38px;
    }

    .product-price {
        font-size: 18px;
    }

    .btn-add-cart {
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* ===== LOADING STATE ===== */
.product-card.loading {
    pointer-events: none;
    opacity: 0.6;
}

.product-card.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== OUT OF STOCK ===== */
.product-card.out-of-stock {
    opacity: 0.7;
}

.product-card.out-of-stock .product-image::after {
    content: 'Out of Stock';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

/* ===== HOVER ENHANCEMENTS ===== */
.product-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.product-card:hover .product-image::before {
    opacity: 1;
}

/* ===== RATING STARS (if needed) ===== */
.product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #FFA500;
    margin: 2px 0;
}

.product-rating .rating-count {
    color: var(--gray-500);
    font-size: 10px;
    margin-left: 2px;
}

/* ===== DISCOUNT PERCENTAGE ===== */
.discount-percentage {
    display: inline-block;
    padding: 2px 6px;
    background: var(--error);
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    border-radius: 4px;
    margin-left: 4px;
}

/* ===== OVERRIDE OLD PRODUCT CARD STYLES ===== */
/* This ensures product-cards.css takes precedence */

.products-grid .product-card {
    /* Reset any conflicting styles from style.css */
}

/* Ensure proper spacing in grid */
.products-section {
    padding: var(--space-2xl) 0;
}

.products-section:first-of-type {
    padding-top: 0;
}

/* Better section spacing */
.section-title {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.section-title h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--space-sm);
    letter-spacing: -0.02em;
}

.section-title p {
    font-size: clamp(0.9375rem, 2vw, 1.125rem);
    color: var(--gray-600);
}

/* Improved "See All" button */
.text-center .btn-secondary {
    margin-top: var(--space-lg);
}