/* =================================================================
 * NUMATEC v2 — Layer 3 of 3: page-specific views
 *
 * Re-styles:
 *  - product list / detail
 *  - news list / detail (share buttons, related)
 *  - contact (form + map)
 *  - login / register / change-password
 *  - profile / avatar
 *  - search, compare, cart, checkout
 *  - generic main_content & contentck (rich text from TinyMCE)
 * ================================================================= */

/* ---------- 23. Main content wrapper ---------- */
.main_content { padding-bottom: 80px; background: #fff; }
.main_content + .footer { margin-top: 0; }

/* TinyMCE / rich-text rendered content */
.contentck {
    font-size: 15px;
    line-height: 1.75;
    color: var(--nm-text);
}
.contentck p { margin-bottom: 14px; }
.contentck h1, .contentck h2, .contentck h3, .contentck h4 {
    color: var(--nm-text);
    margin: 32px 0 14px;
    font-weight: 700;
}
.contentck h2 { font-size: 24px; padding-bottom: 8px; border-bottom: 2px solid var(--nm-border); }
.contentck h3 { font-size: 19px; color: var(--nm-primary); }
.contentck img {
    max-width: 100%;
    height: auto;
    border-radius: var(--nm-radius);
    margin: 16px 0;
    box-shadow: var(--nm-shadow-sm);
}
.contentck ul, .contentck ol { padding-left: 24px; margin: 12px 0 14px; }
.contentck ul li, .contentck ol li { margin-bottom: 6px; line-height: 1.7; }
.contentck a { color: var(--nm-accent); text-decoration: underline; text-underline-offset: 3px; }
.contentck a:hover { color: var(--nm-accent-hover); }
.contentck blockquote {
    border-left: 4px solid var(--nm-accent);
    background: var(--nm-bg-alt);
    padding: 16px 20px;
    margin: 20px 0;
    font-style: italic;
    color: var(--nm-text-muted);
}
.contentck table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
    border: 1px solid var(--nm-border);
}
.contentck table th,
.contentck table td {
    padding: 12px 14px;
    border: 1px solid var(--nm-border);
    text-align: left;
}
.contentck table th {
    background: var(--nm-bg-alt);
    font-weight: 700;
    color: var(--nm-text);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: .05em;
}
.contentck table tbody tr:nth-child(even) td { background: var(--nm-bg-alt); }

/* Generic page heading row used by product/news detail */
.main_content h1 {
    font-size: clamp(26px, 3vw, 36px);
    font-weight: 700;
    color: var(--nm-text);
    margin-bottom: 12px;
    line-height: 1.25;
    letter-spacing: -.01em;
}

/* ---------- 24. Product list / detail ---------- */
.main_content .pack-apps { padding-top: 48px; padding-bottom: 48px; }
.main_content .pack-apps > .container > .title {
    text-align: left;
    padding-bottom: 32px;
}
.main_content .pack-apps > .container > .title::before { display: none; }
.main_content .pack-apps > .container > .title h2 { text-align: left; margin: 0 0 8px; }

.product_gallery {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 32px;
    padding: 40px 0 32px;
    align-items: start;
}
.product_gallery .pic_larger {
    position: relative;
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius-md);
    overflow: hidden;
    background: #fff;
    aspect-ratio: 4/3;
}
.product_gallery .pic_larger a { display: block; height: 100%; }
.product_gallery .pic_larger img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--nm-bg-alt);
    background-image: var(--nm-grid-pattern);
    background-size: 16px 16px;
    padding: 24px;
    transition: transform .35s ease;
}
.product_gallery .pic_larger a:hover img { transform: scale(1.03); }
.product_gallery .pic_larger .viewmore {
    position: absolute;
    bottom: 14px;
    right: 14px;
    background: rgba(11, 31, 51, .85);
    color: #fff;
    padding: 8px 14px;
    border-radius: var(--nm-radius);
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(4px);
    text-transform: uppercase;
    letter-spacing: .05em;
    pointer-events: none;
}
.product_gallery .pic_larger .viewmore img { filter: brightness(0) invert(1); width: 16px; height: 16px; }

.product_gallery .list_small {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.product_gallery .list_small a {
    display: block;
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius);
    overflow: hidden;
    background: #fff;
    transition: var(--nm-transition-fast);
    aspect-ratio: 4/3;
}
.product_gallery .list_small a:hover {
    border-color: var(--nm-accent);
    transform: translateY(-2px);
    box-shadow: var(--nm-shadow);
}
.product_gallery .list_small img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--nm-bg-alt);
    padding: 8px;
}

.product_content {
    padding: 24px 0 32px;
    border-bottom: 1px solid var(--nm-border);
    margin-bottom: 24px;
}
.product_content h1 {
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 700;
    color: var(--nm-text);
    margin-bottom: 16px;
    line-height: 1.25;
    position: relative;
    padding-left: 20px;
}
.product_content h1::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 4px;
    background: var(--nm-accent);
    border-radius: 2px;
}

/* Download / spec sheet box */
.download {
    background: var(--nm-bg-alt);
    background-image: var(--nm-grid-pattern);
    background-size: 16px 16px;
    border: 1px solid var(--nm-border);
    border-left: 4px solid var(--nm-accent);
    border-radius: var(--nm-radius);
    padding: 24px 28px;
    margin: 32px 0;
}
.download .title_down {
    font-family: var(--nm-font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--nm-text);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.download .title_down::before {
    content: "";
    width: 22px;
    height: 22px;
    background: var(--nm-accent);
    mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'><path d='M12 3v12m0 0l-4-4m4 4l4-4M5 21h14'/></svg>") center/contain no-repeat;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'><path d='M12 3v12m0 0l-4-4m4 4l4-4M5 21h14'/></svg>") center/contain no-repeat;
    display: inline-block;
}
.download ul { padding: 0; margin: 0; list-style: none; }
.download li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--nm-border);
}
.download li:last-child { border-bottom: 0; }
.download li a {
    color: var(--nm-primary);
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--nm-transition-fast);
}
.download li a:hover { color: var(--nm-accent); }
.download li a::before {
    content: "↓";
    color: var(--nm-accent);
    font-weight: 700;
    font-size: 16px;
    margin-right: 2px;
}

@media (max-width: 768px) {
    .product_gallery { grid-template-columns: 1fr; gap: 16px; padding: 24px 0; }
    .product_gallery .list_small { grid-template-columns: repeat(4, 1fr); }
    .product_content h1 { padding-left: 14px; }
    .download { padding: 18px 20px; }
}

/* ---------- 25. News list ---------- */
/* (List news uses .cards.-alt which is already styled in layer 2;
   add small extras for the read-more arrow and pagination spacing) */
.cards .items .item .main .subtitle a {
    margin-top: 8px;
}

/* ---------- 26. News detail ---------- */
.news_dt {
    padding: 48px 0 32px;
    max-width: 920px;
    margin: 0 auto;
}
.news_dt .container { max-width: 100%; padding: 0; }
.news_dt .title {
    font-family: var(--nm-font-display);
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 700;
    color: var(--nm-text);
    line-height: 1.25;
    margin-bottom: 12px;
    letter-spacing: -.01em;
}
.news_dt .date {
    font-family: var(--nm-font-mono);
    font-size: 12px;
    color: var(--nm-text-muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 24px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.news_dt .date::before {
    content: "";
    width: 14px;
    height: 14px;
    background: var(--nm-accent);
    mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'><rect x='3' y='5' width='18' height='16' rx='2'/><path d='M3 9h18M8 3v4M16 3v4'/></svg>") center/contain no-repeat;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'><rect x='3' y='5' width='18' height='16' rx='2'/><path d='M3 9h18M8 3v4M16 3v4'/></svg>") center/contain no-repeat;
}
.news_dt .contentck { font-size: 15.5px; }
.news_dt .contentck > img:first-of-type {
    width: 100%;
    height: auto;
    border-radius: var(--nm-radius-md);
    margin: 0 0 24px;
}

.wrap_share {
    margin-top: 40px;
    padding: 24px 0;
    border-top: 1px solid var(--nm-border);
    border-bottom: 1px solid var(--nm-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}
.wrap_share .title_share {
    font-family: var(--nm-font-display);
    font-size: 14px;
    font-weight: 700;
    color: var(--nm-text);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.social_share { display: flex; gap: 10px; }
.share-btn { margin: 0; }
.share-btn__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--nm-bg-alt);
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius);
    color: var(--nm-text-muted);
    transition: var(--nm-transition-fast);
}
.share-btn__icon:hover {
    background: var(--nm-primary);
    border-color: var(--nm-primary);
    color: #fff;
    transform: translateY(-2px);
}
.share-btn__icon svg { width: 16px; height: 16px; fill: currentColor; }
.btn_facebook .share-btn__icon:hover { background: #1877f2; border-color: #1877f2; color: #fff; }
.btn_twitter .share-btn__icon:hover { background: #000; border-color: #000; color: #fff; }
.btn_linkedin .share-btn__icon:hover { background: #0a66c2; border-color: #0a66c2; color: #fff; }
.btn_email .share-btn__icon:hover { background: var(--nm-accent); border-color: var(--nm-accent); color: #fff; }

.bg_news_other {
    background: var(--nm-bg-alt);
    background-image: var(--nm-grid-pattern);
    background-size: 32px 32px;
    padding: 64px 0;
    margin-top: 64px;
}
.bg_news_other .title {
    font-family: var(--nm-font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--nm-text);
    margin-bottom: 28px;
    padding-left: 16px;
    border-left: 4px solid var(--nm-accent);
}
.bg_news_other .list_news {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}
.bg_news_other .list_news .item {
    display: flex;
    gap: 14px;
    background: #fff;
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius);
    padding: 12px;
    transition: var(--nm-transition);
}
.bg_news_other .list_news .item:hover {
    border-color: var(--nm-accent);
    box-shadow: var(--nm-shadow);
    transform: translateY(-2px);
}
.bg_news_other .list_news .item .pic {
    flex-shrink: 0;
    width: 96px;
    height: 72px;
    overflow: hidden;
    border-radius: var(--nm-radius-sm);
    display: block;
}
.bg_news_other .list_news .item .pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.bg_news_other .list_news .item .info { flex: 1; }
.bg_news_other .list_news .item .name {
    font-family: var(--nm-font-display);
    font-size: 14px;
    font-weight: 700;
    color: var(--nm-text);
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bg_news_other .list_news .item .name:hover { color: var(--nm-accent); }
.bg_news_other .list_news .item .desc {
    font-size: 12.5px;
    color: var(--nm-text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- 27. Contact ---------- */
.contact_dt {
    padding: 48px 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}
.contact_dt .container {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
    align-items: start;
}
.googlemap_contact {
    border-radius: var(--nm-radius-md);
    overflow: hidden;
    box-shadow: var(--nm-shadow);
    border: 1px solid var(--nm-border);
    background: var(--nm-bg-alt);
    aspect-ratio: 4/3;
}
.googlemap_contact iframe {
    width: 100% !important;
    height: 100% !important;
    border: 0;
    display: block;
}
.info_contact {
    background: var(--nm-bg-alt);
    border: 1px solid var(--nm-border);
    border-left: 4px solid var(--nm-accent);
    padding: 24px 28px;
    border-radius: var(--nm-radius);
    margin-top: 24px;
    grid-column: 1 / -1;
}
.info_contact strong { color: var(--nm-text); }

.frm_lienhe {
    grid-column: 1 / -1;
    background: #fff;
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius-md);
    padding: 32px;
    box-shadow: var(--nm-shadow-sm);
    position: relative;
    overflow: hidden;
}
.frm_lienhe::before {
    content: "GỬI LIÊN HỆ";
    display: block;
    font-family: var(--nm-font-mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--nm-accent);
    text-transform: uppercase;
    letter-spacing: .12em;
    margin-bottom: 4px;
}
.frm_lienhe::after {
    content: "Để lại thông tin, chúng tôi sẽ phản hồi trong vòng 24 giờ.";
    display: block;
    font-size: 14px;
    color: var(--nm-text-muted);
    margin-bottom: 24px;
}
.frm_lienhe form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.frm_lienhe .form-group { margin-bottom: 0; }
.frm_lienhe .form-group:nth-of-type(5),
.frm_lienhe .form-group:nth-of-type(6),
.frm_lienhe .form-group:last-child { grid-column: 1 / -1; }
.frm_lienhe .btn { font-size: 13px; padding: 14px 28px; }
.frm_lienhe .btn-danger { background: transparent; color: var(--nm-text-muted); border: 1px solid var(--nm-border); }
.frm_lienhe .btn-danger:hover { background: var(--nm-bg-alt); color: var(--nm-text); border-color: var(--nm-border-strong); }

@media (max-width: 900px) {
    .contact_dt .container { grid-template-columns: 1fr; gap: 24px; }
    .googlemap_contact { aspect-ratio: 16/9; }
    .frm_lienhe form { grid-template-columns: 1fr; }
    .frm_lienhe { padding: 24px; }
}

/* ---------- 28. Login / register ---------- */
.bg_login,
.bg_register,
.bg_changepassword,
.bg_profile {
    background: var(--nm-bg-alt);
    background-image: var(--nm-grid-pattern);
    background-size: 32px 32px;
    padding: 64px 0;
    min-height: 60vh;
}
.bg_login .container,
.bg_register .container,
.bg_changepassword .container {
    max-width: 480px;
}

.frm_login,
.frm_register,
.frm_changepassword {
    background: #fff;
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius-md);
    padding: 40px 32px;
    box-shadow: var(--nm-shadow-md);
    position: relative;
    overflow: hidden;
}
.frm_login::before,
.frm_register::before,
.frm_changepassword::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--nm-accent) 0%, var(--nm-accent-hover) 100%);
}
.frm_login .title,
.frm_register .title,
.frm_changepassword .title {
    font-family: var(--nm-font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--nm-text);
    text-align: center;
    margin-bottom: 8px;
}
.frm_login .subtitle,
.frm_register .subtitle,
.frm_changepassword .subtitle {
    font-family: var(--nm-font-mono);
    font-size: 12px;
    color: var(--nm-text-muted);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .12em;
    margin-bottom: 32px;
}

.login_other {
    text-align: center;
    margin-top: 18px;
    font-size: 13px;
    color: var(--nm-text-muted);
}
.login_other a {
    color: var(--nm-accent);
    font-weight: 600;
    text-decoration: none;
}
.login_other a:hover { color: var(--nm-accent-hover); text-decoration: underline; }

.frm_login .btn,
.frm_register .btn,
.frm_changepassword .btn {
    width: 100%;
    padding: 14px;
    font-size: 14px;
    background: var(--nm-primary);
}
.frm_login .btn:hover,
.frm_register .btn:hover,
.frm_changepassword .btn:hover { background: var(--nm-accent); }

/* ---------- 29. Profile / avatar ---------- */
.bg_profile { padding: 48px 0; }
.bg_profile .container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
}
.profile_left {
    background: #fff;
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius-md);
    padding: 24px;
    text-align: center;
    box-shadow: var(--nm-shadow-sm);
    height: fit-content;
    position: sticky;
    top: calc(var(--nm-header-height) + 16px);
}
.profile_left .avatar img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--nm-accent);
    margin: 0 auto 16px;
    object-fit: cover;
}
.profile_left .username {
    font-family: var(--nm-font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--nm-text);
    margin-bottom: 4px;
}
.profile_left .menu_profile {
    list-style: none;
    padding: 0;
    margin: 24px 0 0;
    text-align: left;
}
.profile_left .menu_profile li { border-top: 1px solid var(--nm-border); }
.profile_left .menu_profile li:first-child { border-top: 0; }
.profile_left .menu_profile a {
    display: block;
    padding: 12px 4px;
    font-size: 14px;
    color: var(--nm-text-muted);
    font-weight: 500;
    transition: var(--nm-transition-fast);
}
.profile_left .menu_profile a:hover,
.profile_left .menu_profile a.active {
    color: var(--nm-accent);
    padding-left: 8px;
}

.profile_right {
    background: #fff;
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius-md);
    padding: 32px;
    box-shadow: var(--nm-shadow-sm);
}

@media (max-width: 768px) {
    .bg_profile .container { grid-template-columns: 1fr; }
    .profile_left { position: static; }
}

/* ---------- 30. Search / compare / cart (defensive) ---------- */
.search_result, .compare_result, .cart_main, .checkout_main {
    padding: 32px 0;
    background: #fff;
}
.cart_main table, .checkout_main table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius);
    overflow: hidden;
}
.cart_main thead th, .checkout_main thead th {
    background: var(--nm-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 14px;
    text-align: left;
}
.cart_main tbody td, .checkout_main tbody td {
    padding: 16px 14px;
    border-bottom: 1px solid var(--nm-border);
    font-size: 14px;
}
.cart_main tbody tr:last-child td, .checkout_main tbody tr:last-child td { border-bottom: 0; }

/* ---------- 31. Slide_FT (legacy bottom slot) — neutralize ---------- */
.slide_FT { display: none; }

/* ---------- 32. Toastr notification overrides ---------- */
#toast-container .toast {
    border-radius: var(--nm-radius);
    box-shadow: var(--nm-shadow-md);
    font-family: var(--nm-font-sans);
    font-size: 14px;
}
#toast-container .toast-success { background-color: var(--nm-success); }
#toast-container .toast-error { background-color: var(--nm-danger); }
#toast-container .toast-warning { background-color: var(--nm-warning); }
#toast-container .toast-info { background-color: var(--nm-info); }

/* ---------- 33. Mobile menu toggle button ---------- */
.navbar-toggle {
    position: relative;
    width: 44px;
    height: 44px;
    background: var(--nm-primary);
    border-radius: var(--nm-radius);
    cursor: pointer;
    display: none;
    margin-left: auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 0;
}
.navbar-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
    transition: var(--nm-transition-fast);
}
.menu_mobile { padding: 0 !important; }

@media (max-width: 1199px) {
    .navbar-toggle { display: flex; }
    .menu-main { display: none; }
    .menu-main.is-open {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        border-top: 1px solid var(--nm-border);
        box-shadow: var(--nm-shadow-md);
        padding: 8px 0;
        z-index: 1100;
    }
    .menu-main.is-open > li > a {
        padding: 14px 24px;
        border-bottom: 1px solid var(--nm-border);
        justify-content: space-between;
        text-align: left;
    }
    .menu-main.is-open > li > ul {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: 0;
        border-top: 0;
        padding: 0;
        background: var(--nm-bg-alt);
        border-radius: 0;
    }
    .menu-top {
        margin: 0 -24px;
        width: calc(100% + 48px);
        flex-wrap: wrap;
        padding: 8px 16px;
        gap: 8px;
        min-height: 0;
    }
    .menu-top::after, .menu-top::before { display: none; }
    .menu-logo { gap: 0; flex-direction: column; }
    .menu-logo .logo { padding: 12px 0; }
    .menu-right { width: 100%; }
}

/* ---------- 34. Print ---------- */
@media print {
    .menu-top, .header_pc, .footer, #group-support-hotline, .breadcrumb, .nav, .wrap_share, .slide_FT {
        display: none !important;
    }
    body { background: #fff; color: #000; }
}

/* ---------- 35. Hide legacy decorative artifacts ---------- */
/* Hide stray `.title h2.title_other` placeholder borders and old gtranslate */
#goog-gt-tt, .goog-te-banner-frame { display: none !important; }
.goog-te-menu-value:hover { text-decoration: none !important; }
