.products-page {
    direction: rtl;
    width: 100%;
    min-height: 100vh;
    padding: 20px 0 50px;
    background-color: #f6f7f9;
}

.products-page .products-hero {
    margin-bottom: 25px;
    padding: 30px 20px;
    color: #fff;
    background: #0473c0;
    border-radius: 16px;
    text-align: right;
}

.products-page .products-hero h1 {
    margin: 0 0 10px;
    font-size: 32px;
    font-weight: 800;
    line-height: 1.5;
}

.products-page .products-hero p {
    margin: 0;
    font-size: 16px;
    line-height: 1.8;
}

.products-page .products-filter {
    margin-bottom: 30px;
    padding: 20px;
    background: #fff;
    border: 1px solid #e2e6ea;
    border-radius: 15px;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.05);
}

.products-page .form-label {
    margin-bottom: 7px;
    font-weight: 700;
}

.products-page .form-control,
.products-page .form-select {
    width: 100%;
    min-height: 48px;
    border: 1px solid #ced4da;
    border-radius: 10px;
}

.products-page .search-button {
    width: 100%;
    min-height: 48px;
    border-radius: 10px;
    font-weight: 700;
}

.products-page .category-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.products-page .category-navigation a {
    display: inline-block;
    padding: 9px 17px;
    color: #333;
    background: #f1f3f5;
    border: 1px solid #dee2e6;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 700;
}

.products-page .category-navigation a:hover,
.products-page .category-navigation a.active {
    color: #fff;
    background: #0473c0;
    border-color: #0473c0;
}

.products-page .products-grid {
    width: 100%;
}

.products-page .product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e2e6ea;
    border-radius: 15px;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.products-page .product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.14);
}

.products-page .product-card-link {
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: 15px;
}

.products-page .product-card-link:focus-visible {
    outline: 3px solid rgba(4, 115, 192, 0.35);
    outline-offset: 3px;
}

.products-page .product-image-area {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #f3f4f5;
    aspect-ratio: 4 / 3;
}

.products-page .product-image-area .carousel,
.products-page .product-image-area .carousel-inner,
.products-page .product-image-area .carousel-item {
    width: 100%;
    height: 100%;
}

.products-page .product-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #f3f4f5;
}

.products-page .product-code {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
    padding: 5px 9px;
    color: #fff;
    background: rgba(0, 0, 0, 0.65);
    border-radius: 20px;
    font-size: 12px;
}

.products-page .product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 5;
    padding: 6px 11px;
    color: #fff;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
}

.products-page .product-badge-new {
    background: #0473c0;
}

.products-page .product-badge-best {
    background: #e67e22;
}

.products-page .product-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 16px;
    text-align: right;
}

.products-page .product-title {
    margin: 0 0 9px;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.5;
}

.products-page .product-title {
    color: #222;
    transition: color 0.2s ease;
}

.products-page .product-title a {
    color: inherit;
    text-decoration: none;
}

.products-page .product-card:hover .product-title {
    color: #0473c0;
}

.products-page .product-category {
    margin: 0 0 10px;
    color: #6c757d;
    font-size: 14px;
}

.products-page .product-price {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 10px;
    padding: 10px 12px;
    background: #f2faf5;
    border-radius: 9px;
}

.products-page .product-price span {
    color: #666;
}

.products-page .product-price strong {
    color: #198754;
    font-size: 20px;
}

.products-page .product-description {
    margin-bottom: 14px;
    color: #666;
    font-size: 14px;
    line-height: 1.7;
}

/* Keep the optional mattress control above the full-card Details link overlay. */
.products-page .mattress-option {
    position: relative;
    z-index: 6;
    cursor: pointer;
}

.products-page .mattress-option input[type="checkbox"] {
    cursor: pointer;
}

.products-page .product-actions {
    position: relative;
    z-index: 6;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: auto;
}

.products-page .product-actions .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 43px;
    padding: 7px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 700;
}

.products-page .product-card .carousel-control-prev,
.products-page .product-card .carousel-control-next {
    z-index: 6;
}

.products-page .out-of-stock {
    position: relative;
    z-index: 6;
    display: block;
    margin-top: auto;
    padding: 9px;
    color: #b42318;
    background: #fff1f0;
    border: 1px solid #ffccc7;
    border-radius: 8px;
    text-align: center;
    font-weight: 700;
}

.products-page .empty-products {
    padding: 45px 20px;
    background: #fff;
    border: 1px solid #e2e6ea;
    border-radius: 15px;
    text-align: center;
}

@media (max-width: 767px) {
    .products-page {
        padding-top: 10px;
    }

    .products-page .products-hero {
        padding: 23px 16px;
        border-radius: 12px;
    }

    .products-page .products-hero h1 {
        font-size: 25px;
    }

    .products-page .products-hero p {
        font-size: 14px;
    }

    .products-page .products-filter {
        padding: 15px;
    }

    .products-page .category-navigation a {
        flex: 1 1 calc(33.333% - 10px);
        padding: 8px 4px;
        text-align: center;
        font-size: 13px;
    }

}

@media (max-width: 480px) {
    .products-page .category-navigation a {
        flex: 1 1 calc(50% - 10px);
    }

    /* Keep the optional mattress control above the full-card Details link overlay. */
.products-page .mattress-option {
    position: relative;
    z-index: 6;
    cursor: pointer;
}

.products-page .mattress-option input[type="checkbox"] {
    cursor: pointer;
}

.products-page .product-actions {
        grid-template-columns: 1fr;
    }
}
@media (prefers-reduced-motion: reduce) {
    .products-page .product-card,
    .products-page .product-title {
        transition: none;
    }

    .products-page .product-card:hover {
        transform: none;
    }
}
