.catalog-page {
    padding: 18px 16px 40px;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

.catalog-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 12px;
}

.catalog-crumbs a {
    color: #850606;
    text-decoration: none;
    font-weight: 700;
}

.catalog-page__title {
    text-align: center;
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 10px;
}

.catalog-page__hint {
    text-align: center;
    color: #64748b;
    margin: 0 0 18px;
    font-size: 14px;
}

.catalog-search {
    max-width: 520px;
    margin: 0 auto 18px !important;
    width: 100%;
    position: relative;
}


.catalog-search .search-input {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    background: #ededed;
    color: #666;
    font: inherit;
    font-size: 15px;
    font-weight: 400;
    outline: none;
    text-align: right;
    box-sizing: border-box;
}

.catalog-search .search-input:focus {
    background: #e8eaed;
    box-shadow: 0 0 0 2px rgba(133, 6, 6, 0.25);
}

.catalog-grid {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
}

.catalog-empty {
    width: 100%;
    text-align: center;
    color: #64748b;
}

.category-circle__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #eee;
    color: #850606;
    font-size: 28px;
    font-weight: 800;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.product-card {
    background: transparent;
    border: none;
    border-radius: 14px;
    padding: 14px;
    text-align: center;
}

.product-card__img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 10px;
}

.product-card__name {
    font-size: 15px;
    font-weight: 800;
    margin: 0 0 6px;
}

.product-card__price {
    color: #850606;
    font-weight: 700;
    margin: 0 0 12px;
}

.product-card__actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.product-card__buy {
    background: #850606;
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 8px 18px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
}

.product-card__fav {
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 18px;
    cursor: pointer;
}

.product-card__fav.is-active {
    color: #da3545;
}

.purchase-modal[hidden] {
    display: none !important;
}

.purchase-modal {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.purchase-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.purchase-modal__box {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 24px 20px 20px;
    width: 100%;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.purchase-modal__close {
    position: absolute;
    top: 8px;
    left: 10px;
    border: none;
    background: transparent;
    font-size: 28px;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
}

.purchase-modal__title {
    font-size: 20px;
    font-weight: 800;
    margin: 0 0 12px;
}

.purchase-modal__product {
    font-weight: 700;
    margin: 0 0 8px;
}

.purchase-modal__price,
.purchase-modal__balance {
    margin: 4px 0;
    color: #475569;
}

.purchase-modal__warn {
    background: #fde8e8;
    color: #c0392b;
    border-radius: 10px;
    padding: 10px;
    font-size: 13px;
    font-weight: 700;
    margin: 12px 0;
}

.purchase-modal__submit {
    width: 100%;
    margin-top: 14px;
    background: #850606;
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 12px;
    font-weight: 800;
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
}

.purchase-modal__submit.is-disabled,
.purchase-modal__submit:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

@media (max-width: 640px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    .purchase-modal__box {
        padding: 20px 14px 16px;
        max-width: 100%;
    }
}

@media (max-width: 400px) {
    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .product-card {
        padding: 10px;
    }

    .product-card__name {
        font-size: 13px;
    }

    .product-card__price {
        font-size: 13px;
    }
}
