/* Center single card on last row for mobile */
@media (max-width: 1023px) {
    .grid-cols-2 > *:nth-child(5) {
        grid-column: 1 / -1;
        justify-self: center;
        max-width: 50%;
    }
}

.products-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
}

.products-grid > * {
    flex: 0 0 300px;
    max-width: 300px;
}

@media (max-width: 639px) {
    .products-grid > * {
        flex: 0 0 calc(50% - 1rem);
        min-width: 280px;
    }
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.products-grid > div:hover {
    cursor: pointer;
}

.custom-select {
    position: relative;
}
.select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    transform: translateY(4px);
}
.select-option {
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid #f3f4f6;
}
.select-option:hover {
    background-color: #f8fafc;
}
.select-option:last-child {
    border-bottom: none;
}
.select-option.selected {
    background-color: #dbeafe;
    color: #1e40af;
}
.price-input {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0.75rem;
    padding: 0.75rem;
    font-size: 0.875rem;
    transition: all 0.2s;
    width: 100%;
}
.price-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.filter-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    border: none;
    border-radius: 0.75rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}
.clear-btn {
    background: transparent;
    color: #6b7280;
    border: 1px solid #d1d5db;
    border-radius: 0.75rem;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s;
    cursor: pointer;
}
.clear-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}
.search-input {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem 0.75rem 3rem;
    font-size: 0.875rem;
    transition: all 0.2s;
    width: 100%;
}
.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
#review_form textarea#comment {
    min-height: 150px;
    font-size: 1rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
}
#review_form p.comment-form-rating select,
#review_form p.stars,
#review_form .stars {
    display: none !important;
}
@media (max-width: 768px) {
    .mobile-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}
/* Loading spinner */
#products-loading {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#products-loading.hidden {
    display: none;
}

/* Dialog overlay transition */
.dialog-overlay {
    transition: opacity 0.2s ease;
}

/* Recommended products scroll */
#recommendedProducts {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

#recommendedProducts::-webkit-scrollbar {
    height: 6px;
}

#recommendedProducts::-webkit-scrollbar-track {
    background: transparent;
}

#recommendedProducts::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

/* col-span-full for no-results in grid */
.col-span-full {
    grid-column: 1 / -1;
    flex-basis: 100%;
}