/* ============================================================
   KORRETTO / TOP-TOOL  —  Shared UI Stylesheet
   Covers: nav, footer, responsive layout, typography
   ============================================================ */

/* --- Global responsive image protection ------------------- */
img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}

/* --- Typography ------------------------------------------- */
body {
    background-color: #f9f9f9;
    color: #333;
    font-family: 'Inter', 'Helvetica Neue', 'Roboto', -apple-system,
                 BlinkMacSystemFont, 'Segoe UI', 'Noto Sans',
                 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: -0.1px;
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

/* ============================================================
   NAV  —  single-row, sticky, responsive
   ============================================================ */
nav {
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.07);
    padding: 6px 16px;
    position: sticky;
    top: 0;
    z-index: 9000;
}

/* Inner wrapper keeps everything in one row */
.nav-inner {
    align-items: center;
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 1200px;
}

/* --- Dual-logo row ---------------------------------------- */
nav .logobox {
    align-items: center;
    display: flex;
    flex-shrink: 0;
    gap: 12px;
}

nav .logobox img.logo {
    height: 36px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

nav .logobox img.logo:hover {
    opacity: 0.78;
    transform: scale(1.04);
}

.logo-divider {
    background-color: #ddd;
    flex-shrink: 0;
    height: 28px;
    width: 1px;
}

/* --- Nav menu — flex, nowrap, single line ----------------- */
.daohang {
    flex: 1;
    height: auto !important;   /* override legacy page CSS that sets fixed height (e.g. 80px–200px) */
    min-height: unset !important;
    min-width: 0;
    overflow: visible;   /* must be visible so dropdown menus are not clipped */
}

nav ul.nav {
    align-items: center;
    display: flex;
    flex-wrap: nowrap;
    gap: 0 6px;
    height: auto !important;   /* override .daohang ul { height: 40px } in style.css / style-en.css */
    justify-content: flex-end;
    list-style: none;
    margin: 0;
    padding: 0;
    width: auto !important;    /* override .daohang ul { width: 1170px / 585px / 300px } */
}

nav ul.nav > li {
    flex-shrink: 0;
    float: none !important;       /* override .nav li { float: left } in style.css */
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0;
    position: relative;
    white-space: nowrap;
    width: auto !important;       /* override .nav li { width: 130px } in style.css */
}

/* Touch-friendly min-height on all nav links */
nav ul.nav > li > a {
    align-items: center;
    color: #222;
    display: flex;
    min-height: 44px;
    padding: 0 8px;
    text-decoration: none;
    transition: color 0.2s;
}

nav ul.nav > li > a:hover {
    color: #2790f4;
}

/* --- Dropdown submenu — single column, solid bg ----------- */
nav ul.nav li ul {
    background-color: #333 !important;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.45);
    display: none;
    flex-direction: column;
    height: auto !important;      /* override .daohang ul { height:40px } in style.css */
    left: 0;
    list-style: none;
    margin: 0 !important;
    padding: 6px 0;
    position: absolute;
    top: calc(100% + 2px);
    width: max-content !important; /* override .daohang ul { width:1170px } */
    max-width: 280px;
    z-index: 99999 !important;
}

nav ul.nav li:hover > ul {
    display: flex;
}

nav ul.nav li ul li {
    display: block;
    padding: 0;
    width: 100%;
}

nav ul.nav li ul li a {
    color: #e0e0e0;
    display: block;
    font-size: 12.5px;
    font-weight: 400;
    min-height: 40px;
    line-height: 40px;
    padding: 0 18px;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s, color 0.15s;
}

nav ul.nav li ul li a:hover {
    background-color: #3a3a3a;
    color: #4da3ff;
}

/* Plain-text items (no link) in dropdown */
nav ul.nav li ul li:not(:has(a)) {
    color: #777;
    font-size: 12px;
    line-height: 36px;
    padding: 0 18px;
}

/* --- Language toggle -------------------------------------- */
nav ul.nav li.lang-toggle {
    margin-left: 4px;
}

nav ul.nav li.lang-toggle > a {
    align-self: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    color: #444;
    display: inline-flex;
    font-size: 12px;
    font-weight: 600;
    height: auto;
    letter-spacing: 0.4px;
    line-height: 1;
    min-height: unset;
    padding: 4px 8px;
}

nav ul.nav li.lang-toggle > a:hover {
    background-color: #f0f4ff;
    border-color: #2790f4;
    color: #2790f4;
}

nav ul.nav li.lang-toggle > ul {
    left: auto;
    right: 0;
}

/* --- Hamburger button (hidden on desktop) ----------------- */
.nav-toggle {
    background: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    display: none;          /* shown via media query */
    flex-direction: column;
    gap: 5px;
    padding: 8px 10px;
    flex-shrink: 0;
}

.nav-toggle span {
    background-color: #333;
    border-radius: 2px;
    display: block;
    height: 2px;
    width: 20px;
    transition: all 0.2s;
}

/* ============================================================
   FOOTER  —  dark background, auto height, no overflow
   ============================================================ */
footer {
    background-color: #000;
    color: #bbb;
    height: auto;
    overflow: visible;
    padding: 20px 20px 16px;
    width: 100%;
    box-sizing: border-box;
}

footer .bottom {
    background-color: transparent;
    height: auto;
}

footer .center {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px 24px;
    height: auto !important;
    margin: 0 auto;
    max-width: 1100px;
    padding-bottom: 32px;
}

/* Dual logos in footer — span all 4 grid columns */
.footer-logos {
    align-items: center;
    display: flex;
    gap: 14px;
    grid-column: 1 / -1;
    justify-content: center;
    margin-bottom: 8px;
    width: 100%;
}

.footer-logos img {
    height: 34px;
    max-width: 150px;
    object-fit: contain;
    opacity: 0.85;
    transition: opacity 0.2s;
    width: auto;
}

.footer-logos img:hover { opacity: 1; }

.footer-logos .logo-divider {
    background-color: #555;
    height: 26px;
    width: 1px;
}

/* Footer link columns */
footer ul.dibuchanpin,
footer ul.dibuchanpin1,
footer ul.dibuchanpin2,
footer ul.dibuchanpin3 {
    height: auto;
    list-style: none;
    margin: 0;
    min-width: 130px;
    padding: 0;
}

footer ul.dibuchanpin li,
footer ul.dibuchanpin1 li,
footer ul.dibuchanpin2 li,
footer ul.dibuchanpin3 li {
    color: #888;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    font-size: 11px !important;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1.3;
    margin-bottom: 1px;
    padding: 0;
}

/* Column section heading (first li) — bold, same size, nowrap to keep border aligned */
footer ul.dibuchanpin li:first-child,
footer ul.dibuchanpin1 li:first-child,
footer ul.dibuchanpin2 li:first-child,
footer ul.dibuchanpin3 li:first-child {
    color: #ddd;
    font-size: 11px !important;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.3;
    margin-bottom: 4px;
    padding-bottom: 3px;
    border-bottom: 1px solid #444;
    white-space: nowrap;
}

footer ul.dibuchanpin li a,
footer ul.dibuchanpin1 li a,
footer ul.dibuchanpin2 li a,
footer ul.dibuchanpin3 li a {
    color: #888;
    text-decoration: none;
    transition: color 0.2s;
}

footer ul.dibuchanpin li a:hover,
footer ul.dibuchanpin1 li a:hover,
footer ul.dibuchanpin2 li a:hover,
footer ul.dibuchanpin3 li a:hover {
    color: #4da3ff;
}

/* ============================================================
   FOOTER LIGHT VARIANT — Chinese pages (white background)
   ============================================================ */
footer.footer-light {
    background-color: #fff;
    border-top: 1px solid #e8e8e8;
    color: #333;
}

footer.footer-light ul.dibuchanpin li,
footer.footer-light ul.dibuchanpin1 li,
footer.footer-light ul.dibuchanpin2 li,
footer.footer-light ul.dibuchanpin3 li {
    color: #555;
}

footer.footer-light ul.dibuchanpin li:first-child,
footer.footer-light ul.dibuchanpin1 li:first-child,
footer.footer-light ul.dibuchanpin2 li:first-child,
footer.footer-light ul.dibuchanpin3 li:first-child {
    color: #111;
    border-bottom-color: #ccc;
}

footer.footer-light ul.dibuchanpin li,
footer.footer-light ul.dibuchanpin1 li,
footer.footer-light ul.dibuchanpin2 li,
footer.footer-light ul.dibuchanpin3 li {
    color: #444;
}

footer.footer-light ul.dibuchanpin li a,
footer.footer-light ul.dibuchanpin1 li a,
footer.footer-light ul.dibuchanpin2 li a,
footer.footer-light ul.dibuchanpin3 li a {
    color: #555;
}

footer.footer-light ul.dibuchanpin li a:hover,
footer.footer-light ul.dibuchanpin1 li a:hover,
footer.footer-light ul.dibuchanpin2 li a:hover,
footer.footer-light ul.dibuchanpin3 li a:hover {
    color: #2790f4;
}

footer.footer-light .footer-logos img  { opacity: 1; filter: none; }
footer.footer-light .footer-logos .logo-divider { background-color: #ddd; }

/* --- Beian / copyright row ------------------------------- */
.beian-row {
    align-items: center;
    background-color: #111;
    box-sizing: border-box;
    color: #555;
    display: flex;
    flex-wrap: wrap;
    font-size: 11px;
    gap: 6px 20px;
    justify-content: center;
    margin: 0;
    padding: 10px 20px;
    width: 100%;
}

.beian-row a {
    align-items: center;
    color: #555;
    display: flex;
    gap: 4px;
    text-decoration: none;
    transition: color 0.2s;
}

.beian-row a:hover { color: #888; }

.beian-row img {
    height: 14px;
    width: auto;
    object-fit: contain;
}

/* EN copyright paragraph (foot-en.htm) */
.footer-copyright {
    background-color: #111;
    box-sizing: border-box;
    color: #555;
    font-size: 11px;
    margin: 0;
    padding: 10px 20px;
    text-align: center;
    width: 100%;
}

/* Fallback: catch legacy inline-div beian blocks and the EN <p> */
footer + div {
    background-color: #111 !important;
    box-sizing: border-box;
    color: #666 !important;
    margin: 0 !important;
    padding: 8px 20px !important;
    text-align: center;
    width: 100% !important;
}

footer + p {
    background-color: #111 !important;
    box-sizing: border-box;
    color: #666 !important;
    font-size: 11px !important;
    margin: 0 !important;
    padding: 10px 20px !important;
    text-align: center !important;
    width: 100% !important;
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* --- Tablet: 601–900px ------------------------------------ */
@media (max-width: 900px) {
    nav {
        padding: 6px 12px;
    }

    .nav-toggle {
        display: flex;
    }

    .daohang {
        background-color: #fff;
        border-top: 1px solid #eee;
        box-shadow: 0 4px 12px rgba(0,0,0,0.12);
        display: none;               /* hidden until toggled */
        left: 0;
        padding: 8px 0 12px;
        position: absolute;
        right: 0;
        top: 100%;
        z-index: 9998;
    }

    .daohang.open {
        display: block;
    }

    nav ul.nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 0 8px;
        width: 100% !important;   /* override .daohang ul { width: fixed } in homepage CSS */
    }

    nav ul.nav > li {
        float: none !important;   /* override .nav li { float: left } in style.css */
        height: auto !important;  /* override .nav li { height: 100% } in style.css */
        line-height: normal !important;
        width: 100% !important;
        border-bottom: 1px solid #f0f0f0;
    }

    nav ul.nav > li > a {
        font-size: 14px;
        min-height: 46px;
        padding: 0 12px;
        width: 100%;
    }

    /* Dropdowns — collapsed by default on mobile, toggled by JS (.open class) */
    nav ul.nav li ul {
        background-color: #f7f7f7 !important;
        border-radius: 0;
        box-shadow: none !important;
        display: none !important;
        height: auto !important;
        left: auto !important;
        max-width: 100% !important;
        opacity: 1 !important;
        overflow: hidden;
        padding: 0 0 4px 20px;
        position: static !important;
        top: auto !important;
        width: 100% !important;
    }

    nav ul.nav li.open > ul {
        display: block !important;
    }

    /* Arrow indicator for collapsible items */
    nav ul.nav > li:has(> ul) > a::after {
        content: ' ▸';
        font-size: 10px;
        opacity: 0.55;
        margin-left: 2px;
    }

    nav ul.nav > li.open:has(> ul) > a::after {
        content: ' ▾';
        opacity: 0.75;
    }

    nav ul.nav li ul li {
        float: none !important;
        height: auto !important;
        line-height: normal !important;
        position: static !important;
        text-align: left !important;
        width: 100% !important;
    }

    nav ul.nav li ul li a {
        background-color: transparent !important;
        color: #333 !important;
        display: block !important;
        font-size: 13px !important;
        line-height: 40px !important;
        min-height: 40px;
        overflow: hidden;
        text-align: left !important;
        text-overflow: ellipsis;
        white-space: nowrap;
        width: 100% !important;
    }

    nav ul.nav li ul li a:hover {
        background-color: #eef4ff !important;
        color: #2790f4 !important;
    }

    nav ul.nav li.lang-toggle {
        margin-left: 0;
    }
}

/* --- Mobile: ≤ 600px -------------------------------------- */
@media (max-width: 600px) {
    nav .logobox img.logo {
        height: 28px;
    }

    .logo-divider {
        height: 22px;
    }

    footer {
        padding: 24px 16px 16px;
    }

    footer .center {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px 24px;
    }

    .footer-logos img {
        height: 28px;
    }
}

/* --- Very small: ≤ 380px ---------------------------------- */
@media (max-width: 380px) {
    nav .logobox img.logo {
        height: 24px;
    }

    nav .logobox {
        gap: 8px;
    }

    footer .center {
        grid-template-columns: 1fr;
    }
}

/* --- Breadcrumb <nav> — reset sticky/z-index from generic nav rule --- */
nav.breadcrumbs {
    background-color: transparent !important;
    border-bottom: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    position: static !important;
    top: auto !important;
    z-index: auto !important;
}

/* --- Mobile language toggle (outside hamburger menu) ------- */
.lang-btn-mobile {
    display: none;                /* shown only on mobile via media query */
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    color: #444;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.4px;
    line-height: 1;
    padding: 5px 9px;
    text-decoration: none;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.lang-btn-mobile:hover {
    background-color: #f0f4ff;
    border-color: #2790f4;
    color: #2790f4;
}

@media (max-width: 900px) {
    .lang-btn-mobile {
        display: inline-flex;
    }
    /* Hide the desktop lang-toggle inside the collapsed menu on mobile */
    nav ul.nav li.lang-toggle {
        display: none;
    }
}

/* --- EN nav: centered, lighter weight, tighter spacing ---- */
nav.nav-en ul.nav {
    justify-content: center;
}

nav.nav-en ul.nav > li {
    font-size: 12.5px;
    font-weight: 400;
    letter-spacing: 0;
}

nav.nav-en ul.nav > li > a {
    padding: 0 6px;
}

nav.nav-en ul.nav li ul li a {
    font-size: 12px;
}

/* ============================================================
   SEARCH BAR  —  legacy, used on some pages
   ============================================================ */
.search-bar {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    gap: 10px;
    margin: 20px auto;
    max-width: 960px;
    padding: 10px;
}

.search-bar input {
    border: 1px solid #ccc;
    border-radius: 4px;
    flex: 1;
    font-size: 14px;
    padding: 8px;
}

.search-bar button {
    background-color: #07539f;
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    padding: 8px 16px;
    transition: background-color 0.2s;
}

.search-bar button:hover {
    background-color: #053f7c;
}

/* ============================================================
   PRODUCT CATEGORY PAGE SPACING FIX  (.t1 + .box layout)
   Overrides legacy page-specific CSS for category pages
   ============================================================ */
.t1 {
    height: auto !important;
    margin-top: 4px !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

.box {
    padding-bottom: 24px !important;
}

@media (max-width: 900px) {
    .t1 {
        margin-top: 0 !important;
    }
    .box {
        padding-left: 12px !important;
        padding-right: 12px !important;
        padding-bottom: 16px !important;
        justify-content: center !important;
    }
    .box .innerbox {
        height: auto !important;
        margin: 10px 6px !important;
        width: 155px !important;
    }
    .box .innerbox img {
        height: 155px !important;
        width: 155px !important;
    }
}

/* ============================================================
   SOCIAL SHARE WIDGET — fixed, mobile/tablet only
   ============================================================ */
.share-widget {
    align-items: flex-end;
    bottom: 20px;
    display: none;           /* hidden on desktop */
    flex-direction: column;
    gap: 8px;
    position: fixed;
    right: 16px;
    z-index: 9990;
}

@media (max-width: 900px) {
    .share-widget {
        display: flex;
    }
}

.share-main-btn {
    align-items: center;
    background-color: #2790f4;
    border: none;
    border-radius: 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.28);
    color: #fff;
    cursor: pointer;
    display: flex;
    font-size: 13px;
    font-weight: 600;
    gap: 6px;
    padding: 10px 16px;
    transition: background-color 0.2s, transform 0.15s;
    white-space: nowrap;
}

.share-main-btn:hover {
    background-color: #1a7de0;
    transform: scale(1.05);
}

.share-panel {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 160px;
    padding: 8px;
}

.share-panel[hidden] {
    display: none;
}

.share-option {
    align-items: center;
    background: none;
    border: none;
    border-radius: 8px;
    color: #333;
    cursor: pointer;
    display: flex;
    font-size: 14px;
    gap: 10px;
    padding: 9px 12px;
    text-decoration: none;
    transition: background-color 0.15s;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.share-option:hover {
    background-color: #f5f7ff;
    color: #2790f4;
}

.share-option svg {
    flex-shrink: 0;
    height: 20px;
    width: 20px;
}

/* WeChat QR / link-copy overlay */
.share-qr-overlay {
    align-items: center;
    background-color: rgba(0,0,0,0.6);
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 99995;
}

.share-qr-overlay[hidden] {
    display: none;
}

.share-qr-box {
    background-color: #fff;
    border-radius: 16px;
    max-width: 300px;
    padding: 24px 20px;
    text-align: center;
    width: 88%;
}

.share-qr-box h3 {
    color: #333;
    font-size: 16px;
    margin: 0 0 12px;
}

.share-qr-box p {
    color: #666;
    font-size: 13px;
    margin: 8px 0 0;
    line-height: 1.5;
}

.share-qr-close {
    background: #f0f0f0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 16px;
    padding: 8px 24px;
    font-family: inherit;
}

.share-toast {
    background-color: rgba(0,0,0,0.75);
    border-radius: 8px;
    bottom: 90px;
    color: #fff;
    font-size: 13px;
    padding: 8px 16px;
    position: fixed;
    right: 16px;
    z-index: 99996;
    pointer-events: none;
    transition: opacity 0.4s;
}
