/*
 * Mua Hàng Hiệu — application overrides on top of the Schön template (loaded last).
 * Keep visual rules in the template CSS; only app-specific components and fixes here.
 */

/*
 * Brand colours (logo): navy for structure, red for accents. The template's coral #ff6060 is
 * remapped to these on the elements visitors use most (links, menu, prices, buttons).
 */
:root {
    --mhm-brand: #0B2545;
    --mhm-accent: #D9363E;
    --mhm-accent-dark: #B3242C;
    --mhm-text: #2b2b2b;
    --mhm-muted: #555;
}

/* Accessibility: skip link + visible keyboard focus */
.skip-link {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10000;
    padding: 8px 16px;
    background: #fff;
    color: #000;
    border: 2px solid #000;
}
:focus-visible { outline: 2px solid var(--mhm-accent); outline-offset: 2px; }
#mt-main:focus { outline: none; }
#back-top { cursor: pointer; }

/* Header logo height */
.mt-logo img { max-height: 50px; width: auto; }

/*
 * Desktop dropdowns: the template makes li.drop position:static (for full-width mega menus), so the
 * 220px .s-drop was positioned against the header (far left), and li.drop:hover turned the label white.
 */
@media (min-width: 992px) {
    #nav > ul > li.drop { position: relative; }
    #nav > ul > li.drop:hover > a, #nav > ul > li.drop > a.active { color: var(--mhm-accent); }
    #nav > ul > li.drop > a:after { display: none; }
    #nav .s-drop { top: 100%; padding-top: 12px; }
    #nav .s-drop > ul { box-shadow: 0 8px 24px rgba(0, 0, 0, .08); }
    #nav > ul > li.drop:last-child .s-drop { left: auto; right: 0; }
}

/* Footer logo: template fixes .logo at 112px wide, which squashed the 417x100 logo */
#mt-footer .logo { width: auto; }
#mt-footer .logo img { width: auto; height: 50px; max-width: 100%; }

/* Page banner without the template's demo background photo */
.mhm-page-banner { background: #f6f6f6; padding: 40px 0 30px; }
.mhm-page-banner h1 { color: #494949; }

/*
 * Product images: fixed-size box (stable layout), image centred at its natural size or smaller.
 * Never width/height: 100% on the <img> — most originals are 250–320px and would be upscaled (blurry).
 */
.mt-product1 .b2 { vertical-align: middle; text-align: center; }
.mt-product1 .mhm-card-img { display: block; margin: 0 auto; width: auto; height: auto; max-width: 100%; max-height: 215px; }
.mt-product1 .txt .title { display: block; min-height: 40px; }
.mt-product1 .txt .title a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mhm-old-price { margin-left: 6px; color: #aaa; font-size: 13px; }
.mhm-add-cart { margin: 0; }
.mhm-link-btn { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.mhm-product-grid { margin-top: 30px; margin-bottom: 30px; }

/* Section headings on the home page */
.mhm-section { padding: 40px 0 10px; }
.mhm-section-title { font-family: "Montserrat", sans-serif; font-size: 22px; color: #494949; text-transform: uppercase; margin-bottom: 25px; }
.mhm-section-title a { color: inherit; }
.mhm-more { font-size: 13px; text-transform: none; float: right; margin-top: 6px; }

/* Home banner slider */
.mhm-banner-slider .holder img { width: 100%; height: auto; }

/* Rich content (articles, product descriptions) */
.mhm-content { line-height: 1.7; color: #666; }
.mhm-content img { max-width: 100%; height: auto; }
.mhm-content table { max-width: 100%; }

/* Forms rendered with the template look */
.mhm-form .form-control { border-radius: 0; height: auto; padding: 10px 14px; }
.mhm-form .form-control::placeholder, .mhm-intro-search input::placeholder { color: #767676; opacity: 1; }
.mhm-form .help-block, .mhm-form .invalid-feedback { color: #dc3545; font-size: 13px; }
.mhm-hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

/* Product detail */
.mhm-detail-price { font-size: 26px; color: var(--mhm-accent); font-family: "Montserrat", sans-serif; }
.mhm-detail-meta li { margin-bottom: 6px; }
.mhm-gallery-main a { display: flex !important; align-items: center; justify-content: center; aspect-ratio: 1 / 1; max-height: 480px; background: #fff; cursor: zoom-in; }
.mhm-gallery-main img { width: auto; height: auto; max-width: 100%; max-height: 100%; }
.mhm-thumbs .img { display: flex; align-items: center; justify-content: center; width: 80px; height: 80px; }
.mhm-thumbs img { width: auto; height: auto; max-width: 78px; max-height: 78px; }
/* Sidebar category list */
.mhm-cat-list li { padding: 4px 0; }
.mhm-cat-list ul { padding-left: 14px; }
.mhm-cat-list a.active { color: var(--mhm-accent); font-weight: 600; }

/* Ship fee calculator */
.mhm-ship-result { min-height: 24px; margin-top: 10px; }

/*
 * Buttons: one primary (.btn-type1, solid) and one secondary (.btn-type2, outline) per action group.
 * Template .btn-type1 was grey #808080 (3.9:1 with white text, read as "disabled").
 */
.btn-type1, .btn-type2, .btn-type3 {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 44px; padding: 11px 24px; line-height: 20px; font-size: 14px;
    text-transform: uppercase; text-decoration: none; cursor: pointer;
}
.btn-type1 { background: #000; color: #fff; border: 1px solid #000; }
.btn-type1:hover, .btn-type1:focus { background: var(--mhm-accent-dark); border-color: var(--mhm-accent-dark); color: #fff; }
.btn-type2:hover, .btn-type2:focus { color: #fff; }
.mhm-detail-actions, .mhm-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.mhm-detail-actions form { margin: 0; }

/* Readable secondary text (template greys #aaa/#bbb fail contrast) */
.mt-shoplist-header .mt-textbox { color: #555; font-weight: 400; font-size: 14px; }
.mhm-note { color: #555; font-size: 14px; line-height: 1.5; }

/* Product detail title: template uses thin, widely tracked type — hard to read for long names */
.mt-product-detial .detial-holder h1 { font-size: 30px; line-height: 1.25; letter-spacing: 0; font-weight: 400; color: #2b2b2b; margin-bottom: 15px; }
@media (max-width: 767.98px) { .mt-product-detial .detial-holder h1 { font-size: 22px; } }

/* Compact page banner (detail pages: breadcrumbs only, the item title is the H1) */
.mt-contact-banner.mhm-page-banner.compact { min-height: 0; padding: 14px 0; margin: 0; text-align: left; }
.mt-contact-banner.mhm-page-banner.compact .breadcrumbs { margin: 0; }

/* Home intro: what the site does + search + main CTA */
.mhm-intro { padding: 36px 0 8px; }
.mhm-intro h1 { font-family: "Montserrat", sans-serif; font-size: 28px; line-height: 1.3; color: #2b2b2b; margin: 0 0 10px; }
.mhm-intro .lead { font-size: 17px; color: #555; max-width: 720px; margin-bottom: 20px; }
.mhm-intro-search { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; max-width: 900px; }
.mhm-intro-search .mhm-search { flex: 1 1 420px; }

/* Search box (partials/_search-box.php) — 16px text so iOS does not zoom on focus */
.mhm-search { display: flex; gap: 8px; width: 100%; }
.mhm-search-field { position: relative; flex: 1 1 auto; min-width: 0; }
.mhm-search-field .icon-magnifier { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #666; pointer-events: none; }
.mhm-search-field input { width: 100%; min-height: 48px; padding: 10px 44px; border: 1px solid #8a8a8a; border-radius: 24px; background: #fff; color: #222; font-size: 16px; }
.mhm-search-field input:focus { border-color: #000; }
.mhm-search-field input::-webkit-search-cancel-button { -webkit-appearance: none; }
.mhm-search-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; color: #555; font-size: 24px; line-height: 1; cursor: pointer; }
.mhm-search-clear:hover { background: #eee; color: #000; }
.mhm-search-submit { min-height: 48px; min-width: 84px; }
.mhm-search-submit:disabled { opacity: .7; cursor: progress; }

/* Search results page */
.mhm-search-page { padding-top: 24px; padding-bottom: 40px; }
.mhm-search-head { margin-bottom: 20px; }
.mhm-search-head h1 { font-family: "Montserrat", sans-serif; font-size: 24px; line-height: 1.3; color: #2b2b2b; margin: 0 0 14px; overflow-wrap: anywhere; }
.mhm-search-head .mhm-search { max-width: 720px; }
.mhm-search-tabs ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; padding: 0; }
.mhm-search-tabs a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; border: 1px solid #bbb; border-radius: 22px; color: #333; white-space: nowrap; }
.mhm-search-tabs a:hover { border-color: #000; color: #000; }
.mhm-search-tabs a.active { background: #000; border-color: #000; color: #fff; }
.mhm-count { min-width: 24px; padding: 0 7px; border-radius: 12px; background: #eee; color: #333; font-size: 13px; line-height: 22px; text-align: center; }
.mhm-search-tabs a.active .mhm-count { background: #fff; color: #000; }
.mhm-search-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.mhm-result-count { margin: 0; color: #444; font-size: 15px; }
.mhm-toolbar-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.mhm-sort { display: flex; align-items: center; gap: 8px; margin: 0; }
.mhm-sort label { margin: 0; color: #444; }
.mhm-sort select { min-height: 44px; padding: 0 12px; border: 1px solid #8a8a8a; border-radius: 22px; background: #fff; font-size: 15px; }
.mhm-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; color: #444; }
.mhm-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px; border: 1px solid #000; border-radius: 18px; color: #000; }
.mhm-chip:hover { background: #000; color: #fff; }
.mhm-chip-clear { text-decoration: underline; color: #444; }
.mhm-filters .form-select, .mhm-filters .form-control { min-height: 44px; border-radius: 0; font-size: 16px; }
.mhm-empty { max-width: 720px; padding: 16px 0 32px; color: #444; font-size: 15px; }
.mhm-empty ul { padding-left: 20px; }
@media (min-width: 992px) { .mhm-filter-toggle { display: none !important; } }
@media (max-width: 991.98px) {
    .mhm-js .mhm-filters { display: none; }
    .mhm-js .mhm-filters.is-open { display: block; margin-bottom: 16px; }
}
@media (max-width: 575.98px) {
    .mhm-search-head h1 { font-size: 20px; }
    .mhm-search-toolbar { align-items: stretch; }
    .mhm-toolbar-actions { width: 100%; }
    .mhm-sort { flex: 1 1 auto; }
    .mhm-sort select { flex: 1 1 auto; min-width: 0; }
}
.mhm-steps { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 20px 0 0; padding: 0; list-style: none; color: #444; font-size: 15px; }
.mhm-steps b { display: inline-block; width: 24px; height: 24px; margin-right: 6px; border-radius: 50%; background: #000; color: #fff; text-align: center; line-height: 24px; font-size: 13px; }
@media (max-width: 767.98px) { .mhm-intro h1 { font-size: 22px; } .mhm-intro .lead { font-size: 15px; } }

/* Mobile product cards: template fixes the image box at 235px, which makes 2-column grids very tall */
@media (max-width: 575.98px) {
    .mt-product1 .b1 { height: 160px; }
    .mt-product1 .mhm-card-img { max-height: 150px; }
    .mt-product1.mt-paddingbottom20 { padding-bottom: 12px; }
    .mhm-section { padding-top: 28px; }
    .mhm-section-title { font-size: 18px; }
}

/* Boxed sidebar widgets (contact info, ship fee): template h2 margin is sized for full-width widgets */
.shop-widget.p-4 h2 { font-size: 18px; margin-bottom: 16px; }

/* Footer links: plain list (template "tabs" are tag pills, not navigation) */
.mhm-footer-links li { margin-bottom: 8px; }
.mhm-footer-links a { color: #555; }
.mhm-footer-links a:hover { color: #000; text-decoration: underline; }
#mt-footer .address-list li { display: flex; gap: 8px; align-items: baseline; }

/* Brand colours on template elements (template default: coral #ff6060) */
a:hover, a:focus { color: var(--mhm-accent); }
#nav > ul > li > a:hover, #nav > ul > li > a.active, #nav .s-drop a:hover { color: var(--mhm-accent); }
.mt-product1 .txt .price { color: var(--mhm-brand); font-weight: 600; }
.mhm-section-title, .mhm-intro h1 { color: var(--mhm-brand); }
.mhm-steps b { background: var(--mhm-brand); }
.btn-type1 { background: var(--mhm-brand); border-color: var(--mhm-brand); }
.mhm-search-tabs a.active, .mhm-chip:hover { background: var(--mhm-brand); border-color: var(--mhm-brand); }

/* Product card: "add to quote cart" always visible under the price (was a hover-only overlay) */
.mt-product1 .mhm-add-cart { margin-top: 10px; }
.mhm-card-cart {
    display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px;
    border: 1px solid var(--mhm-brand); border-radius: 18px; background: #fff; color: var(--mhm-brand);
    font-size: 13px; line-height: 1.2; cursor: pointer;
}
.mhm-card-cart:hover, .mhm-card-cart:focus-visible { background: var(--mhm-brand); color: #fff; }

/* Home: one-line explanation under each section title */
.mhm-section-intro { margin: -14px 0 20px; color: var(--mhm-muted); font-size: 15px; }

/* Home banner: a single banner is a plain image (no slider); phones get the -mobile version via <picture> */
.mhm-banner-single img, .mhm-banner-single picture { display: block; width: 100%; height: auto; }

/* Phones: 4 cards per home section, "Xem tất cả" leads to the full list */
@media (max-width: 575.98px) {
    .mhm-limit-mobile > :nth-child(n + 5) { display: none; }
    .mhm-section-intro { margin-top: -18px; font-size: 14px; }
}

/* Home guides: fixed thumbnail box so broken or missing images keep the layout */
.mhm-news-thumb { display: block; aspect-ratio: 16 / 9; margin-bottom: 14px; overflow: hidden; background: #f3f5f8; }
.mhm-news-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Holiday calendar */
.mhm-holiday-table { max-width: 760px; }
.mhm-holiday-table caption { caption-side: top; color: var(--mhm-muted); }
.mhm-holiday-table tr.mhm-next > * { background: #fff4f4; }
.mhm-badge-next { display: inline-block; margin-top: 4px; padding: 2px 8px; border-radius: 10px; background: var(--mhm-accent); color: #fff; font-size: 12px; }

/* Former inline styles */
.mhm-list-search { max-width: 640px; }
.mhm-cart-thumb { object-fit: contain; }
/* Header aligned with the content but wide enough for logo + 6 menu items + icons on one line */
#mt-header .mt-bottom-bar > .container { max-width: 1400px; }
@media (min-width: 992px) {
    #nav > ul > li, #nav > ul > li.drop { margin: 0 0 0 22px; }
    #nav > ul > li:last-child { margin-right: 24px; }
}
@media (min-width: 992px) and (max-width: 1199.98px) {
    #nav > ul > li, #nav > ul > li.drop { margin-left: 12px; }
    #nav > ul > li > a { font-size: 11px; letter-spacing: 0; }
    .mt-logo img { max-height: 40px; }
    #mt-header .mt-bottom-bar > .container { max-width: none; }
}
/* Add-to-cart without page reload (js/site.js): flying image, added state, toast */
.mhm-fly {
    position: fixed; z-index: 10001; object-fit: contain; pointer-events: none;
    background: #fff; border-radius: 50%; box-shadow: 0 6px 20px rgba(11, 37, 69, .25);
}
.mhm-card-cart.is-added, .mhm-card-cart.is-added:hover { background: #2E9E5B; border-color: #2E9E5B; color: #fff; cursor: default; }
.btn-type1.is-added, .btn-type1.is-added:hover { background: #2E9E5B; border-color: #2E9E5B; cursor: default; }
.mhm-toast {
    position: fixed; left: 50%; bottom: 24px; z-index: 10002; display: flex; align-items: center; gap: 16px;
    max-width: calc(100% - 32px); padding: 12px 20px; border-radius: 28px; background: var(--mhm-brand); color: #fff;
    font-size: 15px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
    transform: translate(-50%, 140%); opacity: 0; transition: transform .3s ease, opacity .3s ease;
}
.mhm-toast.is-visible { transform: translate(-50%, 0); opacity: 1; }
.mhm-toast.is-error { background: #B3242C; }
.mhm-toast a { color: #fff; font-weight: 700; text-decoration: underline; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .mhm-toast { transition: none; } }
/* Quote cart page (cart/index.php) */
.mhm-cart { border-top: 1px solid #e5e5e5; }
.mhm-cart-head, .mhm-cart-row { display: grid; grid-template-columns: 88px 1fr 150px 90px; gap: 0 20px; align-items: center; }
.mhm-cart-head { padding: 12px 0; border-bottom: 1px solid #e5e5e5; color: var(--mhm-muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.mhm-cart-head span:first-child { grid-column: 1 / 3; }
.mhm-cart-row { padding: 16px 0; border-bottom: 1px solid #eee; }
.mhm-cart-img { display: flex; align-items: center; justify-content: center; width: 88px; height: 88px; background: #fff; border: 1px solid #eee; }
.mhm-cart-img img { max-width: 80px; max-height: 80px; width: auto; height: auto; }
.mhm-cart-name { min-width: 0; text-align: left; }
.mhm-cart-name a { display: block; color: var(--mhm-text); font-size: 15px; line-height: 1.4; }
.mhm-cart-name a:hover { color: var(--mhm-accent); }
.mhm-cart-sku { display: block; margin-top: 4px; color: #777; font-size: 13px; }
.mhm-cart-price { color: var(--mhm-brand); font-weight: 600; font-size: 16px; }
.mhm-cart-price del { display: block; color: #999; font-weight: 400; font-size: 13px; }
.mhm-cart-remove { margin: 0; text-align: right; }
.mhm-cart-remove button {
    display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px;
    border: 1px solid transparent; border-radius: 20px; background: none; color: #B3242C; font-size: 14px; cursor: pointer;
}
.mhm-cart-remove button:hover, .mhm-cart-remove button:focus-visible { border-color: #B3242C; background: #fff5f5; }
@media (max-width: 575.98px) {
    .mhm-cart-head { display: none; }
    .mhm-cart-row { grid-template-columns: 72px 1fr auto; grid-template-areas: "img name remove" "img price remove"; gap: 4px 12px; }
    .mhm-cart-img { grid-area: img; width: 72px; height: 72px; }
    .mhm-cart-img img { max-width: 64px; max-height: 64px; }
    .mhm-cart-name { grid-area: name; }
    .mhm-cart-name a { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
    .mhm-cart-sku { display: none; }
    .mhm-cart-price { grid-area: price; font-size: 15px; }
    .mhm-cart-price del { display: inline; margin-left: 6px; }
    .mhm-cart-remove { grid-area: remove; }
    .mhm-cart-remove button span { display: none; }
    .mhm-cart-remove button { width: 40px; justify-content: center; padding: 0; font-size: 18px; }
}
.mhm-cart-empty { max-width: 560px; margin: 0 auto; padding: 24px 0; text-align: center; color: var(--mhm-muted); }
.mhm-cart-empty .icon-handbag { display: block; margin-bottom: 12px; font-size: 48px; color: var(--mhm-brand); }
/* Article body: section headings smaller than the article title (template h2 is 30px+) */
.mhm-content h2 { margin: 28px 0 10px; font-size: 20px; line-height: 1.35; font-weight: 600; color: var(--mhm-brand); }
.mhm-content ul { padding-left: 20px; }
.mhm-content li { margin-bottom: 6px; }
@media (max-width: 575.98px) { .mhm-content h2 { font-size: 18px; } }
/* Article detail: readable column; the cover image no longer spans the full container */
.mt-blog-detail { max-width: 820px; }
.mt-blog-detail h1 { color: var(--mhm-brand); }
.mt-blog-detail img.img-fluid { border-radius: 8px; }
/* Price request: product image in a fixed square box, never upscaled (legacy images are ~250-350px) */
.mhm-ask-img { display: flex; align-items: center; justify-content: center; aspect-ratio: 1 / 1; max-height: 360px; margin-bottom: 16px; background: #fff; border: 1px solid #eee; }
.mhm-ask-img img { width: auto; height: auto; max-width: 100%; max-height: 100%; }