/* =========================================================
   APP CSS (merged from uploaded page styles)
   ========================================================= */

/* ===== Base / Shared ===== */
* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    font-family: "Kanit", sans-serif;
    background: #eaeaea;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: url("/assets/backgrounds/bg-main.jpg");
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.nav-spacer {
    height: 72px;
    width: 100%;
}

.alert {
    border-radius: 12px;
}

/* =========================================================
   HOME
   ========================================================= */
.page-home .main-background {
    width: min(1270px, 100%);
    box-sizing: border-box;
    background: var(--theme-surface);
    border-radius: 20px;
    padding: 20px 24px 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.page-home #heroCarousel {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
}

.page-home #heroCarousel .carousel-inner {
    background: var(--theme-surface);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: 5px;
}

.page-home #heroCarousel .carousel-item img {
    aspect-ratio: auto !important;
    object-fit: contain !important;
}

.page-home .banner-img {
    display: block;
    width: auto !important;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    margin: 0;
    border-radius: 12px;
    image-rendering: auto;
}

.page-home .announce-wrap {
    width: 100%;
    max-width: 1250px;
    box-sizing: border-box;
}

.page-home .announce-bar {
    background: var(--theme-surface);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.08);
    flex-wrap: nowrap;
    overflow: hidden;
}

.page-home .announce-badge {
    background: linear-gradient(135deg, var(--theme-announcement-badge-start) 0%, var(--theme-announcement-badge-end) 100%);
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    box-shadow: 0 2px 6px rgba(245, 167, 66, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
}

.page-home .announce-badge i {
    font-size: 16px;
}

.page-home .announce-content {
    color: var(--theme-muted);
    font-size: 15px;
    overflow: hidden;
    min-width: 0;
    flex: 1;
}

.page-home .announce-content marquee {
    color: var(--theme-muted);
}

.page-home .category-section {
    width: 100%;
    max-width: 1250px;
    box-sizing: border-box;
}

.page-home .category-title {
    font-size: 20px;
    color: #333;
}

.page-home .btn-more {
    color: var(--theme-announcement-badge-end);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.page-home .btn-more:hover {
    color: var(--theme-announcement-badge-start);
    transform: translateX(3px);
}

.page-home {
    --cat-h: 200px;
}

.page-home .category-card-img {
    position: relative;
    width: 100%;
    height: var(--cat-h);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
    transition: .3s ease;
    cursor: pointer;
    background: var(--theme-surface);
    display: flex;
    justify-content: center;
    align-items: center;
}

.page-home .category-card-img:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.page-home .category-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform .3s ease;
}

.page-home .category-card-img:hover img {
    transform: scale(1.03);
}

.page-home .cat-label {
    position: absolute;
    bottom: 0;
    left: 0;
    padding: 5px 12px 7px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: "Kanit", sans-serif;
    border-radius: 0 8px 0 12px;
    line-height: 1.4;
    pointer-events: none;
    letter-spacing: .3px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: transform .3s ease, opacity .3s ease;
}

.page-home .category-card-img:hover .cat-label {
    transform: translateX(-110%);
    opacity: 0;
}

/* =========================================================
   HOME + CATEGORY shared product cards
   ========================================================= */
.page-home .product-grid,
.page-category .product-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    width: 100%;
}

.page-home .product-card,
.page-category .product-card {
    background: var(--theme-surface);
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .08);
    border: 1px solid rgba(0, 0, 0, .06);
    overflow: hidden;
    transition: .25s ease;
}

.page-home .product-card:hover,
.page-category .product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .12);
}

.page-home .pc-thumb,
.page-category .pc-thumb {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--theme-surface-alt);
    position: relative;
    overflow: hidden;
}

.page-home .pc-thumb img,
.page-category .pc-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
    padding: 5px;
}

.page-home .pc-body,
.page-category .pc-body {
    padding: 16px 16px 18px;
}

.page-home .pc-badge,
.page-category .pc-badge {
    display: block;
    background: var(--theme-accent-bg);
    color: var(--theme-accent-dark);
    border: 1.5px solid var(--theme-accent-border);
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 12.5px;
    margin: 0 auto 10px;
    width: fit-content;
    box-shadow: 0 2px 6px rgba(245, 163, 65, .15);
}

.page-home .pc-title,
.page-category .pc-title {
    font-size: 16px;
    line-height: 1.25;
    color: #222;
    margin: 6px 0 10px;
    min-height: 40px;
}

.page-home .pc-price,
.page-category .pc-price {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.page-home .pc-price-now,
.page-category .pc-price-now {
    font-weight: 700;
    color: var(--theme-accent);
}

.page-home .pc-price-old,
.page-category .pc-price-old {
    color: #b9b9b9;
    text-decoration: line-through;
    font-size: 13px;
}

.page-home .pc-currency,
.page-category .pc-currency {
    margin-left: auto;
    background: #fff3d6;
    color: var(--theme-accent-dark);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    border: 1px solid var(--theme-accent-border);
}

.page-home .pc-btn,
.page-home .pc-btn:link,
.page-home .pc-btn:visited,
.page-category .pc-btn,
.page-category .pc-btn:link,
.page-category .pc-btn:visited {
    display: block;
    text-decoration: none;
    width: 100%;
    border: 1.8px solid var(--theme-accent);
    background: var(--theme-surface);
    color: var(--theme-accent-dark);
    border-radius: 12px;
    padding: 10px 12px;
    font-weight: 600;
    text-align: center;
    transition: .2s ease;
    box-sizing: border-box;
}

.page-home .pc-btn:hover,
.page-home .pc-btn:focus,
.page-category .pc-btn:hover,
.page-category .pc-btn:focus {
    background: var(--theme-accent-bg);
    color: var(--theme-accent-dark);
    outline: none;
    box-shadow: none;
}

.page-home .product-card.is-out .pc-thumb img,
.page-category .product-card.is-out .pc-thumb img {
    filter: grayscale(100%);
    opacity: .7;
}

.page-home .product-card.is-out .pc-btn,
.page-category .product-card.is-out .pc-btn {
    pointer-events: none;
    opacity: .6;
}

.page-home .pc-thumb .pc-ribbon,
.page-category .pc-thumb .pc-ribbon {
    position: absolute;
    top: 10px;
    left: -40px;
    transform: rotate(-15deg);
    background: #9ca3af;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 48px;
    border-radius: 6px;
    letter-spacing: .5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}

/* =========================================================
   HOME stats / reveal
   ========================================================= */
.page-home .stats-section {
    width: 100%;
    max-width: 1250px;
    box-sizing: border-box;
}

.page-home .stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.page-home .stat-card {
    background: var(--theme-surface);
    border-radius: 16px;
    padding: 16px 22px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .08);
    border: 1px solid rgba(0, 0, 0, .06);
}

.page-home .stat-thumb {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(180deg, #f7f7f7, #f2f2f2);
}

.page-home .stat-thumb img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.page-home .stat-meta {
    line-height: 1.1;
    min-width: 0;
}

.page-home .stat-number {
    font-weight: 800;
    font-size: 26px;
    color: var(--theme-accent);
    letter-spacing: .2px;
}

.page-home .stat-unit {
    margin-left: 6px;
    color: var(--theme-accent);
    font-weight: 700;
}

.page-home .stat-sub {
    margin-top: 6px;
    color: var(--theme-muted);
    font-size: 14px;
}

.page-home .reveal,
.page-category .reveal {
    opacity: 0;
    transform: translate3d(0, 20px, 0);
    transition:
        opacity .6s ease,
        transform .6s ease;
    will-change: opacity, transform;
}

.page-home .reveal.is-visible,
.page-category .reveal.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.page-home .reveal[data-anim="fade-up"] {
    transform: translate3d(0, 24px, 0);
}

.page-home .reveal[data-anim="fade-down"] {
    transform: translate3d(0, -24px, 0);
}

.page-home .reveal[data-anim="fade-left"] {
    transform: translate3d(-24px, 0, 0);
}

.page-home .reveal[data-anim="fade-right"] {
    transform: translate3d(24px, 0, 0);
}

.page-home .reveal[data-anim="zoom-in"],
.page-category .reveal[data-anim="zoom-in"] {
    transform: scale(.94);
}

.page-home .reveal[data-anim="zoom-in"].is-visible,
.page-category .reveal[data-anim="zoom-in"].is-visible {
    transform: scale(1);
}

.page-home .reveal[data-delay="1"],
.page-category .reveal[data-delay="1"] {
    transition-delay: .06s;
}

.page-home .reveal[data-delay="2"],
.page-category .reveal[data-delay="2"] {
    transition-delay: .12s;
}

.page-home .reveal[data-delay="3"],
.page-category .reveal[data-delay="3"] {
    transition-delay: .18s;
}

.page-home .reveal[data-delay="4"],
.page-category .reveal[data-delay="4"] {
    transition-delay: .24s;
}

.page-home .reveal[data-delay="5"],
.page-category .reveal[data-delay="5"] {
    transition-delay: .30s;
}

/* =========================================================
   CATEGORY
   ========================================================= */
.page-category .main-background {
    width: min(1270px, 100%);
    box-sizing: border-box;
    background: var(--theme-surface);
    border-radius: 20px;
    padding: 20px 24px 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.page-category .cat-header {
    width: 100%;
    max-width: 1250px;
    box-sizing: border-box;
}

.page-category .cat-banner {
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--theme-surface);
    border-radius: 16px;
    overflow: hidden;
    margin-top: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .08);
    border: 1px solid rgba(0, 0, 0, .06);
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.page-category .cat-banner img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
}

.page-category .crumb {
    font-size: 14px;
    color: #888;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    line-height: 1.6;
}

.page-category .crumb a {
    color: var(--theme-accent);
    text-decoration: none;
}

.page-category .crumb a:hover {
    text-decoration: underline;
}

.page-category .category-section {
    width: 100%;
    max-width: 1250px;
    box-sizing: border-box;
}

.page-category .category-title {
    font-size: 18px;
    color: #333;
}

.page-category .btn-more {
    color: var(--theme-announcement-badge-end);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.page-category .btn-more:hover {
    color: var(--theme-announcement-badge-start);
}

.page-category .pagination-wrap {
    width: 100%;
    max-width: 1250px;
    box-sizing: border-box;
}

.page-category .pagination .page-link {
    color: var(--theme-accent);
    border-color: #fde8b8;
    font-family: "Kanit", sans-serif;
    font-weight: 500;
}

.page-category .pagination .page-item.active .page-link {
    background: var(--theme-accent);
    border-color: var(--theme-accent);
    color: #fff;
}

.page-category .pagination .page-link:hover {
    background: var(--theme-accent-bg);
    color: var(--theme-accent-dark);
    border-color: var(--theme-accent);
}

.page-category .pagination .page-item.disabled .page-link {
    color: #ccc;
    border-color: #f0f0f0;
}

/* =========================================================
   PRODUCT
   ========================================================= */
.page-product .main-background {
    width: min(1270px, 100%);
    box-sizing: border-box;
    min-height: 1000px;
    background: var(--theme-surface);
    border-radius: 20px;
    padding: 20px 24px 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.page-product .detail-wrap {
    width: 100%;
    max-width: 1150px;
    box-sizing: border-box;
    margin: 40px auto 0;
    padding: 0 8px;
}

.page-product .product-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: .35rem;
    line-height: 1.3;
}

.page-product .type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 600;
    border: 1.5px solid transparent;
}

.page-product .type-single {
    background: #eef6ff;
    color: #0b5ed7;
    border-color: #b6d4fe;
}

.page-product .type-pool {
    background: #f5f5ff;
    color: #5d3fd3;
    border-color: #cbc4ff;
}

.page-product .type-generate {
    background: #f0fff4;
    color: #1a7f4b;
    border-color: #a3e6c0;
}

.page-product .price-now {
    font-size: 26px;
    font-weight: 800;
    color: var(--theme-accent);
}

.page-product .price-old {
    color: #b9b9b9;
    text-decoration: line-through;
    margin-left: 8px;
    font-size: 16px;
}

.page-product .stock-badge {
    display: inline-block;
    background: var(--theme-accent-bg);
    color: var(--theme-accent-dark);
    border: 1.5px solid var(--theme-accent-border);
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 13px;
}

.page-product .stock-badge.out {
    background: #fdecec;
    color: #a12d2d;
    border-color: #f5c2c2;
}

.page-product .product-desc {
    color: #444;
    line-height: 1.7;
    margin-top: .75rem;
    margin-bottom: 1rem;
}

.page-product .gallery {
    background: var(--theme-surface-alt);
    border: 1px solid rgba(0, 0, 0, .06);
    border-radius: 16px;
    padding: 10px;
    overflow: hidden;
}

.page-product .gallery .carousel-item img {
    max-height: 480px;
    object-fit: contain;
    width: 100%;
    border-radius: 10px;
}

.page-product .thumbs {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.page-product .thumbs img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background: var(--theme-surface);
    border-radius: 10px;
    cursor: pointer;
    padding: 5px;
    transition: border-color .2s;
}

.page-product .thumbs img:hover,
.page-product .thumbs img.active {
    border-color: var(--theme-accent);
}

.page-product .buy-line {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.page-product .qty-box {
    width: 160px;
    flex: 0 0 160px;
}

.page-product .qty-box .form-control[readonly] {
    background-color: #f8f9fa;
    cursor: not-allowed;
    user-select: none;
}

.page-product .buy-btn {
    flex: 1 1 auto;
    width: auto !important;
    white-space: nowrap;
    margin: 0;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.8px solid var(--theme-accent);
    background: var(--theme-surface);
    color: var(--theme-accent-dark);
    border-radius: 12px;
    padding: 12px 16px;
    font-weight: 700;
    font-family: "Kanit", sans-serif;
    font-size: 15px;
    transition: background .2s;
    cursor: pointer;
}

.page-product .buy-btn:hover {
    background: var(--theme-accent-bg);
}

.page-product .buy-btn:disabled {
    filter: grayscale(0.3);
    opacity: .6;
    cursor: not-allowed;
}

.page-product #imgModal .btn-close {
    filter: invert(1);
    opacity: .9;
    z-index: 10;
}

/* related */
.page-product .related-section {
    width: 100%;
    max-width: 1150px;
    box-sizing: border-box;
    margin: 40px auto 0;
    padding: 0 8px;
}

.page-product .related-section .section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.page-product .related-section .section-title {
    font-size: 18px;
    font-weight: 700;
    color: #2b2f3a;
    margin: 0;
}

.page-product .related-section .section-title i {
    color: var(--theme-accent);
    margin-right: 8px;
}

.page-product .rel-nav {
    display: flex;
    gap: 8px;
}

.page-product .rel-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1.8px solid var(--theme-accent);
    background: var(--theme-surface);
    color: var(--theme-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .2s;
    font-size: 14px;
    flex-shrink: 0;
}

.page-product .rel-nav-btn:hover:not(:disabled) {
    background: var(--theme-accent);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(240, 161, 0, .25);
}

.page-product .rel-nav-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.page-product .rel-viewport {
    overflow: hidden;
    width: 100%;
}

.page-product .rel-track {
    display: flex;
    gap: 16px;
    transition: transform .38s cubic-bezier(.4, 0, .2, 1);
    will-change: transform;
}

.page-product .rel-card {
    flex: 0 0 calc((100% - 64px) / 5);
    background: var(--theme-surface);
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, .06);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .07);
    overflow: hidden;
    transition: transform .22s, box-shadow .22s;
    text-decoration: none;
    display: flex;
    flex-direction: column;
}

.page-product .rel-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .12);
}

.page-product .rel-card.is-out {
    opacity: .7;
}

.page-product .rel-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--theme-surface-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.page-product .rel-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
    transition: transform .25s;
}

.page-product .rel-card:hover .rel-thumb img {
    transform: scale(1.05);
}

.page-product .rel-card.is-out .rel-thumb img {
    filter: grayscale(100%);
}

.page-product .rel-ribbon {
    position: absolute;
    top: 8px;
    left: -32px;
    transform: rotate(-15deg);
    background: #9ca3af;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 40px;
    border-radius: 4px;
}

.page-product .rel-body {
    padding: 10px 12px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.page-product .rel-name {
    font-size: 13px;
    font-weight: 600;
    color: #222;
    line-height: 1.3;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.page-product .rel-price {
    font-size: 14px;
    font-weight: 800;
    color: var(--theme-accent);
}

/* =========================================================
   SHOP
   ========================================================= */
.page-shop .main-background {
    width: min(1270px, 100%);
    min-height: 1000px;
    background: var(--theme-surface);
    border-radius: 20px;
    padding: 24px 0 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.page-shop .shop-header {
    width: 100%;
    max-width: 1250px;
}

.page-shop .shop-title {
    font-size: 22px;
    color: #333;
}

.page-shop .search-wrap {
    max-width: 420px;
}

.page-shop .category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.page-shop {
    --cat-thumb-h: 120px;
}

.page-shop .category-card {
    background: var(--theme-surface);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, .06);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .08);
    transition: .25s ease;
    text-decoration: none;
    color: #222;
}

.page-shop .category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .12);
}

.page-shop .category-thumb {
    position: relative;
    width: 100%;
    height: var(--cat-thumb-h);
    background: var(--theme-surface-alt);
    overflow: hidden;
    display: block;
    border-bottom: 1px solid rgba(0, 0, 0, .05);
}

.page-shop .category-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.page-shop .category-body {
    padding: 14px 16px 16px;
}

.page-shop .category-name {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 6px;
}

.page-shop .category-meta {
    color: var(--theme-muted);
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-shop .category-meta .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--theme-accent);
    display: inline-block;
}

.page-shop .pagination-wrap {
    width: 100%;
    max-width: 1250px;
}

.page-shop .page-link {
    color: var(--theme-accent-dark);
    border-color: var(--theme-accent-border);
}

.page-shop .page-item.active .page-link {
    background: var(--theme-accent-bg);
    color: var(--theme-accent-dark);
    border-color: var(--theme-accent-border);
    font-weight: 700;
}

.page-shop .page-link:hover {
    background: var(--theme-accent-bg);
    color: var(--theme-accent-dark);
}

/* =========================================================
   PROFILE
   ========================================================= */
.page-profile {
    --profile-max-width: 1270px;
    --profile-inner-width: 1240px;
    --profile-bg: rgba(255, 255, 255, 0.92);
    --profile-card: var(--theme-surface);
    --profile-card-2: var(--theme-surface-alt);
    --profile-line: rgba(15, 23, 42, 0.06);
    --profile-text: var(--theme-text);
    --profile-text-soft: var(--theme-muted);
    --profile-accent: var(--theme-accent);
    --profile-accent-soft: var(--theme-accent-bg);
    --profile-accent-border: var(--theme-accent-border);
    --profile-primary: var(--theme-primary);
    --profile-primary-2: var(--theme-primary-2);
    --profile-success-bg: #ecfdf5;
    --profile-success-text: #15803d;
    --profile-admin-bg: #fff7ed;
    --profile-admin-text: #c2410c;
    --profile-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --profile-shadow-lg: 0 20px 60px rgba(15, 23, 42, 0.12);
    --profile-radius-xl: 24px;
    --profile-radius-lg: 18px;
    --profile-radius-md: 16px;
    --profile-radius-sm: 14px;
    color: var(--profile-text);
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.12)),
        url("/assets/backgrounds/bg-main.jpg");
}

.page-profile .profile-page {
    padding: 80px 12px 48px;
    width: 100%;
}

.page-profile .profile-shell {
    width: min(var(--profile-max-width), 100%);
    margin: 0 auto;
    background: var(--profile-bg);
    border-radius: var(--profile-radius-xl);
    padding: 26px 20px 60px;
}

.page-profile .profile-head {
    width: 100%;
    max-width: var(--profile-inner-width);
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.page-profile .profile-title-wrap h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--profile-text);
}

.page-profile .profile-title-wrap p {
    margin: 4px 0 0;
    color: var(--profile-text-soft);
    font-size: 14px;
}

.page-profile .profile-head-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-profile .btn-main,
.page-profile .btn-sub {
    border: 0;
    height: 44px;
    padding: 0 16px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: .2s ease;
    cursor: pointer;
}

.page-profile .btn-main {
    background: linear-gradient(135deg, var(--profile-primary), var(--profile-primary-2));
    color: #fff;
    box-shadow: 0 10px 20px rgba(37, 99, 235, .22);
}

.page-profile .btn-main:hover {
    transform: translateY(-1px);
    color: #fff;
}

.page-profile .btn-sub {
    background: var(--theme-surface);
    color: var(--profile-text);
    border: 1px solid var(--profile-line);
}

.page-profile .btn-sub:hover {
    background: var(--theme-surface-alt);
    color: var(--profile-text);
}

.page-profile .stats-grid {
    width: 100%;
    max-width: var(--profile-inner-width);
    margin: 0 auto 16px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.page-profile .stat-card {
    background: var(--profile-card);
    border: 1px solid var(--profile-line);
    border-radius: var(--profile-radius-lg);
    padding: 16px 18px;
    box-shadow: var(--profile-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 92px;
}

.page-profile .stat-info small {
    display: block;
    color: var(--profile-text-soft);
    font-size: 12px;
    margin-bottom: 6px;
}

.page-profile .stat-info strong {
    display: block;
    font-size: 28px;
    line-height: 1;
    letter-spacing: -0.03em;
}

.page-profile .stat-info .mono {
    font-size: 18px;
}

.page-profile .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: var(--profile-primary);
    font-size: 18px;
    flex: 0 0 auto;
}

.page-profile .profile-grid {
    width: 100%;
    max-width: var(--profile-inner-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 16px;
}

.page-profile .panel {
    background: var(--profile-card);
    border: 1px solid var(--profile-line);
    border-radius: var(--profile-radius-xl);
    box-shadow: var(--profile-shadow);
    overflow: hidden;
}

.page-profile .panel-header {
    padding: 16px 18px;
    border-bottom: 1px solid var(--profile-line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(255, 255, 255, 0.75);
}

.page-profile .panel-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.page-profile .panel-subtitle {
    margin: 3px 0 0;
    color: var(--profile-text-soft);
    font-size: 13px;
}

.page-profile .panel-body {
    padding: 18px;
}

.page-profile .account-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.page-profile .account-top {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-profile .account-avatar {
    width: 88px;
    height: 88px;
    border-radius: 22px;
    object-fit: cover;
    background: #eef2f7;
    border: 1px solid var(--profile-line);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    flex: 0 0 auto;
}

.page-profile .account-meta h2 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 700;
    color: var(--profile-text);
}

.page-profile .role-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.page-profile .role-badge.admin {
    background: var(--profile-admin-bg);
    color: var(--profile-admin-text);
}

.page-profile .role-badge.user {
    background: var(--profile-success-bg);
    color: var(--profile-success-text);
}

.page-profile .detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.page-profile .kv {
    background: var(--profile-card-2);
    border: 1px solid var(--profile-line);
    border-radius: 14px;
    padding: 12px 14px;
}

.page-profile .kv.span-2 {
    grid-column: span 2;
}

.page-profile .kv small {
    display: block;
    color: var(--profile-text-soft);
    font-size: 12px;
    margin-bottom: 6px;
    font-weight: 600;
}

.page-profile .kv strong {
    display: block;
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
    color: var(--profile-text);
}

.page-profile .password-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.page-profile .field label {
    display: block;
    margin-bottom: 7px;
    font-size: 12px;
    color: var(--profile-text-soft);
    font-weight: 600;
}

.page-profile .form-control {
    border-radius: 14px !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    background: var(--theme-surface) !important;
    box-shadow: none !important;
    padding: 11px 13px !important;
    color: var(--profile-text) !important;
    font-size: 14px !important;
}

.page-profile .form-control:focus {
    border-color: rgba(240, 161, 0, 0.45) !important;
    box-shadow: 0 0 0 4px rgba(240, 161, 0, 0.12) !important;
}

.page-profile .mono {
    font-family: "IBM Plex Mono", monospace;
}

.page-profile .secure-note {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--profile-accent-soft);
    color: var(--theme-accent-dark);
    border: 1px solid var(--profile-accent-border);
    font-size: 13px;
    font-weight: 500;
}

.page-profile .form-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 4px;
}

/* =========================================================
   ORDER DETAIL
   ========================================================= */
body.page-order-detail {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    font-family: "Kanit", sans-serif;
    padding-bottom: 3rem;
}

.page-order-detail {
    --primary-color: var(--theme-primary);
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: var(--theme-border);
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

.page-order-detail .container-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.page-order-detail .page-header {
    background: var(--theme-surface);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-order-detail .page-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    color: var(--gray-900);
    font-size: 1.5rem;
    font-weight: 700;
}

.page-order-detail .page-title i {
    color: var(--primary-color);
    font-size: 1.75rem;
}

.page-order-detail .order-id {
    color: var(--primary-color);
    font-weight: 800;
}

.page-order-detail .card {
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    background: var(--theme-surface);
    height: 100%;
}

.page-order-detail .card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--theme-primary-2) 100%);
    color: white;
    padding: 1.25rem 1.5rem;
    border: none;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-order-detail .card-body {
    padding: 2rem;
}

.page-order-detail .product-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--gray-50) 0%, #e0e7ff 100%);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.page-order-detail .product-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
    border: 3px solid white;
    box-shadow: var(--shadow-md);
    background: var(--theme-surface);
}

.page-order-detail .product-info {
    flex: 1;
}

.page-order-detail .product-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.page-order-detail .product-date {
    color: var(--gray-600);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-order-detail .product-date i {
    color: var(--primary-color);
}

.page-order-detail .order-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.page-order-detail .detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 10px;
    transition: all 0.2s;
}

.page-order-detail .detail-row:hover {
    background: var(--gray-100);
    transform: translateX(5px);
}

.page-order-detail .detail-label {
    font-weight: 600;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-order-detail .detail-label i {
    color: var(--primary-color);
    width: 20px;
    text-align: center;
}

.page-order-detail .detail-value {
    font-weight: 700;
    color: var(--gray-900);
    font-size: 1.1rem;
}

.page-order-detail .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: var(--shadow-sm);
}

.page-order-detail .status-completed {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 2px solid #6ee7b7;
}

.page-order-detail .status-pending {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 2px solid #fbbf24;
}

.page-order-detail .status-failed {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 2px solid #f87171;
}

.page-order-detail .code-item {
    padding: 1.5rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #bae6fd;
    border-radius: 12px;
    margin-bottom: 1rem;
    transition: all 0.3s;
}

.page-order-detail .code-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.page-order-detail .code-item:last-child {
    margin-bottom: 0;
}

.page-order-detail .code-label {
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-order-detail .code-label i {
    color: var(--primary-color);
}

.page-order-detail .input-group {
    box-shadow: var(--shadow-sm);
    border-radius: 10px;
    overflow: hidden;
}

.page-order-detail .code-input {
    font-family: 'Courier New', Consolas, Monaco, monospace;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-200);
    background: var(--theme-surface);
    color: var(--gray-900);
}

.page-order-detail .code-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.page-order-detail .btn-code-action {
    border: 2px solid var(--gray-300);
    background: var(--theme-surface);
    color: var(--gray-700);
    font-weight: 600;
    padding: 0.75rem 1.25rem;
    transition: all 0.2s;
}

.page-order-detail .btn-code-action:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.page-order-detail .btn-code-action i {
    transition: transform 0.2s;
}

.page-order-detail .btn-code-action:hover i {
    transform: scale(1.2);
}

.page-order-detail .btn {
    border-radius: 10px;
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    transition: all 0.2s;
    border: none;
}

.page-order-detail .btn-outline-secondary {
    border: 2px solid var(--gray-300);
    color: var(--gray-700);
    background: var(--theme-surface);
}

.page-order-detail .btn-outline-secondary:hover {
    background: var(--gray-700);
    border-color: var(--gray-700);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.page-order-detail .alert {
    border: none;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    font-weight: 500;
    display: flex;
    align-items: start;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
}

.page-order-detail .alert i {
    font-size: 1.5rem;
    margin-top: 0.125rem;
}

.page-order-detail .alert-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: var(--theme-primary-2);
    border-left: 4px solid var(--info-color);
}

.page-order-detail .copy-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1080;
    min-width: 250px;
}

.page-order-detail .toast {
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.page-order-detail .toast-body {
    padding: 1rem 1.5rem;
    color: white;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-order-detail .toast-body i {
    color: var(--success-color);
    font-size: 1.25rem;
}

.page-order-detail .security-notice {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid var(--warning-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.page-order-detail .security-notice-title {
    font-weight: 700;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.page-order-detail .security-notice-title i {
    color: var(--warning-color);
    font-size: 1.25rem;
}

.page-order-detail .security-notice-text {
    color: #78350f;
    line-height: 1.6;
    margin: 0;
}

.page-order-detail .empty-code {
    text-align: center;
    padding: 3rem 1rem;
}

.page-order-detail .empty-code i {
    font-size: 4rem;
    color: var(--gray-300);
    margin-bottom: 1rem;
}

.page-order-detail .empty-code-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.page-order-detail .empty-code-text {
    color: var(--gray-600);
}

.page-order-detail .code-counter {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--theme-primary-2) 100%);
    color: white;
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

/* =========================================================
   ORDER HISTORY
   ========================================================= */
.page-order-history {
    --history-max-width: 1270px;
    --history-inner-width: 1150px;
    --history-bg: rgba(255, 255, 255, 0.92);
    --history-card: var(--theme-surface);
    --history-card-2: var(--theme-surface-alt);
    --history-line: rgba(15, 23, 42, 0.06);
    --history-text: var(--theme-text);
    --history-text-soft: var(--theme-muted);
    --history-primary: var(--theme-primary);
    --history-primary-2: var(--theme-primary-2);
    --history-accent: var(--theme-accent);
    --history-accent-soft: var(--theme-accent-bg);
    --history-accent-border: var(--theme-accent-border);
    --history-success-bg: #e7f7ee;
    --history-success-text: #1c7c44;
    --history-success-border: #bfe8d0;
    --history-pending-bg: var(--theme-accent-bg);
    --history-pending-text: #b87900;
    --history-pending-border: #ffe0ad;
    --history-danger-bg: #fdecec;
    --history-danger-text: #a12d2d;
    --history-danger-border: #f5c2c2;
    --history-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --history-shadow-lg: 0 20px 60px rgba(15, 23, 42, 0.12);
    --history-radius-xl: 24px;
    --history-radius-lg: 18px;
    --history-radius-md: 16px;
    --history-radius-sm: 14px;
    color: var(--history-text);
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.12)),
        url("/assets/backgrounds/bg-main.jpg");
}

.page-order-history .main-background {
    width: min(var(--history-max-width), calc(100% - 24px));
    min-height: 1000px;
    background: var(--history-bg);
    border-radius: var(--history-radius-xl);
    padding: 26px 20px 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 26px;
}

.page-order-history .history-wrap {
    width: 100%;
    max-width: var(--history-inner-width);
}

.page-order-history .history-wrap>div.d-flex.justify-content-between.align-items-center.mb-3.flex-wrap.gap-2 {
    margin-bottom: 14px !important;
}

.page-order-history .history-wrap h3 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--history-text);
}

.page-order-history .history-wrap h3 i {
    color: var(--history-accent);
}

.page-order-history .history-wrap .btn-outline-secondary.btn-sm {
    height: 44px;
    padding: 0 16px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    border: 1px solid var(--history-line);
    background: var(--theme-surface);
    color: var(--history-text);
    transition: .2s ease;
    box-shadow: none !important;
}

.page-order-history .history-wrap .btn-outline-secondary.btn-sm:hover {
    background: var(--theme-surface-alt);
    color: var(--history-text);
    transform: translateY(-1px);
}

.page-order-history .balance-box {
    background: var(--history-accent-soft);
    border: 1px solid var(--history-accent-border);
    color: var(--theme-accent-dark);
    border-radius: var(--history-radius-sm);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 20px rgba(240, 161, 0, 0.08);
    margin-bottom: 16px !important;
}

.page-order-history .balance-box i {
    font-size: 18px;
}

.page-order-history .balance-box strong {
    font-family: "IBM Plex Mono", monospace;
    color: #7a5200;
}

.page-order-history .table-responsive {
    background: var(--history-card);
    border: 1px solid var(--history-line);
    border-radius: var(--history-radius-xl);
    box-shadow: var(--history-shadow);
    overflow: hidden;
}

.page-order-history .table {
    margin-bottom: 0;
    --bs-table-bg: transparent;
    --bs-table-hover-bg: #fbfdff;
    color: var(--history-text);
}

.page-order-history .table thead.table-dark {
    --bs-table-bg: var(--theme-surface-alt);
    --bs-table-color: var(--history-text-soft);
    --bs-table-border-color: rgba(15, 23, 42, 0.06);
}

.page-order-history .table thead th {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 14px 14px;
    border-bottom: 1px solid var(--history-line);
    white-space: nowrap;
    vertical-align: middle;
}

.page-order-history .table tbody td {
    padding: 14px;
    border-bottom: 1px solid #eef2f7;
    vertical-align: middle;
}

.page-order-history .table tbody tr:last-child td {
    border-bottom: 0;
}

.page-order-history .table tbody tr:hover {
    background: #fbfdff;
}

.page-order-history .table tbody td:first-child {
    font-family: "IBM Plex Mono", monospace;
    font-weight: 600;
    color: var(--history-text-soft);
}

.page-order-history .product-col {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 220px;
}

.page-order-history .product-col img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border: 1px solid var(--history-line);
    border-radius: 14px;
    background: var(--theme-surface);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.05);
    flex: 0 0 auto;
}

.page-order-history .product-col>div {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--history-text);
    word-break: break-word;
}

.page-order-history .status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .45rem .75rem;
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 700;
    min-width: 100px;
}

.page-order-history .status-completed {
    background: var(--history-success-bg);
    color: var(--history-success-text);
    border: 1px solid var(--history-success-border);
}

.page-order-history .status-pending {
    background: var(--history-pending-bg);
    color: var(--history-pending-text);
    border: 1px solid var(--history-pending-border);
}

.page-order-history .status-cancelled {
    background: var(--history-danger-bg);
    color: var(--history-danger-text);
    border: 1px solid var(--history-danger-border);
}

.page-order-history .table tbody td:nth-child(3),
.page-order-history .table tbody td:nth-child(4),
.page-order-history .table tbody td:nth-child(6) {
    white-space: nowrap;
}

.page-order-history .table tbody td:nth-child(4) {
    font-family: "IBM Plex Mono", monospace;
    font-weight: 600;
}

.page-order-history .table .btn.btn-sm.btn-primary {
    height: 38px;
    padding: 0 14px;
    border: 0;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 13px;
    background: linear-gradient(135deg, var(--history-primary), var(--history-primary-2));
    color: #fff;
    box-shadow: 0 10px 20px rgba(37, 99, 235, .18);
    transition: .2s ease;
}

.page-order-history .table .btn.btn-sm.btn-primary:hover {
    transform: translateY(-1px);
    color: #fff;
}

.page-order-history .table tbody td.text-center.text-muted.py-4 {
    padding: 48px 20px !important;
    color: var(--history-text-soft) !important;
    font-size: 15px;
    font-weight: 600;
}

/* =========================================================
   AUTH (sign-in + register)
   ========================================================= */
.page-auth .main-background {
    width: min(1270px, 100%);
    min-height: 1000px;
    background: var(--theme-surface);
    border-radius: 20px;
    padding: 20px 0 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.page-auth .login-wrap {
    width: 100%;
    max-width: 560px;
    margin-top: 30px;
}

.page-auth .login-card {
    background: var(--theme-surface);
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, .06);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .12);
    padding: 28px 26px;
}

.page-auth .login-title {
    text-align: center;
    font-weight: 800;
    color: var(--theme-accent);
    font-size: 42px;
    letter-spacing: .5px;
}

.page-auth .login-sub {
    text-align: center;
    color: var(--theme-muted);
    font-weight: 700;
    font-size: 24px;
    margin-top: -6px;
}

.page-auth .form-label {
    font-weight: 600;
    color: #374151;
}

.page-auth .form-control {
    height: 52px;
    border-radius: 12px;
    border: 1.5px solid #e6e6e6;
}

.page-auth .form-control:focus {
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 .2rem rgba(240, 161, 0, .15);
}

.page-auth .btn-login {
    width: 100%;
    height: 52px;
    border-radius: 12px;
    background: var(--theme-accent);
    color: #fff;
    font-weight: 800;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.page-auth .btn-login:hover {
    background: #e59b00;
    color: #fff;
}

.page-auth .btn-discord {
    width: 100%;
    height: 50px;
    border-radius: 12px;
    background: #5865F2;
    color: #fff;
    font-weight: 700;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
}

.page-auth .btn-discord:hover {
    background: #4956d9;
    color: #fff;
}

.page-auth .or-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #9ca3af;
    margin: 14px 0;
}

.page-auth .or-divider .line {
    flex: 1;
    height: 1px;
    background: var(--theme-border);
}

.page-auth .link-muted {
    color: var(--theme-muted);
    text-decoration: none;
}

.page-auth .link-muted:hover {
    color: #111827;
    text-decoration: underline;
}

.page-auth .captcha-box {
    background: var(--theme-surface-alt);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    justify-content: center;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (prefers-reduced-motion: reduce) {

    .page-home .reveal,
    .page-home .reveal.is-visible,
    .page-category .reveal,
    .page-category .reveal.is-visible {
        transition: none !important;
        transform: none !important;
        opacity: 1 !important;
    }
}

@media (max-width: 1300px) {

    .page-home .main-background,
    .page-category .main-background,
    .page-product .main-background {
        border-radius: 0;
    }
}

@media (max-width: 1199.98px) {

    .page-home .product-grid,
    .page-category .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .page-home .stats-row {
        grid-template-columns: repeat(4, 1fr);
    }

    .page-shop .main-background {
        width: 95%;
    }

    .page-shop .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .page-product .rel-card {
        flex: 0 0 calc((100% - 48px) / 4);
    }

    .page-profile .profile-shell {
        width: calc(100% - 12px);
        padding: 24px 16px 52px;
    }

    .page-profile .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .page-profile .profile-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991.98px) {

    .page-home .main-background,
    .page-category .main-background,
    .page-product .main-background {
        padding: 16px 16px 48px;
        border-radius: 0;
    }

    .page-home .product-grid,
    .page-category .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }

    .page-home .pc-thumb,
    .page-category .pc-thumb {
        height: 130px;
    }

    .page-home .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .page-home {
        --cat-h: 160px;
    }

    .page-category .category-title {
        font-size: 16px;
    }

    .page-shop .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .page-product .detail-wrap {
        margin: 24px auto 0;
        padding: 0;
    }

    .page-product .gallery .carousel-item img {
        max-height: 360px;
    }

    .page-product .product-title {
        font-size: 20px;
        margin-top: 8px;
    }

    .page-product .price-now {
        font-size: 22px;
    }

    .page-order-history .main-background {
        width: 95%;
    }

    .page-order-history .history-wrap h3 {
        font-size: 24px;
    }

    .page-order-history .table {
        min-width: 980px;
    }
}

@media (max-width: 767.98px) {
    .nav-spacer {
        height: 64px;
    }

    .page-home .main-background,
    .page-category .main-background,
    .page-product .main-background {
        padding: 12px 12px 40px;
    }

    .page-home .product-grid,
    .page-category .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .page-home .pc-thumb,
    .page-category .pc-thumb {
        height: 120px;
    }

    .page-home .pc-body,
    .page-category .pc-body {
        padding: 10px 10px 14px;
    }

    .page-home .pc-title,
    .page-category .pc-title {
        font-size: 14px;
        min-height: 36px;
    }

    .page-home .pc-badge,
    .page-category .pc-badge {
        font-size: 11px;
        padding: 4px 8px;
    }

    .page-home .pc-btn,
    .page-home .pc-btn:link,
    .page-home .pc-btn:visited,
    .page-category .pc-btn,
    .page-category .pc-btn:link,
    .page-category .pc-btn:visited {
        font-size: 13px;
        padding: 8px 8px;
    }

    .page-home .category-title {
        font-size: 17px;
    }

    .page-home {
        --cat-h: 130px;
    }

    .page-home .announce-bar {
        padding: 10px 14px !important;
        gap: 10px !important;
    }

    .page-home .announce-badge {
        font-size: 13px;
        padding: 6px 10px;
    }

    .page-home .announce-badge span {
        display: none;
    }

    .page-home .stat-card {
        padding: 14px 16px;
        gap: 10px;
    }

    .page-home .stat-number {
        font-size: 22px;
    }

    .page-home .stat-thumb {
        width: 52px;
        height: 52px;
    }

    .page-home .stat-thumb img {
        width: 34px;
        height: 34px;
    }

    .page-category .category-title {
        font-size: 15px;
    }

    .page-category .btn-more {
        font-size: 13px;
    }

    .page-category .crumb {
        font-size: 12px;
    }

    .page-category .cat-banner {
        width: 100%;
        border-radius: 12px;
    }

    .page-shop .category-grid {
        grid-template-columns: 1fr;
    }

    .page-product .detail-wrap {
        margin: 16px auto 0;
    }

    .page-product .gallery .carousel-item img {
        max-height: 300px;
    }

    .page-product .thumbs img {
        width: 64px;
        height: 64px;
    }

    .page-product .product-title {
        font-size: 18px;
    }

    .page-product .price-now {
        font-size: 20px;
    }

    .page-product .price-old {
        font-size: 14px;
    }

    .page-product .buy-line {
        flex-direction: column;
        gap: 10px;
    }

    .page-product .qty-box {
        width: 100%;
        flex: 0 0 auto;
    }

    .page-product .buy-btn {
        width: 100% !important;
        font-size: 15px;
    }

    .page-product .type-badge {
        font-size: 12px;
        padding: 5px 8px;
    }

    .page-product .related-section {
        margin: 28px auto 0;
        padding: 0;
    }

    .page-product .rel-card {
        flex: 0 0 calc((100% - 24px) / 3);
    }

    .page-product .rel-track {
        gap: 12px;
    }

    .page-product .related-section .section-title {
        font-size: 16px;
    }

    .page-profile .profile-page {
        padding: 18px 8px 36px;
    }

    .page-profile .profile-shell {
        width: calc(100% - 8px);
        border-radius: 18px;
        padding: 20px 12px 42px;
    }

    .page-profile .profile-head {
        flex-direction: column;
        align-items: stretch;
    }

    .page-profile .profile-title-wrap h1 {
        font-size: 24px;
    }

    .page-profile .stats-grid,
    .page-profile .detail-grid {
        grid-template-columns: 1fr;
    }

    .page-profile .kv.span-2 {
        grid-column: span 1;
    }

    .page-profile .account-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-profile .form-actions,
    .page-profile .profile-head-actions {
        display: flex;
        width: 100%;
    }

    .page-profile .form-actions .btn-main,
    .page-profile .profile-head-actions .btn-sub {
        width: 100%;
        justify-content: center;
    }

    .page-order-detail .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-order-detail .page-title {
        font-size: 1.25rem;
    }

    .page-order-detail .product-section {
        flex-direction: column;
        text-align: center;
    }

    .page-order-detail .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .page-order-detail .card-body {
        padding: 1.5rem;
    }

    .page-order-detail .copy-toast {
        right: 1rem;
        bottom: 1rem;
        left: 1rem;
        min-width: auto;
    }

    .page-order-history .main-background {
        width: calc(100% - 14px);
        border-radius: 18px;
        padding: 20px 12px 42px;
        min-height: unset;
    }

    .page-order-history .history-wrap h3 {
        font-size: 22px;
    }

    .page-order-history .balance-box {
        padding: 12px 14px;
        font-size: 14px;
    }

    .page-order-history .table-responsive {
        border-radius: 18px;
    }

    .page-auth .main-background {
        width: 95%;
    }
}

@media (max-width: 575.98px) {
    .page-shop .category-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 479.98px) {

    .page-home .main-background,
    .page-category .main-background,
    .page-product .main-background {
        padding: 10px 10px 32px;
    }

    .page-home .product-grid,
    .page-category .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .page-home .pc-thumb,
    .page-category .pc-thumb {
        height: 100px;
    }

    .page-home .pc-body,
    .page-category .pc-body {
        padding: 8px 8px 12px;
    }

    .page-home .pc-title,
    .page-category .pc-title {
        font-size: 13px;
        min-height: 32px;
    }

    .page-home .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .page-home .stat-card {
        padding: 12px;
        gap: 8px;
        flex-direction: column;
        text-align: center;
    }

    .page-home .stat-meta {
        text-align: center;
    }

    .page-home .stat-number {
        font-size: 20px;
    }

    .page-home {
        --cat-h: 110px;
    }

    .page-home .carousel-control-prev,
    .page-home .carousel-control-next,
    .page-category .carousel-control-prev,
    .page-category .carousel-control-next {
        width: 32px;
    }

    .page-home .category-title {
        font-size: 15px;
    }

    .page-home .btn-more {
        font-size: 13px;
    }

    .page-category .pagination .page-link {
        padding: 6px 10px;
        font-size: 13px;
    }

    .page-product .detail-wrap {
        margin: 12px auto 0;
    }

    .page-product .gallery {
        padding: 6px;
        border-radius: 12px;
    }

    .page-product .gallery .carousel-item img {
        max-height: 240px;
    }

    .page-product .thumbs {
        gap: 7px;
    }

    .page-product .thumbs img {
        width: 54px;
        height: 54px;
        border-radius: 8px;
    }

    .page-product .product-title {
        font-size: 16px;
    }

    .page-product .price-now {
        font-size: 18px;
    }

    .page-product .stock-badge {
        font-size: 12px;
        padding: 5px 10px;
    }

    .page-product .buy-btn {
        font-size: 14px;
        padding: 11px 12px;
        min-height: 44px;
    }

    .page-product .product-desc {
        font-size: 14px;
    }

    .page-product .rel-card {
        flex: 0 0 calc((100% - 12px) / 2);
    }

    .page-product .rel-track {
        gap: 12px;
    }

    .page-product .rel-nav-btn {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
}

@media (max-width: 359.98px) {

    .page-home .main-background,
    .page-category .main-background,
    .page-product .main-background {
        padding: 8px 8px 28px;
    }

    .page-home .pc-title,
    .page-category .pc-title {
        font-size: 12px;
    }

    .page-home .pc-badge,
    .page-category .pc-badge {
        font-size: 10px;
        padding: 3px 6px;
    }

    .page-home .pc-price-now,
    .page-category .pc-price-now {
        font-size: 13px;
    }

    .page-home .pc-btn,
    .page-home .pc-btn:link,
    .page-home .pc-btn:visited,
    .page-category .pc-btn,
    .page-category .pc-btn:link,
    .page-category .pc-btn:visited {
        font-size: 12px;
        padding: 7px 6px;
    }

    .page-product .product-title {
        font-size: 15px;
    }

    .page-product .price-now {
        font-size: 17px;
    }

    .page-product .thumbs img {
        width: 46px;
        height: 46px;
    }

    .page-product .buy-btn {
        font-size: 13px;
    }
}

/* =========================================================
   THEME OVERRIDES
   วางท้ายสุดของ app.css
   ========================================================= */

body {
    background: var(--theme-body-bg);
    background-image: var(--theme-bg-image);
    color: var(--theme-text);
}

.page-profile,
.page-order-history {
    background: var(--theme-body-bg);
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.12)),
        var(--theme-bg-image);
    color: var(--theme-text);
}

body.page-order-detail {
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-primary-2) 100%);
}

/* surface / card */
.page-home .main-background,
.page-category .main-background,
.page-product .main-background,
.page-shop .main-background,
.page-auth .main-background {
    background: var(--theme-main-bg);
}

.page-home .announce-bar,
.page-home .category-card-img,
.page-home .product-card,
.page-home .stat-card,
.page-category .cat-banner,
.page-category .product-card,
.page-shop .category-card,
.page-product .gallery,
.page-product .rel-card,
.page-auth .login-card {
    background: var(--theme-surface);
    border-color: var(--theme-border);
}

.page-profile {
    --profile-bg: var(--theme-main-bg);
    --profile-card: var(--theme-surface);
    --profile-card-2: var(--theme-surface-alt);
    --profile-line: color-mix(in srgb, var(--theme-border) 70%, transparent);
    --profile-text: var(--theme-text);
    --profile-text-soft: var(--theme-muted);
    --profile-accent: var(--theme-accent);
    --profile-accent-soft: var(--theme-accent-bg);
    --profile-accent-border: var(--theme-accent-border);
    --profile-primary: var(--theme-primary);
    --profile-primary-2: var(--theme-primary-2);
}

.page-order-history {
    --history-bg: var(--theme-main-bg);
    --history-card: var(--theme-surface);
    --history-card-2: var(--theme-surface-alt);
    --history-line: color-mix(in srgb, var(--theme-border) 70%, transparent);
    --history-text: var(--theme-text);
    --history-text-soft: var(--theme-muted);
    --history-primary: var(--theme-primary);
    --history-primary-2: var(--theme-primary-2);
    --history-accent: var(--theme-accent);
    --history-accent-soft: var(--theme-accent-bg);
    --history-accent-border: var(--theme-accent-border);
}

.page-order-detail {
    --primary-color: var(--theme-primary);
    --info-color: var(--theme-primary);
}

/* text */
.page-home .category-title,
.page-category .category-title,
.page-shop .shop-title,
.page-product .product-title,
.page-profile .profile-title-wrap h1,
.page-order-history .history-wrap h3,
.page-order-detail .page-title,
.page-order-detail .product-name {
    color: var(--theme-text);
}

.page-home .announce-content,
.page-home .announce-content marquee,
.page-category .crumb,
.page-shop .category-meta,
.page-profile .panel-subtitle,
.page-profile .profile-title-wrap p,
.page-order-history .product-col>div,
.page-order-detail .product-date,
.page-order-detail .detail-label {
    color: var(--theme-muted);
}

/* accent */
.page-home .btn-more,
.page-category .btn-more,
.page-home .pc-price-now,
.page-category .pc-price-now,
.page-product .price-now,
.page-product .rel-price,
.page-home .stat-number,
.page-home .stat-unit,
.page-shop .category-meta .dot,
.page-home .category-title i,
.page-shop .shop-title i,
.page-product .related-section .section-title i,
.page-order-history .history-wrap h3 i {
    color: var(--theme-accent);
}

.page-home .btn-more:hover,
.page-category .btn-more:hover {
    color: var(--theme-accent-hover);
}

/* button / action */
.page-home .pc-btn,
.page-home .pc-btn:link,
.page-home .pc-btn:visited,
.page-category .pc-btn,
.page-category .pc-btn:link,
.page-category .pc-btn:visited,
.page-product .buy-btn,
.page-product .rel-nav-btn,
.page-auth .btn-login {
    border-color: var(--theme-accent);
}

.page-home .pc-btn,
.page-home .pc-btn:link,
.page-home .pc-btn:visited,
.page-category .pc-btn,
.page-category .pc-btn:link,
.page-category .pc-btn:visited,
.page-product .buy-btn,
.page-product .rel-nav-btn {
    color: var(--theme-accent);
}

.page-home .pc-btn:hover,
.page-home .pc-btn:focus,
.page-category .pc-btn:hover,
.page-category .pc-btn:focus,
.page-product .buy-btn:hover {
    background: color-mix(in srgb, var(--theme-accent) 10%, #fff);
    color: var(--theme-accent);
}

.page-product .rel-nav-btn:hover:not(:disabled) {
    background: var(--theme-accent);
    border-color: var(--theme-accent);
    color: #fff;
}

.page-auth .btn-login {
    background: var(--theme-accent);
}

.page-auth .btn-login:hover {
    background: var(--theme-accent-hover);
}

/* badges */
.page-home .pc-badge,
.page-category .pc-badge,
.page-product .stock-badge,
.page-order-history .balance-box,
.page-profile .secure-note {
    border-color: color-mix(in srgb, var(--theme-accent) 45%, white);
}

/* inputs */
.page-auth .form-control:focus,
.page-profile .form-control:focus,
.page-order-detail .code-input:focus {
    border-color: color-mix(in srgb, var(--theme-accent) 70%, white) !important;
}

/* pagination */
.page-category .pagination .page-link,
.page-shop .page-link {
    color: var(--theme-accent);
    border-color: color-mix(in srgb, var(--theme-accent) 35%, white);
}

.page-category .pagination .page-item.active .page-link {
    background: var(--theme-accent);
    border-color: var(--theme-accent);
    color: #fff;
}

.page-shop .page-item.active .page-link {
    background: color-mix(in srgb, var(--theme-accent) 12%, white);
    color: var(--theme-accent);
    border-color: color-mix(in srgb, var(--theme-accent) 35%, white);
}

.page-home .announce-badge {
    background: linear-gradient(135deg,
            var(--theme-announcement-badge-start) 0%,
            var(--theme-announcement-badge-end) 100%);
    color: var(--theme-announcement-badge-text);
    box-shadow: 0 2px 6px color-mix(in srgb, var(--theme-announcement-badge-end) 35%, transparent);
}

.page-home .announce-badge i,
.page-home .announce-badge .fw-semibold {
    color: var(--theme-announcement-badge-text);
}

.history-switch {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.history-switch a {
    text-decoration: none;
    border-radius: 12px;
    padding: 9px 14px;
    font-weight: 600;
    color: #374151;
    background: var(--theme-surface);
    transition: .2s ease;
}

.history-switch a.active {
    background: var(--theme-accent-bg);
    border-color: var(--theme-accent);
    color: var(--theme-accent-dark);
}

.history-switch {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.history-switch a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    background: rgba(255, 255, 255, .88);
    border: 1px solid rgba(0, 0, 0, .08);
    color: #475569;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .05);
}

.history-switch a.active {
    background: var(--theme-text);
    color: #fff;
    border-color: var(--theme-text);
}