/* Product cards and the grid they sit in (home «الأكثر مبيعاً», اللوحات, الأعمال الخشبية,
 * لوحات مختارة, search results). Two columns on phones, three on tablets, four on desktop.
 * Every card has the same size: a square picture box (the whole picture is shown, never
 * cropped or stretched) and a text area with the name (up to two lines) and the price. */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.product-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    text-decoration: none;
    color: var(--color-text);
    background: var(--color-white, #fff);
    border: 1px solid #ece8e4;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.product-card:hover,
.product-card:focus-visible {
    box-shadow: var(--shadow-soft);
    transform: translateY(-3px);
    border-color: var(--color-gold-light, #d4b87a);
}
.product-card__media {
    aspect-ratio: 1 / 1;
    background: linear-gradient(145deg, #ebe4da, #d5cfc8);
    overflow: hidden;
    display: grid;
    place-items: center;
}
.product-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.6s ease;
}
.product-card:hover .product-card__media img { transform: scale(1.04); }
.product-card__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px 12px;
    flex: 1 1 auto;
}
.product-card__name {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-primary);
    font-size: 0.98rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(1.45em * 2);
    overflow-wrap: anywhere;
}
.product-card__price {
    font-size: 0.9rem;
    color: var(--color-gold);
    font-weight: 700;
    margin-top: auto;
}
.product-grid__empty { color: var(--color-text-muted, #6b6560); text-align: center; padding: 36px 0; margin: 0; }

@media (min-width: 640px) {
    .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
}
@media (min-width: 1000px) {
    .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
}
@media (max-width: 420px) {
    .product-grid { gap: 10px; }
    .product-card__body { padding: 8px 10px 10px; }
    .product-card__name { font-size: 0.9rem; }
    .product-card__price { font-size: 0.84rem; }
}

/* search page form */
.search-page-form { display: flex; gap: 8px; margin: 0 0 22px; }
.search-page-form__input {
    flex: 1 1 auto; min-width: 0; padding: 12px 14px; border: 1px solid var(--color-border); border-radius: 10px;
    background: #fff; font: inherit; font-size: 1rem; color: inherit;
}
.search-page-form__input:focus { outline: 2px solid var(--color-gold); outline-offset: 1px; }
