/**
 * Product In-Store Display Styles
 *
 * Grid layout matching vivaia.jp design
 * Responsive: 2 columns mobile, 3 columns tablet, 4 columns desktop
 *
 * @package Vivaia_POS_Integration
 * @since 1.0.0
 */

/* Container */
.vivaia-product-instore {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

/* Category Banner */
.category-banner {
    margin: 0 0 1.5rem 0;
}

.category-banner img {
    display: block;
    width: 100%;
    height: auto;       /* preserves the image's native aspect ratio */
    max-width: 100%;
}

/* Category Header */
.category-header {
    margin-bottom: 2rem;
    text-align: center;
}

.category-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Product Grid - Mobile First (2 columns) */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding: 0;
}

/* Tablet: 3 columns */
@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

/* Desktop: 6 columns */
@media (min-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 2rem;
    }

    .category-title {
        font-size: 2rem;
    }
}

/* Product Card */
.product-card {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 4px;
    overflow: hidden;
}

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

/* Product Image Container */
.product-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background-color: #f3f4f6;
    overflow: hidden;
    border-radius: 4px;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

/* Product Info */
.product-info {
    padding: 0.75rem 0 0 0;
}

.product-name {
    font-size: 14px;
    font-weight: 400;
    color: #111827;
    margin: 0 0 10px 0;
    text-align: center;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Error Messages */
.vivaia-error,
.vivaia-no-products {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
    font-size: 1rem;
}

.vivaia-error {
    color: #dc2626;
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 4px;
}

/* Loading State (if needed for future AJAX) */
.product-grid.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Accessibility */
.product-card:focus {
    outline: 2px solid #804c1a;
    outline-offset: 2px;
}

.product-card:focus:not(:focus-visible) {
    outline: none;
}

.product-card:focus-visible {
    outline: 2px solid #804c1a;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    .product-card:hover {
        transform: none;
        box-shadow: none;
    }
}
