/* =========================================================
   Winner Shop - Products Page Optimized Glass Background
   Prefix: ps-
========================================================= */

.ps-products-page {
    --ps-primary: #7FA6E8;
    --ps-primary-hover: #6B92D7;
    --ps-primary-dark: #18214A;
    --ps-text-main: #18214A;
    --ps-text-light: #586385;

    --ps-page-glass: rgba(255, 255, 255, 0.42);
    --ps-page-border: rgba(255, 255, 255, 0.38);

    --ps-card-bg: rgba(255, 255, 255, 0.78);
    --ps-card-bg-hover: rgba(255, 255, 255, 0.9);
    --ps-border: rgba(127, 166, 232, 0.22);
    --ps-border-hover: rgba(127, 166, 232, 0.55);

    --ps-shadow-soft: 0 10px 26px rgba(24, 33, 74, 0.07);
    --ps-shadow-hover: 0 14px 32px rgba(24, 33, 74, 0.10);

    position: relative;
    min-height: 100vh;
    direction: rtl;
    overflow: hidden;

    padding: 40px 15px;

    background:
        linear-gradient(135deg, rgba(255,255,255,0.32), rgba(255,255,255,0.16)),
        linear-gradient(180deg, #eef3fb 0%, #e9eef8 100%);
    border-top: 1px solid rgba(255,255,255,0.35);
    border-bottom: 1px solid rgba(255,255,255,0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* =========================================================
   Background Decor
========================================================= */

.ps-bg-decor {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.ps-blob {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.32;
    filter: none;
}

.ps-blob-1 {
    width: 280px;
    height: 280px;
    top: -80px;
    right: -90px;
    background: rgba(175, 199, 246, 0.42);
}

.ps-blob-2 {
    width: 340px;
    height: 340px;
    bottom: 8%;
    left: -130px;
    background: rgba(216, 183, 191, 0.24);
}

.ps-blob-3 {
    width: 220px;
    height: 220px;
    top: 42%;
    right: 14%;
    background: rgba(127, 166, 232, 0.18);
}

/* =========================================================
   Container
========================================================= */

.ps-container {
    position: relative;
    z-index: 1;

    max-width: 1200px;
    margin: 0 auto;
}

/* =========================================================
   Header & Toolbar
========================================================= */

.ps-header {
    text-align: center;
    margin-bottom: 46px;
}

.ps-page-title {
    margin: 0 0 28px;
    color: var(--ps-primary-dark);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 900;
    line-height: 1.4;
}

.ps-page-title span {
    color: var(--ps-primary);
}

.ps-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    max-width: 800px;
    margin: 0 auto;
}

/* =========================================================
   Search Box
========================================================= */

.ps-search-box {
    flex: 2;
    display: flex;
    align-items: center;
    min-width: 280px;
    padding: 6px;

    border-radius: 20px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(255,255,255,0.5);
    box-shadow: 0 8px 20px rgba(24, 33, 74, 0.05);
}

.ps-search-input {
    flex: 1;
    min-width: 0;
    padding: 0 15px;

    background: transparent;
    border: none;
    outline: none;

    color: var(--ps-primary-dark);
    font-weight: 500;
    font-family: inherit;
}

.ps-search-input::placeholder {
    color: rgba(88, 99, 133, 0.75);
}

.ps-search-btn {
    border: none;
    cursor: pointer;
    padding: 10px 25px;
    border-radius: 15px;

    background: var(--ps-primary-dark);
    color: #ffffff;

    font-weight: 700;
    font-family: inherit;

    transition:
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

.ps-search-btn:hover {
    background: #243676;
    box-shadow: 0 6px 16px rgba(24, 33, 74, 0.12);
}

/* =========================================================
   Category Select
========================================================= */

.ps-category-wrapper {
    flex: 1;
    min-width: 180px;
}

.ps-category-select {
    width: 100%;
    appearance: none;
    cursor: pointer;
    outline: none;

    padding: 14px 20px;
    padding-left: 46px;

    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(255,255,255,0.5);

    color: var(--ps-primary-dark);
    font-weight: 700;
    font-family: inherit;

    box-shadow: 0 8px 20px rgba(24, 33, 74, 0.05);

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2318214A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 15px center;
    background-size: 18px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.ps-category-select:hover,
.ps-category-select:focus {
    border-color: var(--ps-border-hover);
    box-shadow: 0 8px 22px rgba(24, 33, 74, 0.07);
}

/* =========================================================
   Product Grid
========================================================= */

.ps-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 30px;
    padding-top: 20px;
}

/* =========================================================
   Product Card
========================================================= */

.ps-product-card {
    position: relative;
    overflow: hidden;

    display: flex;
    flex-direction: column;

    border-radius: 24px;
    background: var(--ps-card-bg);
    border: 1px solid rgba(255,255,255,0.5);
    box-shadow: var(--ps-shadow-soft);

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

.ps-product-card:hover {
    background: var(--ps-card-bg-hover);
    border-color: var(--ps-border-hover);
    box-shadow: var(--ps-shadow-hover);
}

/* Badge */
.ps-product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;

    padding: 8px 14px;
    border-radius: 999px;

    background: var(--ps-primary-dark);
    color: #ffffff;

    font-size: 0.75rem;
    font-weight: 800;

    box-shadow: 0 6px 14px rgba(24, 33, 74, 0.14);
}

/* =========================================================
   Product Image
========================================================= */

.ps-product-image-box {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: #eef2f7;
}

.ps-product-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.25s ease;
}

.ps-product-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(24, 33, 74, 0.04) 0%,
        transparent 48%,
        rgba(24, 33, 74, 0.06) 100%
    );
    pointer-events: none;
}

.ps-product-card:hover .ps-product-img {
    transform: scale(1.035);
}

/* =========================================================
   Product Content
========================================================= */

.ps-product-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 220px;
    padding: 22px;
}

.ps-product-name {
    margin: 0 0 10px;
    color: var(--ps-primary-dark);
    font-size: 1.25rem;
    font-weight: 900;
    line-height: 1.45;
}

.ps-product-text {
    flex-grow: 1;
    margin: 0 0 20px;
    color: var(--ps-text-light);
    font-size: 0.92rem;
    line-height: 1.8;
    overflow: hidden;
}

.ps-product-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: auto;
}

.ps-product-price {
    margin: 0;
    color: var(--ps-primary-dark);
    font-size: 1.1rem;
    font-weight: 900;
    white-space: nowrap;
}

.ps-product-button {
    border: none;
    cursor: pointer;

    padding: 12px 18px;
    border-radius: 14px;

    background: var(--ps-primary-dark);
    color: #ffffff;

    font-weight: 800;
    font-family: inherit;

    transition:
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

.ps-product-button:hover {
    background: var(--ps-primary);
    box-shadow: 0 6px 16px rgba(127, 166, 232, 0.22);
}

.ps-product-button:active {
    box-shadow: none;
}

/* =========================================================
   Responsive
========================================================= */

@media (max-width: 768px) {
    .ps-products-page {
        padding: 32px 14px;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    .ps-header {
        margin-bottom: 36px;
    }

    .ps-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 22px;
    }

    .ps-product-card:hover .ps-product-img {
        transform: none;
    }
}

@media (max-width: 600px) {
    .ps-products-page {
        padding: 28px 12px;
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
    }

    .ps-toolbar {
        flex-direction: column;
    }

    .ps-search-box,
    .ps-category-wrapper {
        width: 100%;
    }

    .ps-search-box {
        min-width: 0;
    }

    .ps-products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .ps-product-card {
        max-width: 100%;
    }

    .ps-product-image-box {
        height: 180px;
    }

    .ps-product-content {
        min-height: auto;
        padding: 18px;
    }

    .ps-product-name {
        font-size: 1.05rem;
    }

    .ps-product-text {
        font-size: 0.88rem;
        line-height: 1.75;
    }

    .ps-product-price {
        font-size: 0.95rem;
    }

    .ps-product-bottom {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .ps-product-button {
        width: 100%;
        text-align: center;
    }

    .ps-products-page *,
    .ps-products-page *::before,
    .ps-products-page *::after {
        animation: none !important;
        will-change: auto !important;
    }
}

@media (max-width: 480px) {
    .ps-blob {
        display: none;
    }

    .ps-page-title {
        margin-bottom: 22px;
    }

    .ps-search-btn {
        padding: 10px 18px;
    }

    .ps-category-select {
        padding-top: 13px;
        padding-bottom: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ps-products-page *,
    .ps-products-page *::before,
    .ps-products-page *::after {
        transition: none !important;
        animation: none !important;
        scroll-behavior: auto !important;
    }
}
