html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: #000;   /* กันพื้นหลังหลุด */
}

body.theme-dark {
    background: #000;
}

body.theme-light {
    background: #fff;
}

* {
    box-sizing: border-box;
}
.profile-icon img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
}

.profile-container {
    max-width: 600px;
    margin: 40px auto;
}
.verify-later {
    margin-top: 20px;
    text-align: center;
}
.profile-icon-svg {
    color: var(--text-color);
    display: flex;
    align-items: center;
    transition: 0.2s;
}

.profile-icon-svg:hover {
    opacity: 0.7;
}
.verify-later a {
    font-size: 14px;
    color: #888;
    text-decoration: none;
    transition: 0.2s;
}

.verify-later a:hover {
    color: #E60000;
}
.profile-card {
    background: #111;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #222;
}

body.theme-light .profile-card {
    background: #fff;
    border: 1px solid #ddd;
}

/* =========================
   WRAPPER (Footer Fix)
========================= */
.wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: inherit;
}

/* ================= SLIDER ================= */

.slider-section {
    width: 100%;
    margin: 20px auto 40px auto;
}

.slider-container {
    position: relative;
    width: 100%;
    max-width: 1200px;      /* จำกัดความกว้าง */
    height: 380px;          /* ความสูงพอดี */
    margin: 0 auto;         /* จัดกลาง */
    border-radius: 14px;
    overflow: hidden;
}
.change-pass-form .input-group {
    margin-bottom: 15px;
}

.forgot-password {
    margin-top: 15px;
    text-align: center;
}
/* ===== PRODUCT GALLERY ===== */

.main-image img {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    border-radius: 12px;
}

.thumbnail-list {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.thumb {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.7;
    transition: 0.2s;
}

.thumb:hover {
    opacity: 1;
    transform: scale(1.05);
}

/* ===== DESCRIPTION ===== */

.desc-title {
    margin-top: 25px;
    font-size: 1.1rem;
}
.image-preview-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
}
/* ============================= */
/* PRODUCT DETAIL IMAGE SYSTEM   */
/* ============================= */

.product-image {
    width: 100%;
    max-width: 500px;
}

.main-image {
    width: 100%;
    height: 420px;
    border-radius: 12px;
    overflow: hidden;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-light .main-image {
    background: #f5f5f5;
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: 0.3s ease;
}

.thumbnail-list {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}
/* ========================================= */
/* PRODUCT IMAGE LAYOUT (PRO LEVEL)         */
/* ========================================= */

.product-image {
    width: 100%;
    max-width: 520px;
}

.main-image {
    width: 100%;
    height: 420px;
    border-radius: 16px;
    overflow: hidden;
    background: #0f0f0f;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-light .main-image {
    background: #f4f4f4;
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;   /* ไม่ยืด ไม่ครอป */
    transition: 0.3s ease;
}

.thumb-strip {
    display: flex;
    gap: 12px;
    margin-top: 18px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.thumb-strip::-webkit-scrollbar {
    height: 6px;
}

.thumb-strip::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}
/* ===================================== */
/* PRODUCT DETAIL PREMIUM LAYOUT        */
/* ===================================== */

.product-detail-card {
    display: flex;
    gap: 60px;
    padding: 50px;
    border-radius: 24px;
    margin-top: 40px;
    backdrop-filter: blur(10px);
}

/* DARK MODE */
.theme-dark .product-detail-card {
    background: #0f0f0f;
}

/* LIGHT MODE */
.theme-light .product-detail-card {
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}

/* LEFT SIDE */
.product-left {
    width: 50%;
}

.image-wrapper {
    width: 100%;
    height: 420px;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-dark .image-wrapper {
    background: #111;
}

.theme-light .image-wrapper {
    background: #f4f4f4;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* GALLERY */
.gallery-row {
    display: flex;
    gap: 14px;
    margin-top: 22px;
    overflow-x: auto;
}

.gallery-thumb {
    width: 90px;
    height: 90px;
    border-radius: 14px;
    object-fit: cover;
    cursor: pointer;
    opacity: 0.6;
    border: 2px solid transparent;
    transition: 0.25s ease;
}

.theme-dark .gallery-thumb {
    background: #111;
}

.theme-light .gallery-thumb {
    background: #eee;
}

.gallery-thumb:hover {
    opacity: 1;
}

.gallery-thumb.active {
    opacity: 1;
    border-color: #00d4ff;
}

/* RIGHT SIDE */
.product-right {
    width: 50%;
}

.product-title {
    font-size: 34px;
    margin-bottom: 10px;
}

.product-meta {
    opacity: 0.7;
    margin-bottom: 25px;
}

.product-price {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 12px;
}

.theme-dark .product-price {
    color: #00ffcc;
}

.theme-light .product-price {
    color: #0088ff;
}

.stock-info {
    font-weight: bold;
    color: #00c853;
    margin-bottom: 30px;
}

.divider {
    height: 1px;
    margin: 30px 0;
}

.theme-dark .divider {
    background: #333;
}

.theme-light .divider {
    background: #ddd;
}
/* ============================= */
/* MODERN CREATE PRODUCT FORM   */
/* ============================= */

.modern-card {
    padding: 40px;
    border-radius: 20px;
}

.theme-dark .modern-card {
    background: #0f0f0f;
}

.theme-light .modern-card {
    background: #ffffff;
    box-shadow: 0 15px 50px rgba(0,0,0,0.08);
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.modern-form .form-group {
    display: flex;
    flex-direction: column;
}

.modern-form label {
    margin-bottom: 8px;
    font-weight: 500;
    opacity: 0.8;
}

.modern-form input,
.modern-form select,
.modern-form textarea {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #333;
    background: transparent;
    color: inherit;
    font-size: 14px;
}

.theme-light .modern-form input,
.theme-light .modern-form select,
.theme-light .modern-form textarea {
    border: 1px solid #ddd;
}

.upload-card {
    display: flex;
    gap: 40px;
    padding: 25px;
    border-radius: 16px;
    margin-bottom: 30px;
}

.theme-dark .upload-card {
    background: #121212;
}

.theme-light .upload-card {
    background: #f6f6f6;
}

.upload-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.large {
    padding: 14px 30px;
    font-size: 16px;
}
.product-description {
    line-height: 1.7;
    opacity: 0.9;
    margin-bottom: 30px;
}

/* RESPONSIVE */
@media (max-width: 1000px) {

    .product-detail-card {
        flex-direction: column;
        gap: 40px;
        padding: 30px;
    }

    .product-left,
    .product-right {
        width: 100%;
    }

}
.thumb {
    width: 90px;
    height: 90px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.6;
    transition: 0.25s ease;
    background: #111;
}

.theme-light .thumb {
    background: #eee;
}

.thumb:hover {
    opacity: 1;
}

.thumb.active {
    opacity: 1;
    border-color: #00d4ff;
}
.thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.6;
    border: 2px solid transparent;
    transition: 0.2s ease;
}

.thumb:hover {
    opacity: 1;
}

.thumb.active {
    opacity: 1;
    border-color: #00bcd4;
}
.image-preview-box {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    overflow: hidden;
    background: #111;
}

.image-preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.product-description {
    margin-top: 10px;
    padding: 20px;
    border-radius: 12px;
    background: var(--card-bg);
    line-height: 1.8;
    font-size: 0.95rem;
    color: var(--text-color);
}
.forgot-password a {
    font-size: 14px;
    color: #888;
    text-decoration: none;
    transition: 0.2s;
}

.forgot-password a:hover {
    color: #E60000;
}
.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

.slide.active {
    opacity: 1;
}
/* ================= BUILD PAGE ================= */

.build-container {
    max-width: 1300px;
    margin: 40px auto;
    padding: 20px;
}
#resendLink {
    transition: 0.3s;
    font-weight: 500;
}

#resendLink:hover {
    opacity: 0.7;
}
.build-container h1 {
    font-size: 32px;
    margin-bottom: 25px;
    font-weight: 600;
}

/* ================= TABS ================= */

.build-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 30px;
}

.build-tabs button {
    padding: 10px 18px;
    border-radius: 8px;
    border: 1px solid #333;
    background: #111;
    color: #ccc;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 14px;
}

.build-tabs button:hover {
    border-color: #E60000;
    color: #fff;
}

.build-tabs button.active {
    background: #E60000;
    color: #fff;
    border-color: #E60000;
    box-shadow: 0 0 10px rgba(230,0,0,0.4);
}

/* ================= PRODUCT AREA ================= */

#buildProducts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* reuse product-card but upgrade slightly */

.build-card {
    background: #141414;
    border: 1px solid #222;
    border-radius: 12px;
    overflow: hidden;
    transition: 0.25s ease;
    cursor: pointer;
}

.build-card:hover {
    transform: translateY(-5px);
    border-color: #E60000;
    box-shadow: 0 0 15px rgba(230,0,0,0.25);
}

.build-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.build-card-content {
    padding: 12px;
}

.build-card h4 {
    font-size: 14px;
    margin-bottom: 6px;
    color: #eee;
}

.build-card .price {
    font-weight: 600;
    color: #E60000;
    font-size: 15px;
}

/* ================= SUMMARY ================= */

.build-summary {
    background: #111;
    border: 1px solid #222;
    border-radius: 14px;
    padding: 20px;
    margin-top: 30px;
}

.build-summary h3 {
    margin-bottom: 12px;
}

#selectedParts {
    margin-bottom: 15px;
}

#selectedParts div {
    padding: 6px 0;
    border-bottom: 1px solid #222;
    font-size: 14px;
    color: #ccc;
}

#buildTotal {
    font-size: 20px;
    font-weight: 600;
    color: #E60000;
}

/* ================= CHECKOUT BUTTON ================= */

#checkoutBuild {
    margin-top: 15px;
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: none;
    background: #E60000;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.25s ease;
}

#checkoutBuild:hover {
    background: #ff1a1a;
}

#checkoutBuild:disabled {
    background: #333;
    cursor: not-allowed;
}

/* ================= REQUIRED MARK ================= */

.build-tabs button[data-tab="case"]::after,
.build-tabs button[data-tab="mainboard"]::after,
.build-tabs button[data-tab="cpu"]::after,
.build-tabs button[data-tab="ram"]::after,
.build-tabs button[data-tab="psu"]::after,
.build-tabs button[data-tab="ssd"]::after {
    content: " *";
    color: #E60000;
}

/* ================= RESPONSIVE ================= */

@media (max-width: 768px) {

    .build-tabs {
        gap: 8px;
    }

    .build-tabs button {
        font-size: 12px;
        padding: 8px 12px;
    }

    .build-card img {
        height: 150px;
    }

    .build-summary {
        margin-top: 20px;
    }
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* dots */
.slider-dots {
    position: absolute;
    bottom: 15px;
    width: 100%;
    text-align: center;
}

.dot {
    width: 8px;
    height: 8px;
    margin: 0 5px;
    display: inline-block;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
}

.dot.active {
    background: #E60000;
}

/* responsive */
@media (max-width: 768px) {
    .slider-container {
        height: 220px;
    }
}



.promo-card img {
    width: 100%;
    height: 220px;
    object-fit: contain;
    background: #111;
    margin-bottom: 15px;
}
.promo-card h3 {
    font-size: 15px;
    font-weight: 500;
    margin: 10px 0;
    color: #fff;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;

    line-clamp: 2;            
    overflow: hidden;
}


/* =========================
   PRODUCT DETAIL BUTTONS
========================= */

.detail-actions {
    display: flex;
    gap: 14px;
    margin-top: 25px;
}

/* Base Button */
.btn {
    min-width: 160px;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s ease;
    text-align: center;
}

/* Primary (Buy Now) */
.btn-primary {
    background: #ff3b30;
    color: #fff;
    border: none;
}

.btn-primary:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

/* Outline (Add to Cart) */
.btn-outline {
    background: transparent;
    border: 1px solid currentColor;
}
/* ================= BUILD CONTAINER ================= */

.build-container {
    max-width: 1300px;
    margin: 40px auto;
    padding: 20px;
}

/* ================= DARK THEME ================= */

body.theme-dark .build-container h1 {
    color: #fff;
}

body.theme-dark .build-tabs button {
    background: #111;
    border: 1px solid #333;
    color: #ccc;
}

body.theme-dark .build-tabs button:hover {
    border-color: #E60000;
    color: #fff;
}

body.theme-dark .build-tabs button.active {
    background: #E60000;
    color: #fff;
    box-shadow: 0 0 10px rgba(230,0,0,0.4);
}

body.theme-dark #buildProducts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

body.theme-dark .build-card {
    background: #141414;
    border: 1px solid #222;
    border-radius: 12px;
    overflow: hidden;
    transition: 0.25s ease;
}

body.theme-dark .build-card:hover {
    transform: translateY(-5px);
    border-color: #E60000;
    box-shadow: 0 0 15px rgba(230,0,0,0.25);
}

body.theme-dark .build-card h4 {
    color: #eee;
}

body.theme-dark .build-card .price {
    color: #E60000;
}

body.theme-dark .build-summary {
    background: #111;
    border: 1px solid #222;
    color: #ccc;
}

body.theme-dark #buildTotal {
    color: #E60000;
}

body.theme-dark #checkoutBuild {
    background: #E60000;
    color: #fff;
}

body.theme-dark #checkoutBuild:disabled {
    background: #333;
}

/* ================= LIGHT THEME ================= */

body.theme-light .build-container h1 {
    color: #111;
}

body.theme-light .build-tabs button {
    background: #f5f5f5;
    border: 1px solid #ddd;
    color: #333;
}

body.theme-light .build-tabs button:hover {
    border-color: #E60000;
}

body.theme-light .build-tabs button.active {
    background: #E60000;
    color: #fff;
}

body.theme-light .build-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    transition: 0.25s ease;
}

body.theme-light .build-card:hover {
    transform: translateY(-5px);
    border-color: #E60000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

body.theme-light .build-card h4 {
    color: #222;
}

body.theme-light .build-card .price {
    color: #E60000;
}

body.theme-light .build-summary {
    background: #fafafa;
    border: 1px solid #ddd;
    color: #333;
}

body.theme-light #buildTotal {
    color: #E60000;
}

body.theme-light #checkoutBuild {
    background: #E60000;
    color: #fff;
}

body.theme-light #checkoutBuild:disabled {
    background: #bbb;
}

/* ================= COMMON ================= */

.build-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 30px;
}

.build-tabs button {
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.25s ease;
    font-size: 14px;
}

.build-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.build-card-content {
    padding: 12px;
}

.build-summary {
    border-radius: 14px;
    padding: 20px;
    margin-top: 30px;
}

#checkoutBuild {
    margin-top: 15px;
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.25s ease;
}
/* ================= TAB PREVIEW ================= */

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}
/* STOCK DISPLAY */

.stock-info {
    margin-top: 6px;
    font-size: 12px;
}
/* ================= DELETE BUTTON ================= */
/* ================= DELETE MODAL ================= */

.delete-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.delete-box {
    background: #111;
    padding: 30px;
    border-radius: 12px;
    width: 320px;
    text-align: center;
    border: 1px solid #222;
}

body.theme-light .delete-box {
    background: #fff;
    border: 1px solid #ddd;
}

.delete-box h3 {
    margin-bottom: 10px;
}

.delete-box p {
    font-size: 14px;
    margin-bottom: 20px;
    opacity: 0.7;
}

.delete-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}
/* ================= ACTION COLUMN ================= */

.action-cell {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Base style */
.action-link {
    font-size: 14px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-decoration: none;
    transition: 0.2s ease;
    color: #888;
}

/* View */
.action-link.view:hover {
    color: #4CAF50;
}

/* Edit */
.action-link.edit:hover {
    color: #2196F3;
}

/* Delete */
.action-link.delete {
    color: #E60000;
}

.action-link.delete:hover {
    opacity: 0.7;
}

/* Dark theme */
body.theme-dark .action-link {
    color: #bbb;
}

body.theme-dark .action-link.delete {
    color: #ff4d4d;
}

/* Light theme */
body.theme-light .action-link {
    color: #555;
}

body.theme-light .action-link.delete {
    color: #d00000;
}

.btn-cancel {
    flex: 1;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #666;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.btn-confirm {
    flex: 1;
    padding: 8px;
    border-radius: 6px;
    border: none;
    background: #E60000;
    color: #fff;
    text-decoration: none;
    text-align: center;
    transition: 0.2s;
}

.btn-confirm:hover {
    background: #ff1a1a;
}

.btn-delete {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 6px;
    border: 1px solid #E60000;
    background: transparent;
    color: #E60000;
    cursor: pointer;
    text-decoration: none;
    transition: 0.2s ease;
}

.btn-delete:hover {
    background: #E60000;
    color: #fff;
}

/* Light theme support */

body.theme-light .btn-delete {
    border: 1px solid #d00000;
    color: #d00000;
}

body.theme-light .btn-delete:hover {
    background: #d00000;
    color: #fff;
}

.stock-in {
    color: #4CAF50;
}

.stock-out {
    color: #ff4d4d;
    font-weight: 600;
}

/* Disabled Button */

.add-btn:disabled {
    background: #444;
    cursor: not-allowed;
}

.tab-preview {
    margin-top: 6px;
    height: 40px;
}

.preview-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid #E60000;
}

/* ADD BUTTON */

.add-btn {
    margin-top: 8px;
    width: 100%;
    padding: 6px;
    border-radius: 6px;
    border: none;
    background: #E60000;
    color: #fff;
    cursor: pointer;
    transition: 0.2s;
    font-size: 13px;
}

.add-btn:hover {
    background: #ff1a1a;
}

/* Required star */
.build-tabs button[data-tab="case"]::after,
.build-tabs button[data-tab="mainboard"]::after,
.build-tabs button[data-tab="cpu"]::after,
.build-tabs button[data-tab="ram"]::after,
.build-tabs button[data-tab="psu"]::after,
.build-tabs button[data-tab="ssd"]::after {
    content: " *";
    color: #E60000;
}

/* Responsive */

@media (max-width: 768px) {

    .build-tabs button {
        font-size: 12px;
        padding: 8px 12px;
    }

    .build-card img {
        height: 150px;
    }
}

/* Dark Mode */
.theme-dark .btn-outline {
    color: #fff;
    border-color: #444;
}

.theme-dark .btn-outline:hover {
    background: #1a1a1a;
}

/* Light Mode */
.theme-light .btn-outline {
    color: #111;
    border-color: #ccc;
}

.theme-light .btn-outline:hover {
    background: #f5f5f5;
}

/* Responsive */
@media (max-width: 480px) {
    .detail-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}
/* ================= CART LAYOUT ================= */

.cart-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

.cart-item {
    display: flex;
    gap: 20px;
    padding: 15px 0;
    border-bottom: 1px solid #333;
}

.cart-image {
    width: 90px;
    height: 90px;
    object-fit: contain;
}

.cart-total {
    margin-left: auto;
    text-align: right;
}

.remove-link {
    display: block;
    font-size: 12px;
    color: #ff3b30;
    margin-top: 5px;
}

.summary-box {
    padding: 25px;
    border-radius: 10px;
}

.theme-dark .summary-box {
    background: #111;
    border: 1px solid #1f1f1f;
}

.theme-light .summary-box {
    background: #fff;
    border: 1px solid #e5e5e5;
}

.full-btn {
    width: 100%;
    margin-top: 15px;
}

/* ================= PAYMENT LAYOUT ================= */

.payment-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

.payment-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px 0;
    border-bottom: 1px solid #333;
}

.payment-item img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.qr-img {
    width: 180px;
    margin: 20px 0;
}

/* Responsive */

@media (max-width: 768px) {

    .cart-layout,
    .payment-layout {
        grid-template-columns: 1fr;
    }

}
/* =========================
   PAYMENT REDESIGN
========================= */

.payment-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 50px;
}

/* LEFT CARD */

.payment-items-card {
    padding: 30px;
    border-radius: 14px;
}

.theme-dark .payment-items-card {
    background: #111;
    border: 1px solid #1f1f1f;
}

.theme-light .payment-items-card {
    background: #fff;
    border: 1px solid #e5e5e5;
}

.payment-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    border-bottom: 1px solid #222;
}

.theme-light .payment-item-row {
    border-bottom: 1px solid #eee;
}

.payment-item-left {
    display: flex;
    gap: 18px;
    align-items: center;
}

.payment-item-left img {
    width: 70px;
    height: 70px;
    object-fit: contain;
}

.payment-item-price {
    font-weight: 600;
}

/* RIGHT CARD */

.payment-summary-card {
    padding: 30px;
    border-radius: 14px;
    height: fit-content;
}

.theme-dark .payment-summary-card {
    background: #111;
    border: 1px solid #1f1f1f;
}

.theme-light .payment-summary-card {
    background: #fff;
    border: 1px solid #e5e5e5;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.summary-total {
    font-size: 20px;
    font-weight: 600;
    color: #ff3b30;
}

.qr-box {
    text-align: center;
    margin: 20px 0;
}

.qr-box img {
    width: 160px;
    margin-bottom: 8px;
}

.upload-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
}

.full-btn {
    width: 100%;
    margin-top: 15px;
}

/* Responsive */

@media (max-width: 768px) {
    .payment-wrapper {
        grid-template-columns: 1fr;
    }
}
/* =========================
   PAYMENT PAGE STRUCTURE
========================= */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.payment-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 50px;
    margin-top: 50px;
}

/* LEFT CARD */

.payment-left-card {
    padding: 30px;
    border-radius: 14px;
}

.theme-dark .payment-left-card {
    background: #111;
    border: 1px solid #1f1f1f;
}

.theme-light .payment-left-card {
    background: #ffffff;
    border: 1px solid #e5e5e5;
}

.payment-title {
    margin-bottom: 20px;
}

.payment-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    border-bottom: 1px solid #222;
}

.theme-light .payment-row {
    border-bottom: 1px solid #eee;
}

.payment-row-left {
    display: flex;
    gap: 18px;
    align-items: center;
}

.payment-row-left img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.payment-product-info h4 {
    margin: 0;
    font-size: 14px;
}

.payment-product-info p {
    font-size: 13px;
    opacity: 0.7;
}

.payment-row-right {
    font-weight: 600;
}

/* RIGHT SUMMARY */

.payment-summary-card {
    padding: 30px;
    border-radius: 14px;
    height: fit-content;
}

.theme-dark .payment-summary-card {
    background: #111;
    border: 1px solid #1f1f1f;
}

.theme-light .payment-summary-card {
    background: #ffffff;
    border: 1px solid #e5e5e5;
}

.summary-total-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.summary-total-price {
    font-size: 20px;
    font-weight: 600;
    color: #ff3b30;
}

.qr-section {
    text-align: center;
    margin: 20px 0;
}

.qr-section img {
    width: 180px;
    margin-bottom: 8px;
}

.upload-label {
    display: block;
    font-size: 14px;
    margin-bottom: 6px;
}

.full-width-btn {
    width: 100%;
    margin-top: 15px;
}

/* Responsive */

@media (max-width: 768px) {
    .payment-container {
        grid-template-columns: 1fr;
    }
}


.promotion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}
.card-link {
    text-decoration: none;
    color: inherit;
}


.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.content {
    flex: 1;
    padding: 20px 0;
}

.content > * {
    max-width: 1200px;
    margin: 0 auto 40px auto;
    padding: 0 20px;
}

/* ================================
   CART PAGE (CLEAN VERSION)
================================ */

.cart-page {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 50px;
    margin-top: 50px;
}

/* LEFT CARD */

.cart-items-card {
    padding: 30px;
    border-radius: 14px;
}

.theme-dark .cart-items-card {
    background: #111;
    border: 1px solid #1f1f1f;
}

.theme-light .cart-items-card {
    background: #ffffff;
    border: 1px solid #e5e5e5;
}

.cart-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #222;
}

.theme-light .cart-item-row {
    border-bottom: 1px solid #eee;
}

.cart-left {
    display: flex;
    gap: 18px;
    align-items: center;
}

.cart-left img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.cart-left h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
}

.cart-left p {
    font-size: 13px;
    opacity: 0.7;
}

.cart-right {
    text-align: right;
    font-weight: 600;
}

.remove-link {
    display: block;
    font-size: 12px;
    margin-top: 6px;
    color: #ff3b30;
    text-decoration: none;
}

/* RIGHT CARD */

.cart-summary-card {
    padding: 30px;
    border-radius: 14px;
    height: fit-content;
}

.theme-dark .cart-summary-card {
    background: #111;
    border: 1px solid #1f1f1f;
}

.theme-light .cart-summary-card {
    background: #ffffff;
    border: 1px solid #e5e5e5;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
}

.summary-price {
    font-size: 20px;
    font-weight: 600;
    color: #ff3b30;
}

.full-width {
    width: 100%;
    margin-top: 20px;
}

.empty-text {
    opacity: 0.7;
    margin-top: 20px;
}

/* Responsive */

@media (max-width: 768px) {
    .cart-page {
        grid-template-columns: 1fr;
    }
}
a {
    text-decoration: none;
    color: inherit;
}

/* ==============================
   ADD TO CART POPUP
============================== */

.cart-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.cart-popup-box {
    width: 750px;
    max-width: 95%;
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 30px;
    padding: 30px;
    border-radius: 16px;
    animation: scaleIn 0.2s ease forwards;
}

.theme-dark .cart-popup-box {
    background: #111;
    border: 1px solid #1f1f1f;
}

.theme-light .cart-popup-box {
    background: #ffffff;
    border: 1px solid #e5e5e5;
}

.cart-popup-left img {
    width: 100%;
    object-fit: contain;
}

.popup-price {
    font-size: 20px;
    font-weight: 600;
    color: #ff3b30;
}

.popup-stock {
    margin: 8px 0;
    opacity: 0.8;
}

.popup-desc {
    font-size: 14px;
    margin: 15px 0;
    opacity: 0.8;
}

.qty-box {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
}

.qty-box button {
    width: 32px;
    height: 32px;
    border: none;
    cursor: pointer;
}

.theme-dark .qty-box button {
    background: #222;
    color: #fff;
}

.theme-light .qty-box button {
    background: #eee;
    color: #000;
}

.qty-box input {
    width: 60px;
    text-align: center;
    padding: 6px;
}

.popup-actions {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

@media (max-width: 768px) {
    .cart-popup-box {
        grid-template-columns: 1fr;
    }
}

/* =========================
   NAVBAR
========================= */
.navbar {
    width: 100%;
    padding: 15px 0;
    border-bottom: 1px solid #222;
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;

    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 20px;
}


.nav-menu button {
    margin-left: 10px;
    padding: 6px 10px;
    cursor: pointer;
    border: 1px solid #888;
    background: transparent;
}



/* =========================
   SLIDER
========================= */
.slider-placeholder {
    height: 280px;
    max-width: 1200px;
    margin: 0 auto 40px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* =========================
   ADMIN LAYOUT
========================= */

.admin-root {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 240px;
    padding: 30px 20px;
    background: #111;
    display: flex;
    flex-direction: column;
}

.theme-light .admin-sidebar {
    background: #fff;
    border-right: 1px solid #e5e5e5;
}

.admin-logo {
    font-weight: bold;
    margin-bottom: 30px;
    font-size: 16px;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-link {
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    color: inherit;
}

.admin-link.active {
    background: #ff3b30;
    color: white;
}
.admin-bottom {
    margin-top: auto;  /* ดันลงล่างสุด */
}

.admin-content {
    flex: 1;
    padding: 40px;
}
/* =========================
   STATUS PAGE
========================= */

.status-header {
    margin-bottom: 30px;
}

.status-header h1 {
    font-size: 28px;
    margin-bottom: 5px;
}

.status-header p {
    opacity: 0.6;
}

.status-grid {
    display: grid;
    gap: 20px;
}

.status-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255,255,255,0.05);
    transition: 0.2s ease;
}

.status-card:hover {
    transform: translateY(-3px);
}

.status-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.status-label {
    font-size: 12px;
    opacity: 0.5;
}

.status-badge.paid {
    background: #00c853;
    color: white;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
}
.order-items-preview {
    margin-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 10px;
}

.order-item-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    opacity: 0.9;
}
.order-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 13px;
}

.order-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.order-item-image img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}

.order-item-info {
    display: flex;
    flex-direction: column;
}

.item-name {
    font-weight: 500;
}

.item-qty {
    font-size: 12px;
    opacity: 0.6;
}

.item-name {
    font-weight: 500;
}
.inline-form {
    display:inline-block;
    margin-right:6px;
}

.slip-modal {
    display:none;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.8);
    justify-content:center;
    align-items:center;
    z-index:9999;
}
.row-warning {
    background: rgba(255,193,7,0.06);
}

.badge {
    padding:4px 8px;
    border-radius:6px;
    font-size:12px;
    font-weight:600;
}

.badge-success { background:#2ecc71; color:#fff; }
.badge-danger { background:#ff3b30; color:#fff; }
.badge-warning { background:#f1c40f; color:#000; }
.badge-neutral { background:#444; color:#fff; }

.inline-form {
    display:inline-block;
    margin-right:6px;
}

.approved-label {
    color:#2ecc71;
    font-weight:600;
}

.rejected-label {
    color:#ff3b30;
    font-weight:600;
}

.slip-modal {
    display:none;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.85);
    justify-content:center;
    align-items:center;
    z-index:9999;
}
/* ================= DASHBOARD ================= */

.dashboard-wrapper {
    padding: 30px;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.dashboard-card {
    background: linear-gradient(145deg, #0f0f0f, #151515);
    border-radius: 16px;
    padding: 28px;
    transition: 0.3s ease;
    border: 1px solid rgba(255,255,255,0.05);
    position: relative;
    overflow: hidden;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.6);
}

.dashboard-card::after {
    content: '';
    position: absolute;
    top: -40%;
    right: -40%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,0,0,0.15), transparent);
    opacity: 0;
    transition: 0.4s;
}

.dashboard-card:hover::after {
    opacity: 1;
}

.card-label {
    font-size: 14px;
    color: #888;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 6px;
}

.card-sub {
    font-size: 13px;
    color: #666;
}

/* Special Colors */
.revenue .card-value {
    color: #ff3b30;
}

.orders .card-value {
    color: #f1c40f;
}

.customers .card-value {
    color: #3498db;
}

.status-ok {
    color: #2ecc71;
}

/* Responsive fix */
@media (max-width: 768px) {
    .dashboard-wrapper {
        padding: 20px;
    }

    .card-value {
        font-size: 26px;
    }
}

.slip-modal-content {
    background:#111;
    padding:20px;
    border-radius:12px;
    max-width:600px;
    width:90%;
    text-align:center;
}

.slip-modal-content img {
    max-width:100%;
    border-radius:8px;
}

.slip-close {
    position:absolute;
    right:30px;
    top:20px;
    font-size:28px;
    cursor:pointer;
    color:#fff;
}

.slip-modal-content {
    background:#111;
    padding:20px;
    border-radius:12px;
    max-width:600px;
    width:90%;
    text-align:center;
}

.slip-modal-content img {
    max-width:100%;
    border-radius:8px;
}

.slip-close {
    position:absolute;
    right:30px;
    top:20px;
    font-size:28px;
    cursor:pointer;
    color:#fff;
}

.item-qty {
    font-size: 12px;
    opacity: 0.6;
}

.status-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.shipping.preparing {
    color: orange;
}

.empty-status {
    text-align: center;
    padding: 60px 20px;
    opacity: 0.7;
}

.empty-icon {
    font-size: 40px;
    margin-bottom: 15px;
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.admin-card {
    padding: 30px;
    border-radius: 14px;
    background: #111;
}

.theme-light .admin-card {
    background: #ffffff;
    border: 1px solid #e5e5e5;
}


/* =========================
   PROMOTION GRID
========================= */
.promotion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}
/* LOGO LEFT */
.logo {
    font-weight: bold;
}

/* SEARCH CENTER */
.search-center {
    display: flex;
    justify-content: center;
}

.search-center input {
    width: clamp(250px, 40vw, 600px);
    padding: 10px 15px;
    border-radius: 30px;
    border: 1px solid #333;
}
.product-detail-container {
    max-width: 1200px;
    margin: 50px auto;
    display: flex;
    gap: 60px;
    align-items: flex-start;
}

.product-image {
    flex: 1;
    position: relative;
}

.product-image img {
    width: 100%;
    max-width: 450px;
    background: #111;
    padding: 20px;
    border-radius: 10px;
}

.product-info {
    flex: 1;
}

.product-meta {
    color: gray;
    margin-bottom: 8px;
}

.price-box {
    margin-top: 20px;
    margin-bottom: 20px;
}
.price-original {
    color: red;
    text-decoration: line-through;
}


.stock {
    color: #00ff88;
    font-weight: bold;
}

.back-link {
    color: #9b59ff;
    text-decoration: none;
}

.badge-group {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 8px;
}

.badge {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
}


.badge-sale {
    background: red;
}

.badge-hot {
    background: orange;
}
/* ===================== */
/* Popup Overlay */
/* ===================== */

.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease-in-out;
    z-index: 9999;
}

.popup {
    background: #fff;
    padding: 30px 40px;
    border-radius: 12px;
    width: 340px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    transform: scale(0.8);
    animation: scaleIn 0.25s ease forwards;
    font-family: Arial, sans-serif;
}

.popup .icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.popup h3 {
    margin-bottom: 10px;
}

.popup p {
    font-size: 14px;
    margin-bottom: 20px;
}

.popup.success {
    border-top: 4px solid #2ecc71;
}

.popup.error {
    border-top: 4px solid #e74c3c;
}

.popup button {
    background: #111;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
}

.popup button:hover {
    opacity: 0.8;
}
/* =========================
   MINIMAL THEME TOGGLE
========================= */

.theme-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    position: relative;
}

.theme-btn .icon {
    position: absolute;
    left: 0;
    top: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Dark mode → show sun */
.theme-dark .sun {
    opacity: 1;
    transform: rotate(0deg);
}

.theme-dark .moon {
    opacity: 0;
    transform: rotate(-90deg);
}

/* Light mode → show moon */
.theme-light .sun {
    opacity: 0;
    transform: rotate(90deg);
}

.theme-light .moon {
    opacity: 1;
    transform: rotate(0deg);
}
/* =========================
   MINIMAL BOX THEME TOGGLE
========================= */

.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s ease;
}

.theme-toggle .icon {
    position: absolute;
    font-size: 18px;
    transition: opacity 0.2s ease;
}

/* DARK MODE */
.theme-dark .theme-toggle {
    background: #fff;       /* white box */
    color: #000;            /* sun color */
}

.theme-dark .sun {
    opacity: 1;
}

.theme-dark .moon {
    opacity: 0;
}

/* LIGHT MODE */
.theme-light .theme-toggle {
    background: #000;       /* black box */
    color: #fff;            /* moon color */
}

.theme-light .sun {
    opacity: 0;
}

.theme-light .moon {
    opacity: 1;
}
.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    height: 34px;
    padding: 0 16px;

    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;

    transition: 0.2s;
}

.nav-btn.primary {
    background: #13a5ff;
    color: #fff;
}

.nav-btn.primary:hover {
    opacity: 0.85;
}

.nav-btn:not(.primary) {
    background: #ff0000;
    color: #fff;
}
/* =========================
   HEADER TEXT NAV
========================= */

.nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    color: #fff;
    text-decoration: none;
    font-size: 14px;
    padding: 6px 0;

    transition: 0.2s;
}
/* =========================
   ADMIN FORM DESIGN
========================= */

.admin-form-card {
    max-width: 900px;
    margin: 40px auto;
    padding: 35px;
    border-radius: 14px;
}

.theme-dark .admin-form-card {
    background: #111;
    border: 1px solid #1f1f1f;
}

.theme-light .admin-form-card {
    background: #fff;
    border: 1px solid #e5e5e5;
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 14px;
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #333;
    background: transparent;
    color: inherit;
}

.theme-light .form-group input,
.theme-light .form-group select,
.theme-light .form-group textarea {
    border: 1px solid #ddd;
}
.image-preview-box {
    margin: 15px 0;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
}

.theme-dark .image-preview-box {
    background: #0f0f0f;
    border: 1px solid #1f1f1f;
}

.theme-light .image-preview-box {
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
}

.image-preview-box img {
    max-width: 160px;
    border-radius: 6px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ff3b30;
}
.admin-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.table-img {
    width: 60px;
    border-radius: 6px;
}

.action-cell {
    display: flex;
    gap: 10px;
}

.action-link {
    text-decoration: none;
    font-size: 13px;
}

.action-link.delete {
    color: #ff3b30;
}

.action-link:hover {
    opacity: 0.6;
}
/* =========================
   PAGE CONTAINER
========================= */

.page-container {
    width: 100%;
    max-width: 1200px;
    margin: 50px auto;
    padding: 0 20px;
}

/* =========================
   TABLE WRAPPER
========================= */

.table-wrapper {
    padding: 25px;
    border-radius: 14px;
    overflow-x: auto;
}

.theme-dark .table-wrapper {
    background: #111;
    border: 1px solid #1f1f1f;
}

.theme-light .table-wrapper {
    background: #ffffff;
    border: 1px solid #e5e5e5;
}

/* TABLE IMPROVE */

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    font-size: 13px;
    opacity: 0.7;
    padding: 12px;
    text-align: left;
}

table td {
    padding: 14px 12px;
    font-size: 14px;
}
/* =========================
   SIMPLE NAVBAR (Auth Page)
========================= */

.simple-navbar {
    width: 100%;
    padding: 18px 0;
    border-bottom: 1px solid;
}

.theme-dark .simple-navbar {
    background: #111;
    border-color: #222;
}

.theme-light .simple-navbar {
    background: #fff;
    border-color: #e5e5e5;
}

.simple-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;

    display: flex;
    justify-content: space-between;
    align-items: center;
}

.simple-navbar .logo a {
    text-decoration: none;
    font-weight: bold;
    font-size: 18px;
    color: inherit;
}
/* =========================
   AUTH PAGE BACKGROUND FIX
========================= */

.auth-page-wrapper {
    min-height: 100vh;
}

/* Dark Theme */
.theme-dark .auth-page-wrapper {
    background: #0e0e0e;
}

/* Light Theme */
.theme-light .auth-page-wrapper {
    background: #f4f4f4;
}

table tr {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.theme-light table tr {
    border-bottom: 1px solid #eee;
}

table tr:hover {
    background: rgba(255,255,255,0.03);
}

.theme-light table tr:hover {
    background: #f9f9f9;
}
/* =========================
   AUTH ROOT (ISOLATED)
========================= */

.auth-root {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* BACKGROUND CONTROL */

.theme-dark .auth-root {
    background: #0e0e0e;
}

.theme-light .auth-root {
    background: #f4f4f4;
}

/* CENTER SECTION */

.auth-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* =========================
   AUTH CARD IMPROVED
========================= */

.auth-card {
    width: 100%;
    max-width: 520px;      /* ใหญ่ขึ้น */
    padding: 60px 50px;    /* เพิ่ม padding */
    border-radius: 18px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.35);
    transition: all 0.3s ease;
}

/* Title */
.auth-title {
    margin-bottom: 35px;
    font-size: 28px;
    text-align: center;
}

/* Form Layout Vertical */
.auth-form {
    display: flex;
    flex-direction: column;   /* บังคับแนวตั้ง */
    gap: 18px;
}

/* Input */
.input-group input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 15px;
    border: 1px solid #333;
    background: transparent;
    color: inherit;
    transition: 0.2s;
}

.theme-light .input-group input {
    border: 1px solid #ddd;
}

.input-group input:focus {
    outline: none;
    border-color: #ff3b3b;
}

/* Button */
.auth-btn {
    margin-top: 10px;
    padding: 14px;
    border-radius: 10px;
    font-size: 15px;
    border: none;
    cursor: pointer;
    background: #ff3b3b;
    color: white;
    transition: 0.2s;
}

.auth-btn:hover {
    opacity: 0.9;
}

/* CARD */

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}

/* CARD COLOR */

.theme-dark .auth-card {
    background: #111;
}

.theme-light .auth-card {
    background: #ffffff;
}

.checkbox-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.form-section {
    margin: 20px 0;
}

.form-actions {
    margin-top: 25px;
}

.btn.small {
    padding: 6px 12px;
    font-size: 13px;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.nav-link:hover {
    opacity: 0.6;
}
.theme-light .nav-link {
    color: #111;
}

.theme-light .nav-link:hover {
    opacity: 0.6;
}
.theme-light .nav-btn.primary {
    background: #111;
    color: #fff;
}
.theme-light .promo-card {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}

.theme-light .promo-card h3 {
    color: #111;
}

.theme-light .price-normal {
    color: #555;
}

.theme-light .price-sale {
    color: #111;
}
.theme-light .search-center input {
    background: #ffffff;
    border: 1px solid #ddd;
    color: #111;
}
.theme-light .badge-sale {
    background: #ff3b30;
}

.theme-light .badge-hot {
    background: #ff9500;
}

.theme-light .badge-best {
    background: #34c759;
}


/* =========================
   SUB NAVIGATION
========================= */

.sub-nav {
    background: #0d0d0d;
    border-top: 1px solid #1a1a1a;
    border-bottom: 1px solid #1a1a1a;
}

.sub-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 20px;

    display: flex;
    gap: 40px;
}

.sub-link {
    color: #aaa;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.5px;
    position: relative;
    transition: 0.2s;
}

.sub-link:hover {
    color: #fff;
}

/* =========================
   PRODUCT CARD STYLE
========================= */

.product-card {
    display: flex;
    flex-direction: column;
    background: #111;
    border-radius: 14px;
    padding: 16px;
    text-decoration: none;
    color: inherit;
    transition: 0.25s ease;
    position: relative;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

/* IMAGE */
.product-image-box {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.product-image-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* TITLE */
.product-info-box h3 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #fff;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;

    line-clamp: 2;
}

/* PRICE */
.price-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-new {
    color: #ff3b30;
    font-weight: 600;
    font-size: 15px;
}

.price-old {
    color: #777;
    font-size: 13px;
    text-decoration: line-through;
}

/* DISCOUNT BADGE */
.discount-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #ff3b30;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}
.theme-light .product-card {
    background: #ffffff;
    border: 1px solid #e5e5e5;
}

.theme-light .product-info-box h3 {
    color: #111;
}

.theme-light .price-old {
    color: #aaa;
}
.sub-link.active {
    color: #fff;
    border-bottom: 2px solid #ff3b30;
    padding-bottom: 4px;
}

.theme-light .sub-link.active {
    color: #111;
    border-bottom: 2px solid #111;
}
/* =========================
   PAYMENT PAGE
========================= */

.payment-box {
    max-width: 520px;
    margin: 60px auto;
    padding: 35px;
    border-radius: 14px;
    text-align: center;
    transition: 0.3s;
}

.theme-dark .payment-box {
    background: #111;
    border: 1px solid #1f1f1f;
}

.theme-light .payment-box {
    background: #fff;
    border: 1px solid #e5e5e5;
}

.payment-order-info {
    margin-bottom: 20px;
    font-size: 15px;
}

.qr-section {
    margin: 20px 0;
}

.qr-img {
    width: 220px;
    margin: 15px 0;
}

.slip-form {
    margin-top: 20px;
}

.slip-form input[type="file"] {
    margin: 15px 0;
}

.confirm-btn {
    padding: 10px 24px;
    background: #ff3b30;
    border: none;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
}

.confirm-btn:hover {
    opacity: 0.85;
}



/* Animations */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    to { transform: scale(1); }
}

.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
    to { opacity: 0; transform: scale(0.9); }
}

.badge-best {
    background: green;
}


/* RIGHT MENU */
.nav-right {
    display: flex;
    align-items: center;   /* สำคัญมาก */
    gap: 18px;
}


.alert {
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.error-box {
    background-color: #ffe6e6;
    border: 1px solid #ff4d4d;
    color: #990000;
}

.success-box {
    background-color: #e6ffe6;
    border: 1px solid #33cc33;
    color: #006600;
}

/* =========================
   DARK MODE SEARCH
========================= */
.theme-dark .search-center input {
    background: #111;
    border: 1px solid #333;
    color: #fff;
}
.promo-card {
    position: relative;
    background: #0d0d0d;
    border: 1px solid #1a1a1a;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    transition: 0.2s;
}

.promo-card:hover {
    border-color: #333;
    transform: translateY(-4px);
}



.image-placeholder {
    height: 180px;
    background: #bbb;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================
   FOOTER
========================= */
.footer {
    text-align: center;
    padding: 15px;
    border-top: 1px solid #ccc;
}

/* =========================
   DARK THEME
========================= */
.theme-dark {
    background: #000;
    color: #fff;
}

.theme-dark .navbar,
.theme-dark .footer {
    background: #111;
    border-color: #333;
}

.theme-dark .nav-menu button {
    color: #fff;
    border-color: #555;
}

.theme-dark .slider-placeholder {
    background: #222;
}

.theme-dark .image-placeholder {
    background: #333;
}

.theme-dark .promo-card {
    border-color: #444;
}

/* =========================
   LIGHT THEME
========================= */

.theme-light {
    background: #f5f5f5;
    color: #111;
}

.theme-light .navbar {
    background: #ffffff;
    border-bottom: 1px solid #e5e5e5;
}

.theme-light .sub-nav {
    background: #ffffff;
    border-bottom: 1px solid #e5e5e5;
}

.theme-light .footer {
    background: #ffffff;
    border-top: 1px solid #e5e5e5;
}

/* =========================
   AUTH PAGE LAYOUT
========================= */

.auth-container {
    max-width: 420px;
    margin: 80px auto;
    padding: 40px;
    background: #111;
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(0,0,0,0.6);
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 20px;
}

.auth-container input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 6px;
    border: 1px solid #333;
    background: #000;
    color: #fff;
}

.auth-container button {
    width: 100%;
    padding: 10px;
    background: #9b59ff;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: 0.2s;
}

.auth-container button:hover {
    opacity: 0.85;
}


/* =========================
   RESPONSIVE
========================= */
@media (max-width: 768px) {

    .navbar {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .search-center {
        order: 2;
        width: 100%;
    }

    .search-center input {
        width: 100%;
    }

    .nav-right {
        order: 3;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    .logo {
        order: 1;
        text-align: center;
    }
    
}
/* =========================
   PRODUCT TABLE FIX (Dark Mode)
========================= */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table th,
table td {
    padding: 10px;
    border: 1px solid #333;
    text-align: center;
}

.theme-dark table {
    background: #111;
    color: #fff;
}

.theme-dark table th {
    background: #1a1a1a;
}

.theme-dark table td {
    background: #111;
}

.theme-dark table tr:hover {
    background: #1f1f1f;
}
/* =========================
   PRODUCT LIST LAYOUT FIX
========================= */

.products-container {
    max-width: 1200px;
    margin: 60px auto;
    padding: 30px;
    background: #111;
    border-radius: 12px;
    box-shadow: 0 0 25px rgba(0,0,0,0.6);
}

.products-container h1 {
    text-align: center;
    margin-bottom: 25px;
    color: #fff;
}

.products-container a {
    color: #9b59ff;
}

.products-container table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.products-container th,
.products-container td {
    padding: 12px;
    border: 1px solid #333;
    text-align: center;
    color: #fff;
}

.products-container th {
    background: #1a1a1a;
    font-weight: bold;
}

.products-container tr:hover {
    background: #1f1f1f;
    transition: 0.2s;
}

.products-container img {
    border-radius: 6px;
}
.fade-out {
    animation: fadeOut 0.3s ease forwards;
    pointer-events: none;
}
/* Success Icon */
.success-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #2ecc71;
    position: relative;
    margin: 0 auto 15px auto;
}

.success-icon::after {
    content: "";
    position: absolute;
    left: 18px;
    top: 30px;
    width: 20px;
    height: 10px;
    border: solid white;
    border-width: 0 0 4px 4px;
    transform: rotate(-45deg);
}




/* =========================
   MOBILE (≤480px)
========================= */
@media (max-width: 480px) {

    .content {
        padding: 10px 0;
    }

    .slider-placeholder {
        height: 160px;
        font-size: 14px;
        text-align: center;
        padding: 10px;
    }

    .promotion-section h2 {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .promotion-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 30px;
    }



    .image-placeholder {
        height: 140px;
    }

    .search-center input {
        width: 100%;
        font-size: 13px;
        padding: 8px 12px;
    }

    .nav-right button {
        padding: 5px 8px;
        font-size: 12px;
    }
}
/* =========================
   POPUP TEXT FIX
========================= */

.popup {
    color: #222;   /* บังคับให้ตัวหนังสือเข้ม */
}

.theme-dark .popup {
    background: #111;
    color: #fff;   /* ให้ popup ขาวบนพื้นดำ */
}

.popup h3 {
    font-weight: 600;
    margin-top: 10px;
}

.popup p {
    color: inherit;
}
/* =========================
   AUTH ROOT LAYOUT
========================= */

.auth-root {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.theme-dark .auth-root {
    background: #0e0e0e;
}

.theme-light .auth-root {
    background: #f4f4f4;
}

.auth-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 520px;
    padding: 60px 50px;
    border-radius: 18px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.35);
}

.theme-dark .auth-card {
    background: #111;
}

.theme-light .auth-card {
    background: #ffffff;
}

/* FORM */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 15px;
    border: 1px solid #333;
    background: transparent;
    color: inherit;
}

.theme-light .input-group input {
    border: 1px solid #ddd;
}

.auth-btn {
    margin-top: 10px;
    padding: 14px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    background: #ff3b3b;
    color: white;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.auth-switch a {
    text-decoration: none;
    font-weight: 600;
    margin-left: 5px;
}

/* =========================
   TABLET
========================= */
@media (min-width: 481px) and (max-width: 768px) {

    .promotion-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .slider-placeholder {
        height: 220px;
    }

    .image-placeholder {
        height: 160px;
    }
}
/* =========================
   LARGE DESKTOP
========================= */
@media (min-width: 1200px) {

    .promotion-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

