/* Product Card Layout Fixes */
.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card-desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: auto;
    /* Push price/button down */
}

.product-card-price {
    margin-top: var(--space-4);
}

/* Product Modal */
.product-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.product-modal.open {
    opacity: 1;
    pointer-events: auto;
}

.product-modal-content {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: var(--space-8);
    padding: var(--space-8);
}

.product-modal-close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    background: none;
    border: none;
    color: var(--color-text);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
}

.product-modal-gallery {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.product-modal-main-img {
    width: 100%;
    height: auto;
    max-height: 60vh;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
}

.product-modal-thumbs {
    display: flex;
    gap: var(--space-2);
    overflow-x: auto;
}

.product-modal-thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    border: 2px solid transparent;
}

.product-modal-thumb:hover,
.product-modal-thumb.active {
    opacity: 1;
    border-color: var(--color-accent);
}

.product-modal-info {
    display: flex;
    flex-direction: column;
}

.product-modal-title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 700;
    margin-bottom: var(--space-4);
    line-height: 1.2;
}

.product-modal-desc {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    line-height: 1.6;
    margin-bottom: var(--space-6);
    white-space: pre-wrap;
    /* Preserve formatting */
}

/* Mobile responsive */
@media (max-width: 768px) {
    .product-modal-content {
        grid-template-columns: 1fr;
        padding: var(--space-6);
        gap: var(--space-6);
    }

    .product-modal-main-img {
        height: 250px;
    }
}