:root {
    --primary: #6c5ce7;
    --secondary: #a29bfe;
    --dark: #2d3436;
    --light: #f5f6fa;
    --accent: #fd79a8;
    --text-dark: #2d3436;
    --text-light: #f5f6fa;
    --header-bg: #1a1a2e;
    --card-bg: #ffffff;
    --footer-bg: #16213e;
    --price-card-bg: #f8f9fa;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: all 0.3s ease;
}

body {
    font-family: 'Vazir', sans-serif;
    background: var(--light);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
}

header {
    display: flex;
    align-items: center;
    padding: 15px 5%;
    background: var(--header-bg);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    flex-wrap: nowrap;
    flex-direction: row;
}

header .logo,
header .search {
    display: flex;
    align-items: center;
    flex: 0 0 50%;
}

header .logo {
    gap: 10px;
    cursor: pointer;
    direction: rtl;
}

header .logo img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 50%;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.3));
}

header .logo-texts {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

header .logo-texts h3 {
    margin: 0;
    font-weight: 700;
    font-size: 1.2rem;
    background: linear-gradient(90deg, #00dbde, #fc00ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header .search {
    justify-content: flex-start;
    gap: 0;
}

header .search input {
    flex: 1;
    padding: 10px 15px;
    border: none;
    outline: none;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    font-family: 'Vazir', sans-serif;
    height: 40px;
    border-radius: 0 10px 10px 0;
}

header .search button {
    flex: none;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 10px 0 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    color: white;
}

header .search button:hover {
    background: linear-gradient(45deg, var(--secondary), var(--primary));
}

header .search button svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

@media (max-width: 767px) {
    header {
        flex-direction: column;
        align-items: stretch;
        flex-wrap: wrap;
    }
    header .logo,
    header .logo {
        justify-content: center;
        margin-bottom: 10px;
    }
    header .logo-texts {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

main {
    padding: 30px 5%;
    max-width: 1400px;
    margin: 0 auto;
    flex: 1;
    width: 100%;
}

main h1 {
    margin-bottom: 5px;
    text-align: center;
    font-size: 2.2rem;
    color: var(--primary);
    position: relative;
    padding-bottom: 10px;
}
main h4{
    text-align: center;
    margin-bottom: 20px;
}
main h1:after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    transform: translateX(50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
}

nav.console-filters {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.console-box {
    flex: 0 0 180px;
    padding: 15px 0;
    text-align: center;
    border-radius: 12px;
    color: white;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 200px;
}

.console-box:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: -1;
}

.console-box:hover:before {
    background: rgba(0, 0, 0, 0.5);
}

.console-box .console-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    opacity: 0.8;
}

.console-box .console-text {
    padding: 10px;
    background: rgba(0, 0, 0, 0.7);
    width: 100%;
    border-radius: 0 0 12px 12px;
}

.console-box.box-blue {
    background: linear-gradient(135deg, #2466e1, #1e3c72);
}

.console-box.box-red {
    background: linear-gradient(135deg, #e12c2c, #8b0000);
}

.console-box.box-green {
    background: linear-gradient(135deg, #2aa84d, #1e824c);
}

.console-box:focus,
.console-box.active {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.installation-section {
    background: var(--price-card-bg);
    border-radius: 15px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: none;
}

.installation-section h2 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}



.price-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-top: 4px solid var(--primary);
    width : 100%;
}

.price-card.ps4 {
    border-top-color: #2466e1;
}

.price-card.ps5 {
    border-top-color: #e12c2c;
}

.price-card h3 {
    text-align: center;
    color: var(--dark);
    margin-bottom: 20px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.price-card h3 i {
    font-size: 1.8rem;
}

.price-card .price-option {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #ddd;
}

.price-card .price-option:last-child {
    border-bottom: none;
}

.price-card .price-option .price {
    font-weight: bold;
    color: var(--primary);
    font-size: 1.2rem;
    margin-top: 5px;
}

.genre-filters {
    display: block;
    margin: 20px 0;
    padding: 20px;
    background: var(--price-card-bg);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.genre-filters h2 {
    color: var(--primary);
    margin-bottom: 15px;
    text-align: center;
}

.genre-tags {
    display: flex ;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: flex-start;
    flex-direction: row;
    align-content: center;
}

.genre-tag {
    background: var(--primary);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.genre-tag:hover,
.genre-tag.active {
    background: var(--secondary);
    transform: translateY(-2px);
}

.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.product-card {
    background: var(--card-bg);
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: all 0.3s;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.product-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    /*object-fit: cover;*/
    object-fit: fill;
    position: relative;
    display: block;
}

a {
    text-decoration: none;
    color: white;
}

.product-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    color: white;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 500;
    text-align: center;
    transform: translateY(100%);
    transition: transform 0.3s;
}

.product-card:hover .product-overlay {
    transform: translateY(0);
}

.product-platforms {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    user-select: none;
    backdrop-filter: blur(2px);
}

.product-card:hover .product-platforms {
    background: rgba(0, 0, 0, 0.9);
}

.product-size {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    user-select: none;
    backdrop-filter: blur(2px);
}

.product-name {
    padding: 10px;
    direction: ltr;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-dark);
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    transition: color 0.3s;
}

.product-card:hover .product-name {
    color: var(--primary);
}

footer {
    background: var(--footer-bg);
    color: white;
    padding: 30px 5%;
    margin-top: 50px;
    text-align: center;
    font-size: 15px;
    user-select: none;
    position: relative;
}

footer:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
}

footer p {
    margin: 10px 0;
    line-height: 1.6;
}

footer a {
    color: #82c7ff;
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 600;
}

footer a:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* استایل‌های صفحه دوم */
.game-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
    flex: 1;
}

.game-header {
    background-color: var(--header-bg);
    color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.game-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(106, 27, 154, 0.7), rgba(49, 27, 146, 0.7));
    z-index: 1;
}

.game-header-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 30px;
}

.game-cover {
    flex: 0 0 300px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.game-cover img {
    width: 100%;
    height: auto;
    display: block;
}

.game-info {
    flex: 1;
    min-width: 300px;
}

.game-title {
    font-size: 2rem;
    margin-bottom: 15px;
    color: #fff;
}

.game-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.meta-item {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.meta-item i {
    color: var(--secondary);
}

.game-description {
    margin-bottom: 20px;
    color: #eee;
}

.game-content {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.main-content {
    flex: 1;
    min-width: 300px;
}

.sidebar {
    flex: 0 0 300px;
}

.section {
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--primary);
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin-bottom: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.game-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.gallery-item {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s;
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-item img {
    width: 100%;
    height: 188.9px;
    display: block;
}

/* ریسپانسیو */


@media (max-width: 480px) {
    .console-box {
        flex: 1 1 100%;
    }

    .products {
        grid-template-columns: 1fr;
    }

    /* تنظیمات صفحه دوم برای دستگاه‌های خیلی کوچک */
    .game-title {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .game-description p {
        font-size: 0.9rem;
    }

    .game-meta {
        gap: 8px;
    }

    .meta-item {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
}


.products {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

@media (min-width: 576px) {
    .products {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media (min-width: 768px) {
    .products {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
}

@media (min-width: 1200px) {
    .products {
        grid-template-columns: repeat(6, 1fr);
    }
}

.product-card {
    background: #fff;
    border: 1px solid #ddd;
    padding: 5px;
    text-align: center;
}

/* مخفی اولیه در CSS */
#modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: none;        /* نمایش نداشته باشد تا با JS باز و بسته شود */
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal {
    background: #fff;
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.modal h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-family: 'Vazir', sans-serif;
}

.options {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.option {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #333;
    width: 120px;
}

.option-img {
    width: 120px;
    height: 120px;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    margin-bottom: 10px;
}

.option-text {
    font-family: 'Vazir', sans-serif;
    font-size: 1rem;
}

.sort_btn{
    color:white;
    border-radius: 5px;
    margin-top:5px;
    display:block;
    text-align: center;
    background-color: var(--primary);
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;

}
.add_cart{
    width: 100%;
    font-family: 'Vazir', serif;
    padding: 10px;
    border-radius: 10px;
    font-size: large;
    border: var(--secondary);
    background-color: #4f3285;
    color: white;
    margin-bottom: 10px;
    cursor: pointer;
}
.add_cart2 {
    width: 100%;
    font-family: 'Vazir', serif;
    padding: 0px;
    border-radius: 0 0 10px 10px;
    font-size: x-large;
    border: var(--secondary);
    background-color: #4f3285;
    color: white;
    margin-bottom: 3px;
    cursor: pointer;
}
.cart {
    position: fixed;
    left: 15px;
    bottom: 15px;
    background-color: var(--primary);
    color: white;
    border-radius: 30px;
    display: flex;
    align-items: center;
    padding: 0 15px;
    height: 50px;
    font-size: 14px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 9999;
    text-decoration: none;
    gap: 10px;
    font-weight: 600;
}

.cart-count {
    background-color: #dc3545; /* قرمز برای تعداد */
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.cart-text {
    user-select: none;
}
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    overflow: hidden; /* جلوگیری از اسکرول صفحه پشت مدال */
}

.modal {
    background: white;
    border-radius: 8px;
    padding: 0;
    width: 400px;
    max-width: 85%;
    height: 75%;
    position: relative;
    animation: fadeIn 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    font-size: 18px;
    padding: 5px;
    background: var(--primary);
    color: white;
    border-radius: 8px 8px 0 0;
    font-family: 'Vazir', serif;
    text-align: center;
}
.end_list {
    font-size: 14px;
    margin-bottom: 10px;
    padding: 5px;
    background: var(--primary);
    color: white;
    border-radius: 0;
    font-family: 'Vazir', serif;
    text-align: center;
}

.modal-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px;
}

.modal-footer {
    font-size: 18px;
    padding: 10px;
    background: #850202;
    color: white;
    border-radius: 0 0 8px 8px;
    width: 100%;
    font-family: 'Vazir', serif;
    cursor: pointer;
    text-align: center;
}

.game-item {
    display: flex;
    align-items: center;
    background: #fbe1f8;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    direction: ltr;
}

.game-item img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    margin-right: 10px;
}

.game-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-family: 'Vazir', serif;
    margin-right: 10px;
}

.game-info .title {
    font-weight: bold;
    font-size: 16px;
    direction: rtl;
}

.game-info .size {
    font-size: 14px;
    color: #666;
    direction: rtl;
}

.remove_game {
    border: none;
    background: #850202;
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    border-radius: 0 8px 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 0 10px;
    font-family: 'Vazir', sans-serif;
    cursor: pointer;
}
