/**
 * Product Cards Responsive Styles
 * Improves the responsive design for product cards in recommendation sections
 */

/* Base product card styles */
.gk-product-section {
    margin: 40px 0;
    padding: 0;
}

.gk-section-title {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 25px;
}

.gk-card-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    margin: 0 auto;
    max-width: 1200px;
    padding: 0 15px;
}

.gk-product-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.gk-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.gk-card-image {
    position: relative;
    overflow: hidden;
    padding-top: 100%; /* 1:1 Aspect Ratio */
}

.gk-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gk-card-name {
    font-size: 14px;
    font-weight: 500;
    padding: 10px 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #000; /* black color */
}

.gk-card-price {
    padding: 0 12px 12px;
    margin-top: auto;
    overflow: visible; /* prevent clipped text */
    position: relative;
}

/* Price styles */
.gk-card-price .current-price {
    font-weight: 400; /* non-bold as requested */
    font-size: 9px; /* reduced by 20% from 11.2px */
    color: #000; /* black color */
    display: block;
    margin-bottom: 4px;
}

/* Ensure WooCommerce price spans render visibly inside product cards */
.gk-card-price .woocommerce-Price-amount,
.gk-card-price .woocommerce-Price-amount *,
.gk-card-price .woocommerce-Price-currencySymbol,
.gk-card-price bdi {
    display: inline !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #000 !important; /* black color */
    text-decoration: none !important;
}

.gk-card-price .current-price .woocommerce-Price-amount[aria-hidden="true"] {
    visibility: visible !important;
}

.gk-card-price .prime-price {
    font-size: 13px;
    color: #66CC66;
    font-weight: 600;
    display: block;
}

/* Style plain price range fallback */
.gk-card-price .gk-plain-price {
    color: #000; /* black color */
    font-weight: 400;
}

/* Regular and sale price styles in cards */
.gk-card-price del {
    color: #95a5a6; /* muted regular price */
    font-weight: 400;
    font-size: 14px;
    margin-right: 8px;
    text-decoration: line-through; /* explicit strikethrough */
}

.gk-card-price ins {
    text-decoration: none; /* clean sale price */
    color: #6ab04c; /* green sale price for emphasis */
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .gk-card-row {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 992px) {
    .gk-card-row {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .gk-section-title {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .gk-card-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    .gk-product-card {
        border-radius: 6px;
    }
    
    .gk-card-name {
        font-size: 13px;
        padding: 8px 10px;
    }
    
    .gk-card-price {
        padding: 0 10px 10px;
        overflow: visible;
    }
    
    .gk-card-price .current-price {
        font-size: 8.3px; /* reduced by 20% from 10.4px */
    }
    
    .gk-card-price .prime-price {
        font-size: 12px;
    }
}

@media (max-width: 576px) {
    .gk-card-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .gk-section-title {
        font-size: 20px;
        margin-bottom: 15px;
    }
}

/* Loading state styles */
.gk-product-card.loading .gk-card-image {
    background: #f0f0f0;
    animation: pulse 1.5s infinite;
}

.gk-product-card.loading .gk-card-name,
.gk-product-card.loading .gk-card-price {
    background: #f0f0f0;
    height: 16px;
    margin: 10px;
    border-radius: 4px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.6;
    }
}