/* Biến màu sắc */
:root {
    --page-bg-color: #140C0C;
    --card-bg-color: #2A1212;
    --text-main-color: #FFF1E8;
    --primary-color: #C61F1F;
    --secondary-color: #E53030;
    --button-gradient-start: #FFB04A;
    --button-gradient-end: #D86A14;
    --border-color: #6A1E1E;
    --gold-color: #F3C54D;
    --deep-red-color: #7E0D0D;
}

.page-index-popular-games {
    background-color: var(--page-bg-color);
    color: var(--text-main-color);
    font-family: Arial, sans-serif;
    line-height: 1.6;
    padding-bottom: 40px; /* Thêm padding dưới để tránh footer bị dính liền */
}

.page-index-popular-games__hero-section {
    position: relative;
    padding-top: 10px; /* Small top padding, body handles header offset */
    padding-bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.page-index-popular-games__hero-image-wrapper {
    width: 100%;
    max-height: 700px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.page-index-popular-games__hero-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

.page-index-popular-games__hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 30px auto 0;
    padding: 0 15px;
}

.page-index-popular-games__main-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    color: var(--gold-color);
    margin-bottom: 20px;
    line-height: 1.2;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.page-index-popular-games__intro-text {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-main-color);
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.page-index-popular-games__cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    box-sizing: border-box;
}

.page-index-popular-games__btn-primary,
.page-index-popular-games__btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
    max-width: 100%;
    white-space: normal;
    word-wrap: break-word;
    text-align: center;
}

.page-index-popular-games__btn-primary {
    background: linear-gradient(180deg, var(--button-gradient-start) 0%, var(--button-gradient-end) 100%);
    color: #ffffff;
    border: 2px solid var(--button-gradient-start);
}

.page-index-popular-games__btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 176, 74, 0.4);
}

.page-index-popular-games__btn-secondary {
    background: var(--card-bg-color);
    color: var(--gold-color);
    border: 2px solid var(--gold-color);
}

.page-index-popular-games__btn-secondary:hover {
    background: var(--gold-color);
    color: var(--card-bg-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(243, 197, 77, 0.2);
}

.page-index-popular-games__section {
    padding: 60px 0;
}

.page-index-popular-games__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-index-popular-games__container--flex {
    display: flex;
    align-items: center;
    gap: 40px;
}

.page-index-popular-games__container--center {
    text-align: center;
}

.page-index-popular-games__section-title {
    font-size: clamp(2rem, 4vw, 2.8rem);
    color: var(--gold-color);
    text-align: center;
    margin-bottom: 25px;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
}

.page-index-popular-games__section-description {
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    color: var(--text-main-color);
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px;
}

.page-index-popular-games__features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.page-index-popular-games__feature-item {
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-index-popular-games__feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.page-index-popular-games__feature-title {
    font-size: 1.5rem;
    color: var(--gold-color);
    margin-bottom: 15px;
}

.page-index-popular-games__feature-item p {
    font-size: 1rem;
    color: var(--text-main-color);
}

.page-index-popular-games__game-categories .page-index-popular-games__section-description {
    margin-bottom: 40px;
}

.page-index-popular-games__category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.page-index-popular-games__category-card {
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-main-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.page-index-popular-games__category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.page-index-popular-games__category-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.page-index-popular-games__category-card h3 {
    font-size: 1.4rem;
    color: var(--gold-color);
    padding: 15px 20px 10px;
    margin: 0;
}

.page-index-popular-games__category-card p {
    font-size: 0.95rem;
    padding: 0 20px 20px;
    margin: 0;
    flex-grow: 1;
}

.page-index-popular-games__products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.page-index-popular-games__product-card {
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-main-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.page-index-popular-games__product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.page-index-popular-games__product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.page-index-popular-games__product-title {
    font-size: 1.3rem;
    color: var(--gold-color);
    padding: 15px 20px 10px;
    margin: 0;
}

.page-index-popular-games__product-description {
    font-size: 0.9rem;
    padding: 0 20px 20px;
    margin: 0;
    flex-grow: 1;
}

.page-index-popular-games__promotions-cta .page-index-popular-games__container--flex {
    flex-direction: row;
    align-items: center;
}

.page-index-popular-games__promo-content {
    flex: 1;
    text-align: left;
}

.page-index-popular-games__promo-content .page-index-popular-games__section-title,
.page-index-popular-games__promo-content .page-index-popular-games__section-description {
    text-align: left;
    margin-left: 0;
    margin-right: 0;
}

.page-index-popular-games__promo-image-wrapper {
    flex-shrink: 0;
    width: 50%;
    max-width: 600px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.page-index-popular-games__promo-image {
    width: 100%;
    height: auto;
    display: block;
}

.page-index-popular-games__how-to-start .page-index-popular-games__section-description {
    margin-bottom: 40px;
}

.page-index-popular-games__steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.page-index-popular-games__step-item {
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    padding-top: 60px;
}

.page-index-popular-games__step-number {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(180deg, var(--button-gradient-start) 0%, var(--button-gradient-end) 100%);
    color: #ffffff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: bold;
    border: 3px solid var(--page-bg-color);
    box-shadow: 0 0 0 5px var(--gold-color);
}

.page-index-popular-games__step-title {
    font-size: 1.5rem;
    color: var(--gold-color);
    margin-bottom: 15px;
}

.page-index-popular-games__step-item p {
    font-size: 1rem;
    color: var(--text-main-color);
}

.page-index-popular-games__cta-center {
    text-align: center;
    margin-top: 50px;
}

.page-index-popular-games__faq-section .page-index-popular-games__section-description {
    margin-bottom: 40px;
}

details.page-index-popular-games__faq-item {
    margin-bottom: 15px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    background: var(--card-bg-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

details.page-index-popular-games__faq-item summary.page-index-popular-games__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 25px;
    cursor: pointer;
    user-select: none;
    list-style: none;
    transition: background-color 0.3s ease;
}

details.page-index-popular-games__faq-item summary.page-index-popular-games__faq-question::-webkit-details-marker {
    display: none;
}

details.page-index-popular-games__faq-item summary.page-index-popular-games__faq-question:hover {
    background: rgba(var(--primary-color), 0.1);
}

.page-index-popular-games__faq-qtext {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.5;
    text-align: left;
    color: var(--gold-color);
}

.page-index-popular-games__faq-toggle {
    font-size: 24px;
    font-weight: bold;
    color: var(--gold-color);
    flex-shrink: 0;
    margin-left: 15px;
    width: 28px;
    text-align: center;
}

details.page-index-popular-games__faq-item .page-index-popular-games__faq-answer {
    padding: 0 25px 20px;
    background: rgba(var(--primary-color), 0.05);
    border-radius: 0 0 12px 12px;
    font-size: 1rem;
    color: var(--text-main-color);
}

.page-index-popular-games__faq-answer p {
    margin-top: 10px;
    margin-bottom: 0;
}

.page-index-popular-games__responsible-gambling .page-index-popular-games__container--flex {
    flex-direction: row;
    align-items: center;
}

.page-index-popular-games__rg-image-wrapper {
    flex-shrink: 0;
    width: 50%;
    max-width: 600px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.page-index-popular-games__rg-image {
    width: 100%;
    height: auto;
    display: block;
}

.page-index-popular-games__rg-content {
    flex: 1;
    text-align: left;
}

.page-index-popular-games__rg-content .page-index-popular-games__section-title,
.page-index-popular-games__rg-content .page-index-popular-games__section-description {
    text-align: left;
    margin-left: 0;
    margin-right: 0;
}

.page-index-popular-games__conclusion-cta .page-index-popular-games__cta-buttons {
    margin-top: 40px;
}

/* General image responsiveness for content area */
.page-index-popular-games img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Media Queries */
@media (max-width: 1024px) {
    .page-index-popular-games__container--flex {
        flex-direction: column;
        text-align: center;
    }

    .page-index-popular-games__promo-content,
    .page-index-popular-games__rg-content {
        text-align: center;
    }

    .page-index-popular-games__promo-content .page-index-popular-games__section-title,
    .page-index-popular-games__promo-content .page-index-popular-games__section-description,
    .page-index-popular-games__rg-content .page-index-popular-games__section-title,
    .page-index-popular-games__rg-content .page-index-popular-games__section-description {
        text-align: center;
    }

    .page-index-popular-games__promo-image-wrapper,
    .page-index-popular-games__rg-image-wrapper {
        width: 80%;
        max-width: 700px;
        margin-top: 30px;
    }
}

@media (max-width: 849px) {
    .page-index-popular-games__hero-image {
        object-fit: contain !important;
        aspect-ratio: unset !important;
    }
}

@media (max-width: 768px) {
    .page-index-popular-games {
        font-size: 16px;
        line-height: 1.6;
    }

    .page-index-popular-games__hero-section {
        padding-top: 10px !important;
        padding-bottom: 30px;
    }

    .page-index-popular-games__main-title {
        font-size: clamp(2rem, 8vw, 2.8rem);
    }

    .page-index-popular-games__intro-text {
        font-size: clamp(0.9rem, 3vw, 1.1rem);
    }

    .page-index-popular-games__cta-buttons {
        flex-direction: column;
        gap: 15px;
        padding: 0 15px;
    }

    .page-index-popular-games__btn-primary,
    .page-index-popular-games__btn-secondary {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        padding: 12px 20px;
        font-size: 1rem;
    }

    .page-index-popular-games__section {
        padding: 40px 0;
    }

    .page-index-popular-games__container {
        padding: 0 15px;
    }

    .page-index-popular-games__section-title {
        font-size: clamp(1.8rem, 7vw, 2.5rem);
        margin-bottom: 20px;
    }

    .page-index-popular-games__section-description {
        font-size: clamp(0.9rem, 3.5vw, 1rem);
        margin-bottom: 30px;
    }

    .page-index-popular-games__features-grid,
    .page-index-popular-games__category-grid,
    .page-index-popular-games__products-grid,
    .page-index-popular-games__steps-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .page-index-popular-games__category-image,
    .page-index-popular-games__product-image {
        height: 180px;
    }

    .page-index-popular-games__category-card h3,
    .page-index-popular-games__product-title {
        font-size: 1.2rem;
        padding: 12px 15px 8px;
    }

    .page-index-popular-games__category-card p,
    .page-index-popular-games__product-description {
        font-size: 0.85rem;
        padding: 0 15px 15px;
    }

    .page-index-popular-games__promo-image-wrapper,
    .page-index-popular-games__rg-image-wrapper {
        width: 100%;
        margin-top: 20px;
    }

    .page-index-popular-games__step-item {
        padding: 50px 20px 30px;
    }

    .page-index-popular-games__step-number {
        width: 45px;
        height: 45px;
        font-size: 1.6rem;
        top: -22px;
    }

    details.page-index-popular-games__faq-item summary.page-index-popular-games__faq-question {
        padding: 15px 18px;
    }

    .page-index-popular-games__faq-qtext {
        font-size: 1rem;
    }

    .page-index-popular-games__faq-toggle {
        font-size: 20px;
        width: 24px;
        margin-left: 10px;
    }

    details.page-index-popular-games__faq-item .page-index-popular-games__faq-answer {
        padding: 0 18px 15px;
    }

    .page-index-popular-games img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }

    .page-index-popular-games__section,
    .page-index-popular-games__card,
    .page-index-popular-games__container {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Specific override for products grid to ensure 2 columns on mobile */
    .page-index-popular-games__products-grid {
        grid-template-columns: repeat(auto-fit, minmax(calc(50% - 15px), 1fr)); /* Two columns, accounting for gap */
        overflow-x: hidden; /* Ensure no horizontal scroll */
    }
    /* If it results in 3 rows, it's ok, but must be 2 columns */
    .page-index-popular-games__category-grid {
        grid-template-columns: repeat(auto-fit, minmax(calc(50% - 15px), 1fr));
    }
    .page-index-popular-games__features-grid {
        grid-template-columns: 1fr;
    }
}