html, body {
    min-height: 100vh;
    height: 100%;
}

body {
    background: var(--bg-page);
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

main {
    flex: 1 0 auto;
    min-height: calc(100vh - 200px);
}

footer {
    flex-shrink: 0;
    margin-top: auto;
}

.btn-1 {
    background-color: var(--selected-background);
    color: var(--text-primary);
}

.btn-custom {
    background-color: var(--secondary-color);
    color: var(--secondary-color);
}

.btn-custom:hover {
    opacity: 0.5;
}

.main-color {
    background: var(--secondary-color);
}

.our-navbar {
    background: var(--bg-nav) !important;
    padding: 0;
    height: 48px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

@media (min-width: 640px) {
    .our-navbar { height: 56px; }
}

.navbar-sticky {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

body.navbar-sticky-active { padding-top: 48px; }

@media (min-width: 640px) {
    body.navbar-sticky-active { padding-top: 56px; }
}

.our-navbar .logo { height: 45px; width: auto; }
.our-navbar .btn-icon { height: 30px; width: auto; cursor: pointer; }

.page-title .title {
    font-size: 18px;
    font-family: 'Righteous', serif;
    line-height: 18px;
    color: var(--text-color);
}

.page-title .des {
    font-size: 12px;
    font-family: 'Righteous', serif;
    line-height: 12px;
    color: var(--text-des-color);
}

.page-title .title {
    color: var(--primary-color);
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.page-title .des {
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 500;
    margin-top: 2px;
}

.swiper {
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

.swiper-slide {
    text-align: center;
    font-size: 18px;
    background: var(--white-color);
    display: flex;
    justify-content: center;
    align-items: center;
}

.swiper-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-color,
.product-color-header {
    background-color: var(--bg-card);
}

.selected {
    background: var(--selected-background) !important;
}

.selected p {
    color: var(--selected-background-p) !important;
}

.product button p {
    margin-top: unset;
    margin-bottom: unset;
}

button.disable {
    cursor: not-allowed !important;
    opacity: 0.5;
}

.box-error {
    border: 3px solid var(--color-danger) !important;
}

.card-custom {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    background: var(--card-bg);
    border: 2px solid var(--card-border-accent);
    transition: opacity 0.2s, border-color 0.2s;
    overflow: visible;
    color: var(--text-primary);
    opacity: 0.85;
}

.card-custom.selected,
.card-custom.selected:focus,
.card-custom.selected:active {
    background: var(--card-selected-bg) !important;
    border: 2px solid var(--card-border) !important;
    color: var(--card-selected-text) !important;
    opacity: 1;
}

.card-custom.selected .title_dm,
.card-custom.selected .title_price {
    color: var(--card-selected-text) !important;
    text-shadow: none;
}

.card-custom .title_dm,
.card-custom .title_price {
    color: var(--text-primary) !important;
    font-weight: bold;
}

.card-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    opacity: 1;
    will-change: transform;
}

.card-custom img {
    max-width: 100%;
    height: auto;
    margin-bottom: 8px;
}

.card-custom .title_price {
    font-weight: bold;
    color: var(--card-color);
    margin-bottom: 4px;
}

.card-custom .title_dm {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.2;
}

.card-custom .badge-off {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--color-danger);
    color: var(--banner-text);
    font-size: 0.75rem;
    font-weight: bold;
    padding: 3px 6px;
    border-radius: 10px;
    z-index: 20;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    min-width: 20px;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
}

.product {
    margin-bottom: 15px;
}

.products button {
    border: 1px solid var(--card-custom-product-border);
    min-height: auto;
    padding: 1px !important;
}

.wpr_payment_option {
    margin-bottom: 20px;
    margin-top: 20px;
    padding: 10px;
}

.wpr_payment_option .item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    padding: 20px 15px;
    border: 1px solid var(--paymentMethod-border);
    background-color: var(--paymentMethod-background);
    border-radius: 5px;
}

.wpr_payment_option .item .item-input {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    display: flex;
    gap: 5px;
    width: 50px;
    height: 50px;
    background: var(--payment-icon-bg);
    border-radius: 5px;
}

.wpr_payment_option .item .item-dec {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wpr_t_c {
    padding: 10px;
}

.payment_option_radio {
    display: none;
}

.bg-method {
    background-color: var(--paymentMethod-background);
    padding: 0.7rem;
    border-radius: 6px;
    border: 1px solid var(--paymentMethod-border);
}

.payment-receipt,
.payment-receipt-notfound {
    margin: 50px auto;
    padding: 20px;
    background: var(--white-color);
    border-radius: 10px;
    max-width: 500px;
    min-height: 400px;
}

.payment-receipt .footer,
.payment-receipt .header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: 'Righteous', serif;
    gap: 10px;
}

.btn-inv {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: 'Righteous', serif;
    gap: 10px;
}

.payment-receipt .footer .btn { background: var(--receipt-btn-bg); }

.payment-receipt-notfound {
    display: flex;
    justify-content: center;
    align-items: center;
}

.cp-footer {
    padding: 10px;
    justify-content: center;
    width: 100%;
    background-color: var(--cp-footer-bg);
    border-top: 1px solid var(--cp-footer-border);
}

.payment-accepted {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    font-weight: bold;
}

.payment-accepted img {
    width: 50px;
    border-radius: 5px;
}

.footer {
    background: var(--section-bg);
    width: 100%;
    margin-top: auto;
}

.badge {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: var(--card-color);
    color: var(--white-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.product-game {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 12px 8px 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    width: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-game img {
    object-fit: contain;
    margin: 0 auto;
    display: block;
}

.product-game:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.10);
    will-change: transform;
}

.product-game:hover img {
    filter: brightness(1.03);
}

.product-game a {
    text-decoration: none;
    display: block;
}

.category-name {
    font-size: 1rem;
    font-weight: 500;
    padding: 10px 2px;
    background: var(--category-label-bg) !important;
    color: var(--category-label-text) !important;
    margin-top: auto;
}

.restock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.60);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.product-game.restock .restock-overlay { opacity: 1; }

.restock-text {
    position: absolute;
    top: 20px;
    right: -35px;
    background: var(--color-danger);
    color: var(--banner-text);
    font-size: 0.9rem;
    font-weight: bold;
    text-align: center;
    padding: 8px 40px;
    transform: rotate(45deg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 1;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.product-game.restock {
    cursor: not-allowed;
    position: relative;
}

.product-game.restock:hover {
    transform: none;
    box-shadow: none;
}

.product-game.restock img {
    filter: grayscale(100%);
    opacity: 0.7;
}

.product-game.restock .category-name,
.product-game.restock:hover .category-name {
    background: var(--disabled-card-bg);
    color: var(--disabled-card-text);
}

.disabled-link {
    text-decoration: none;
    display: block;
    cursor: not-allowed;
}

.disabled-link img,
.disabled-link .category-name {
    pointer-events: none;
}

.sticky-payment,
.sticky-payment-sm {
    position: sticky;
    bottom: 0;
    width: 100%;
    z-index: 999;
    background-color: var(--sticky-bar-bg);
    padding: 10px;
    box-shadow: 0 -2px 8px var(--sticky-bar-shadow);
}

@media (min-width: 992px) {
    .sticky-payment-sm { visibility: hidden; }
}

.chat-button {
    position: fixed;
    bottom: 65px;
    right: 15px;
    background-color: var(--chat-btn-bg);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1000;
    transition: transform 0.2s ease, background-color 0.2s ease;
    border: none;
    padding: 0;
}

.chat-button:hover {
    background-color: var(--chat-btn-hover-bg);
    transform: scale(1.1);
}

.chat-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    padding: 8px;
    display: block;
}

@media (max-width: 768px) {
    .chat-button { width: 50px; height: 50px; }
    .chat-icon { width: 100%; height: auto; }
}

.custom-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--banner-center-bg);
    width: 100%;
    min-height: 60px;
    margin: 0 0 24px;
    position: relative;
    z-index: 1;
    border-radius: 6px;
}

.custom-banner-left,
.custom-banner-right {
    width: 100%;
    height: 48px;
    background: var(--banner-side-color);
    clip-path: polygon(0 0, 100% 0, 95% 100%, 0% 100%);
}

.custom-banner-right { transform: scaleX(-1); }

.custom-banner-center {
    background: var(--banner-center-bg);
    padding: 0 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 48px;
}

.custom-banner-title {
    color: var(--banner-text);
    font-size: 2rem;
    font-weight: bold;
    letter-spacing: 2px;
    font-family: 'Noto Sans Khmer', 'Poppins', sans-serif;
    white-space: nowrap;
}

.custom-banner-des {
    color: var(--banner-text);
    font-size: 1rem;
    font-weight: 400;
    margin-top: 2px;
    opacity: 0.85;
    letter-spacing: 1px;
}

.image-layout-main {
    background: var(--main-bg);
    min-height: 100vh;
    padding: 2rem 0;
}

.image-layout-container {
    background: var(--nav-bg);
    border-radius: 18px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
    padding: 2rem 0;
    width: 100%;
}

.image-layout-header {
    background: var(--section-bg);
    border-radius: 12px 12px 0 0;
    padding: 1.5rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.image-layout-title {
    color: var(--highlight-blue);
    font-size: 2.5rem;
    font-weight: bold;
    letter-spacing: 2px;
}

.image-layout-banner {
    margin-top: 1rem;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
}

.image-layout-categories {
    background: var(--section-bg);
    border-radius: 0 0 12px 12px;
    padding: 2rem 1rem 1rem;
    margin-top: -1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
}

.image-layout-category-card {
    background: var(--nav-bg);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    width: 180px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.image-layout-category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.image-layout-category-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 12px 12px 0 0;
}

.image-layout-category-label {
    background: var(--highlight-blue);
    color: var(--banner-text);
    font-weight: 600;
    text-align: center;
    padding: 0.7rem 0.5rem;
    border-radius: 0 0 12px 12px;
    font-size: 1.1rem;
    letter-spacing: 1px;
    margin-top: auto;
    width: 100%;
}

.image-layout-category-card.restock .image-layout-category-label {
    background: var(--restock-label-bg);
    color: var(--restock-label-text);
}

.image-layout-category-card.restock {
    opacity: 0.6;
    filter: grayscale(1);
    pointer-events: none;
}

@media (max-width: 767px) {
    .hidden-mobile { display: none; }
    .title_dm { font-size: 11px; }
}

@media (max-width: 600px) {
    .product-game {
        min-height: 160px;
        padding: 8px 4px 0;
    }
    .category-name {
        font-size: 0.85rem;
        padding: 8px 2px;
    }
    .image-layout-container { padding: 1rem 0; }
    .image-layout-category-card {
        width: 100%;
        min-width: 140px;
    }
    .custom-banner-left,
    .custom-banner-right {
        height: 32px;
        width: 100%;
    }
    .custom-banner-center { padding: 0 8px; }
    .custom-banner-title { font-size: 1.1rem; }
    .custom-banner-des { font-size: 0.85rem; white-space: nowrap; }
}
