/**
 * Modern Card Product Loop Template Styles
 * Inspired by https://fastfood-tnc.webflow.io/menu
 * Horizontal layout with image on left, content on right
 */

/* Container with grid layout */
.wf-template-wrapper.wf-template-card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 columns by default */
    gap: 16px;
    padding: 20px;
    margin: 0;
}

/* Column variations */
.wf-template-wrapper.wf-template-card-grid.wf-template-columns-1 {
    grid-template-columns: 1fr;
    max-width: 800px;
    margin: 0 auto;
}

.wf-template-wrapper.wf-template-card-grid.wf-template-columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.wf-template-wrapper.wf-template-card-grid.wf-template-columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.wf-template-wrapper.wf-template-card-grid.wf-template-columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.wf-template-wrapper.wf-template-card-grid .wf-template-products {
    list-style: none;
    margin: 0;
    padding: 0;
    display: contents; /* Allow grid items to flow directly */
}

/* Individual card styling - HORIZONTAL layout like the website */
.wf-template-wrapper.wf-template-card-grid .wf-template-product {
    list-style: none;
    margin: 0;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
    
    /* HORIZONTAL layout like the website - Image LEFT, Content RIGHT */
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 16px;
}

.wf-template-wrapper.wf-template-card-grid .wf-template-product:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.wf-template-wrapper.wf-template-card-grid .wf-template-product.unavailable {
    opacity: 0.6;
    transform: none;
}

.wf-template-wrapper.wf-template-card-grid .wf-template-product.unavailable:hover {
    transform: none;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* Product image - LEFT side, square */
.wf-template-wrapper.wf-template-card-grid .wf-template-product .product-image {
    flex: 0 0 120px;
    width: 120px;
    height: 120px;
    overflow: hidden;
    border-radius: 8px;
    position: relative;
    margin: 0;
    background: #f8f9fa;
}

.wf-template-wrapper.wf-template-card-grid .wf-template-product .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.wf-template-wrapper.wf-template-card-grid .wf-template-product:hover .product-image img {
    transform: scale(1.03);
}

/* Card content area - RIGHT side */
.wf-template-wrapper.wf-template-card-grid .wf-template-product .card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 120px;
}

/* Star rating at top */
.wf-template-wrapper.wf-template-card-grid .wf-template-product .product-rating {
    margin-bottom: 8px;
}

.wf-template-wrapper.wf-template-card-grid .wf-template-product .rating-stars {
    color: #ffc107;
    font-size: 14px;
    margin-bottom: 4px;
}

.wf-template-wrapper.wf-template-card-grid .wf-template-product .rating-count {
    font-size: 12px;
    color: #666;
    font-weight: 600;
}

/* Product title styling */
.wf-template-wrapper.wf-template-card-grid .wf-template-product .product-title {
    margin: 0 0 8px 0;
}

.wf-template-wrapper.wf-template-card-grid .wf-template-product .product-title > span {
    font-size: 18px;
    font-weight: 700;
    color: var(--woofood-text-color, #1a1a1a);
    line-height: 1.3;
    display: block;
    margin-bottom: 0;
}

/* Product description */
.wf-template-wrapper.wf-template-card-grid .wf-template-product .product-short-descr {
    flex-grow: 1;
    margin: 0 0 16px 0;
}

.wf-template-wrapper.wf-template-card-grid .wf-template-product .product-short-descr span {
    font-size: 14px;
    color: var(--woofood-text-color, #666);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Price and button row at bottom */
.wf-template-wrapper.wf-template-card-grid .wf-template-product .product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    gap: 12px;
}

/* Price styling - Golden/yellow color like website */
.wf-template-wrapper.wf-template-card-grid .wf-template-product .product-price {
    margin: 0;
    flex: 0 0 auto;
}

.wf-template-wrapper.wf-template-card-grid .wf-template-product .product-price .woocommerce-Price-amount {
    font-size: 18px;
    font-weight: 700;
    color: var(--woofood-secondary-color, #f0c04c);
}

.wf-template-wrapper.wf-template-card-grid .wf-template-product .product-price .woocommerce-Price-currencySymbol {
    font-size: 16px;
    color: var(--woofood-secondary-color, #f0c04c);
}

/* Modern button styling - Golden/yellow like website */
.wf-template-wrapper.wf-template-card-grid .wf-template-product .product-button {
    margin: 0;
    flex: 0 0 auto;
}

.wf-template-wrapper.wf-template-card-grid .wf-template-product .product-button .button,
.wf-template-wrapper.wf-template-card-grid .wf-template-product .product-button .woofood-quickview-button,
.wf-template-wrapper.wf-template-card-grid .wf-template-product .product-button button {
    background: var(--woofood-secondary-color, #f0c04c);
    color: var(--woofood-button-text-color, #1a1a1a);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
    line-height: 1.2;
    text-transform: none;
    letter-spacing: 0;
}

.wf-template-wrapper.wf-template-card-grid .wf-template-product .product-button .button:hover,
.wf-template-wrapper.wf-template-card-grid .wf-template-product .product-button .woofood-quickview-button:hover,
.wf-template-wrapper.wf-template-card-grid .wf-template-product .product-button button:hover {
    background: var(--woofood-accent-color, #e6b143);
    transform: none; /* No lift effect, just color change */
    text-decoration: none;
    color: var(--woofood-button-text-color, #1a1a1a);
}

.wf-template-wrapper.wf-template-card-grid .wf-template-product .product-button .button:focus,
.wf-template-wrapper.wf-template-card-grid .wf-template-product .product-button .woofood-quickview-button:focus,
.wf-template-wrapper.wf-template-card-grid .wf-template-product .product-button button:focus {
    outline: 2px solid var(--woofood-secondary-color, #f0c04c);
    outline-offset: 2px;
}

.wf-template-wrapper.wf-template-card-grid .wf-template-product .product-button .button.disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    color: #666;
}

.wf-template-wrapper.wf-template-card-grid .wf-template-product .product-button .button.disabled:hover {
    background: #bdc3c7;
    transform: none;
    color: #666;
}

/* Cart form styles */
.wf-template-wrapper.wf-template-card-grid .wf-template-product .cart {
    margin: 0;
    display: inline-block;
}

/* Mobile responsiveness - Force single column */
@media (max-width: 768px) {
    .wf-template-wrapper.wf-template-card-grid,
    .wf-template-wrapper.wf-template-card-grid.wf-template-columns-1,
    .wf-template-wrapper.wf-template-card-grid.wf-template-columns-2,
    .wf-template-wrapper.wf-template-card-grid.wf-template-columns-3,
    .wf-template-wrapper.wf-template-card-grid.wf-template-columns-4 {
        grid-template-columns: 1fr !important; /* Force single column on mobile */
        gap: 12px;
        padding: 16px;
    }
    
    .wf-template-wrapper.wf-template-card-grid .wf-template-product {
        padding: 16px;
        gap: 12px;
    }
    
    .wf-template-wrapper.wf-template-card-grid .wf-template-product .product-image {
        flex: 0 0 100px;
        width: 100px;
        height: 100px;
    }
    
    .wf-template-wrapper.wf-template-card-grid .wf-template-product .card-content {
        min-height: 100px;
    }
    
    .wf-template-wrapper.wf-template-card-grid .wf-template-product .product-title > span {
        font-size: 16px;
    }
    
    .wf-template-wrapper.wf-template-card-grid .wf-template-product .product-short-descr span {
        font-size: 13px;
        -webkit-line-clamp: 1; /* Less lines on mobile */
    }
}

/* Small screens */
@media (max-width: 480px) {
    .wf-template-wrapper.wf-template-card-grid {
        gap: 10px;
        padding: 12px;
    }
    
    .wf-template-wrapper.wf-template-card-grid .wf-template-product {
        padding: 12px;
        gap: 10px;
    }
    
    .wf-template-wrapper.wf-template-card-grid .wf-template-product .product-image {
        flex: 0 0 80px;
        width: 80px;
        height: 80px;
    }
    
    .wf-template-wrapper.wf-template-card-grid .wf-template-product .card-content {
        min-height: 80px;
    }
    
    .wf-template-wrapper.wf-template-card-grid .wf-template-product .product-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .wf-template-wrapper.wf-template-card-grid .wf-template-product .product-button .button,
    .wf-template-wrapper.wf-template-card-grid .wf-template-product .product-button .woofood-quickview-button,
    .wf-template-wrapper.wf-template-card-grid .wf-template-product .product-button button {
        width: 100%;
        text-align: center;
    }
}

/* Tablet specific - 2 columns for 3+ column layouts */
@media (min-width: 481px) and (max-width: 768px) {
    .wf-template-wrapper.wf-template-card-grid.wf-template-columns-3,
    .wf-template-wrapper.wf-template-card-grid.wf-template-columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Large screens - better spacing */
@media (min-width: 1200px) {
    .wf-template-wrapper.wf-template-card-grid {
        gap: 20px;
        padding: 24px;
    }
    
    .wf-template-wrapper.wf-template-card-grid .wf-template-product {
        padding: 24px;
        gap: 20px;
    }
    
    .wf-template-wrapper.wf-template-card-grid .wf-template-product .product-image {
        flex: 0 0 140px;
        width: 140px;
        height: 140px;
    }
    
    .wf-template-wrapper.wf-template-card-grid .wf-template-product .card-content {
        min-height: 140px;
    }
}

/* Accessibility improvements */
.wf-template-wrapper.wf-template-card-grid .wf-template-product .product-button .button:focus-visible,
.wf-template-wrapper.wf-template-card-grid .wf-template-product .product-button .woofood-quickview-button:focus-visible,
.wf-template-wrapper.wf-template-card-grid .wf-template-product .product-button button:focus-visible {
    outline: 2px solid var(--woofood-secondary-color, #f0c04c);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .wf-template-wrapper.wf-template-card-grid .wf-template-product .product-button {
        display: none;
    }
    
    .wf-template-wrapper.wf-template-card-grid .wf-template-product {
        border: 1px solid #000;
        break-inside: avoid;
    }
    
    .wf-template-wrapper.wf-template-card-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* Loading states */
.wf-template-wrapper.wf-template-card-grid .wf-template-product.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Simple star rating display */
.wf-template-wrapper.wf-template-card-grid .wf-template-product .rating-stars::before {
    content: "★★★★★";
    letter-spacing: 2px;
}
