/* ================================================================
   Tài Nguyên MMO — Client-facing Styles
   Prefix: .mmo-*
   ================================================================ */

/* ── Wrapper ─────────────────────────────────────────────── */
.mmo-resource-page {
    width: 100%;
    padding: 0;
    font-family: inherit;
}

/* ── Category Tabs ──────────────────────────────────────── */
.mmo-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.mmo-category-btn {
    min-height: 36px;
    padding: 0 16px;
    border: none;
    border-radius: 4px;
    background: #303030;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: none;
    transition: background 0.2s, color 0.2s;
}

.mmo-category-btn:hover {
    background: #444;
}

.mmo-category-btn.active {
    background: #e8e8e8;
    color: #0072ce;
}

.mmo-category-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 3px;
    background: #fff;
    padding: 2px;
}

.mmo-category-icon-fallback {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 15px;
}

.mmo-category-header-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 4px;
    background: #fff;
    padding: 3px;
}

.mmo-category-header-fallback {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}

/* ── All Products Wrapper ─────────────────────────────── */
.mmo-all-categories {
    width: 100%;
}

/* ── Category Section ───────────────────────────────────── */
.mmo-category-section {
    margin-bottom: 36px;
}

.mmo-category-section.hidden {
    display: none;
}

.mmo-category-header {
    width: 100%;
    height: 45px;
    background: linear-gradient(90deg, #0077ff, #00c6e8);
    color: #fff;
    border-radius: 7px;
    box-shadow: 4px 5px 8px rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 18px;
    font-size: 18px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 16px;
}

/* ── All Products Section ───────────────────────────────── */
#mmo-all-section {
    margin-bottom: 36px;
}

/* ── Product Grid ──────────────────────────────────────── */
.mmo-product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

@media (max-width: 992px) {
    .mmo-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 576px) {
    .mmo-product-grid {
        grid-template-columns: 1fr;
    }

    .mmo-category-btn {
        font-size: 12px;
        padding: 0 10px;
    }
}

/* ── Product Card ──────────────────────────────────────── */
.mmo-product-card {
    background: #fff;
    border: 1px dashed #9aa0a6;
    border-radius: 5px;
    padding: 16px;
    min-height: 190px;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
}

.mmo-product-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.mmo-product-title {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    line-height: 1.55;
    min-height: 46px;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mmo-stock-badge {
    display: inline-block;
    background: #b12ac2;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 2px;
    margin-bottom: 7px;
    width: fit-content;
}

.mmo-price {
    color: #007bff;
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 9px;
}

.mmo-product-desc {
    font-size: 12px;
    color: #333;
    line-height: 1.45;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 12px;
    flex: 1;
}

.mmo-card-actions {
    margin-top: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.mmo-btn-detail,
.mmo-btn-buy {
    height: 34px;
    border-radius: 5px;
    border: none;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mmo-btn-detail {
    background: #e6e6e6;
    color: #111;
    transition: background 0.2s;
}

.mmo-btn-detail:hover {
    background: #d0d0d0;
}

.mmo-btn-buy {
    background: linear-gradient(90deg, #008cff, #00b7ff);
    color: #fff;
    transition: box-shadow 0.2s;
}

.mmo-btn-buy:hover {
    box-shadow: 0 3px 10px rgba(0,140,255,0.4);
}

/* ── Load More ─────────────────────────────────────────── */
.mmo-load-more-wrap {
    text-align: center;
    margin-top: 14px;
}

.mmo-load-more {
    background: #fff;
    border: 1px solid #aaa;
    border-radius: 6px;
    padding: 9px 28px;
    font-weight: 700;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    transition: background 0.2s, border-color 0.2s;
}

.mmo-load-more:hover {
    background: #f5f5f5;
    border-color: #888;
}

/* ── Buy Modal ─────────────────────────────────────────── */
.mmo-buy-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.mmo-buy-modal.active {
    display: flex;
}

.mmo-modal-inner {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
    animation: mmo-modal-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes mmo-modal-in {
    from { opacity: 0; transform: scale(0.92) translateY(-20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.mmo-modal-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    background: #fafafa;
    border-radius: 16px 16px 0 0;
}

.mmo-modal-hd-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mmo-modal-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.mmo-modal-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.mmo-modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 580px) {
    .mmo-modal-body { grid-template-columns: 1fr; }
}

.mmo-modal-left {
    padding: 20px;
    background: #f8fafc;
    border-right: 1px solid #f1f5f9;
}

@media (max-width: 580px) {
    .mmo-modal-left { border-right: none; border-bottom: 1px solid #f1f5f9; }
}

.mmo-modal-right {
    padding: 20px;
}

.mmo-mdl-name {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 10px;
    line-height: 1.4;
}

.mmo-mdl-stock {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: #f5f3ff;
    color: #7c3aed;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 10px;
}

.mmo-mdl-price {
    font-size: 26px;
    font-weight: 800;
    color: #16a34a;
    margin-bottom: 12px;
}

.mmo-mdl-desc {
    font-size: 13px;
    color: #64748b;
    line-height: 1.6;
}

.mmo-form-title {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mmo-balance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 9px;
    margin-bottom: 14px;
    font-size: 13px;
}

.mmo-balance-label { color: #64748b; }
.mmo-balance-val { font-weight: 700; color: #1e293b; }

.mmo-error-msg {
    padding: 10px 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
    font-size: 13px;
    margin-bottom: 12px;
    display: none;
}

.mmo-error-msg.show { display: block; }

.mmo-qty-row {
    display: flex;
    align-items: center;
    margin-bottom: 14px;
    gap: 0;
}

.mmo-qty-label {
    font-size: 13px;
    color: #64748b;
    width: 110px;
    flex-shrink: 0;
}

.mmo-qty-box {
    display: flex;
    align-items: center;
    border: 1.5px solid #e2e8f0;
    border-radius: 9px;
    overflow: hidden;
}

.mmo-qty-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #f8fafc;
    color: #475569;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mmo-qty-btn:hover { background: #e2e8f0; }

.mmo-qty-input {
    width: 56px;
    height: 36px;
    border: none;
    border-left: 1.5px solid #e2e8f0;
    border-right: 1.5px solid #e2e8f0;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    outline: none;
    -moz-appearance: textfield;
}

.mmo-qty-input::-webkit-inner-spin-button,
.mmo-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }

.mmo-coupon-row {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.mmo-coupon-input {
    flex: 1;
    padding: 9px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 9px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    color: #1e293b;
}

.mmo-coupon-input:focus { border-color: #6366f1; }

.mmo-coupon-apply {
    padding: 9px 16px;
    background: #f1f5f9;
    border: 1.5px solid #e2e8f0;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.mmo-coupon-apply:hover { background: #e2e8f0; }

.mmo-summary {
    background: #f8fafc;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
}

.mmo-sum-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 4px 0;
    color: #64748b;
}

.mmo-sum-row .val { font-weight: 600; color: #1e293b; }
.mmo-sum-row.discount { color: #dc2626; }
.mmo-sum-row.discount .val { color: #dc2626; }
.mmo-sum-row.total {
    font-size: 15px;
    font-weight: 800;
    color: #1e293b;
    border-top: 1.5px dashed #e2e8f0;
    margin-top: 6px;
    padding-top: 8px;
}

.mmo-pay-btn {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #fff;
    border: none;
    border-radius: 11px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mmo-pay-btn:hover {
    background: linear-gradient(135deg, #15803d, #14532d);
    box-shadow: 0 4px 16px rgba(22, 163, 74, 0.38);
}

.mmo-pay-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.mmo-fav-btn {
    width: 100%;
    padding: 10px;
    background: #fff;
    color: #64748b;
    border: 1.5px solid #e2e8f0;
    border-radius: 11px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.mmo-fav-btn:hover { background: #fef2f2; color: #dc2626; border-color: #fecaca; }

/* ── Toast ─────────────────────────────────────────────── */
.mmo-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    z-index: 99999;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    animation: mmo-toast-slide 0.3s ease;
    max-width: 320px;
}

@keyframes mmo-toast-slide {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

.mmo-toast.success { background: #16a34a; color: #fff; }
.mmo-toast.error   { background: #dc2626; color: #fff; }

/* ── Empty / Skeleton ──────────────────────────────────── */
.mmo-skeleton {
    padding: 40px 0;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

.mmo-skeleton-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0077ff, #00c6e8);
    animation: mmo-pulse 1.5s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mmo-skeleton-icon i { color: #fff; font-size: 20px; }

@keyframes mmo-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.95); }
}

.mmo-skeleton-text {
    font-weight: 600;
    color: #475569;
    margin-bottom: 4px;
}

.mmo-skeleton-sub {
    font-size: 12px;
    color: #94a3b8;
}

/* ── Load More (XEM THÊM) ────────────────────────────── */
.mmo-hidden-product {
    display: none !important;
}
