/* ============================================================================
 * Trim X / lawn-mower-pc  -  custom fixes (added 2026-10-30)
 * Loaded AFTER the bundled index-f98d44c4.css so it can override it.
 *
 * 1) Fixes left/right stretched images (the bundle forces fixed heights and
 *    background-size:100% 100%, ignoring every picture's real aspect ratio).
 * 2) Adds the responsive layout the bundle completely lacks (it has 0 media
 *    queries, body{min-width:1240px} and a fixed .container{width:1440px}).
 *
 * Scoped attribute selectors ([data-v-...]) match the bundle specificity;
 * !important is used only where the bundle rule is equally/more specific.
 * Delete this one <link> in index.html to fully roll back.
 * ------------------------------------------------------------------------- */

/* ---- 1) Image / video proportions (all screen sizes) ------------------- */

/* Home hero: bundle forces width:100%;height:450px which stretches the
 * 864x486 montage across the whole 1440 band. Keep the real aspect ratio. */
.home-main-img img[data-v-1b315b23] {
    width: 100%;
    height: auto !important;
    aspect-ratio: 864 / 486;
    display: block;
    object-fit: cover;
}

/* Product rows: bundle fixes the box to 50% x 350px while the source images
 * are ~square (1024x882 / 1024x1024), so they get squashed wide. Let the box
 * and the media follow the source aspect ratio instead of forcing 350px. */
.img-right .product-row-img[data-v-1b315b23],
.img-left  .product-row-img[data-v-1b315b23] {
    height: auto !important;
}
.product-row-img img[data-v-1b315b23],
.product-row-img video[data-v-1b315b23] {
    width: 100% !important;
    height: auto !important;
    object-fit: contain;
    display: block;
}

/* Login page: bundle uses background-size:100% 100% which stretches the same
 * montage to fill the viewport. "cover" fills it without distortion. */
.login-container[data-v-f69a8ed9] {
    background-size: cover !important;
    background-position: center center;
    background-attachment: scroll;
}

/* Safety: media never overflows its container on any route. */
img, video { max-width: 100%; }

/* Wide data tables (order detail / admin) scroll horizontally on phones. */
table { max-width: 100%; }

/* ---- 2) Responsive: phones (portrait) ----------------------------------- */
@media screen and (max-width: 768px) {

    /* Kill the hard 1240px floor and the fixed 1440px content width. */
    body {
        min-width: 0 !important;
        overflow-x: hidden;
    }
    .container {
        width: 100% !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
        box-sizing: border-box;
    }

    /* Top navigation: allow the menu to wrap / shrink instead of forcing a
     * desktop row; smaller tap-friendly text. */
    .app-topnav .container,
    .app-header-sticky .container {
        flex-wrap: wrap;
        padding-top: 8px;
        padding-bottom: 8px;
    }
    .app-topnav .container .project-tip,
    .app-header-sticky .container .project-tip {
        flex-wrap: wrap;
        font-size: 15px;
        row-gap: 6px;
    }
    .app-topnav .container .project-tip .router-row,
    .app-header-sticky .container .project-tip .router-row {
        margin: 0 14px 0 0;
    }
    .app-topnav ul,
    .app-header-sticky ul {
        height: auto !important;
    }

    /* Home heading + hero text overlay (bundle pads it 140/80px). */
    .project-info[data-v-f86d8b7c] {
        font-size: 20px;
        line-height: 1.4;
    }
    .project-tip[data-v-f86d8b7c] {
        padding: 56px 20px 36px !important;
        font-size: 16px;
    }

    /* Product rows: stack text and image vertically (phone = portrait). */
    .product-row[data-v-1b315b23] {
        flex-direction: column !important;
        margin-top: 34px;
        row-gap: 16px;
    }
    .img-right .product-row-img[data-v-1b315b23],
    .img-left  .product-row-img[data-v-1b315b23],
    .img-right .product-row-text[data-v-1b315b23],
    .img-left  .product-row-text[data-v-1b315b23] {
        width: 100% !important;
    }
    .product-row-text[data-v-1b315b23] {
        padding: 0 !important;
        font-size: 17px;
    }
    .product-row-text .title[data-v-1b315b23] {
        font-size: 24px;
    }
    .product-row-text .product-row-text-p[data-v-1b315b23] {
        line-height: 28px;
    }
    /* For img-left rows move the text above the picture so every row reads
     * title -> copy -> image in portrait. */
    .img-left .product-row-text[data-v-1b315b23] { order: 0; }
    .img-left .product-row-img[data-v-1b315b23]  { order: 1; }

    /* Goods detail product-intro rows (scoped id 447ccd60): same portrait
     * treatment as the home page. The bundle keeps .product-row as a horizontal
     * flex with a <video> (.product-row-img) beside the copy; on a phone stack
     * every row vertically with the clip on top and text below. */
    .product-row[data-v-447ccd60] {
        flex-direction: column !important;
        margin-top: 28px;
        row-gap: 16px;
    }
    .img-right .product-row-img[data-v-447ccd60],
    .img-left  .product-row-img[data-v-447ccd60],
    .img-right .product-row-text[data-v-447ccd60],
    .img-left  .product-row-text[data-v-447ccd60] {
        width: 100% !important;
        height: auto !important;
    }
    .product-row .product-row-img video[data-v-447ccd60] {
        width: 100% !important;
        height: auto !important;
    }
    .product-row-text[data-v-447ccd60] {
        padding: 0 !important;
        font-size: 16px;
    }
    .product-row-text .title[data-v-447ccd60] {
        font-size: 22px;
    }
    .product-row-text .product-row-text-p[data-v-447ccd60] {
        line-height: 1.6;
    }
    /* img-left rows: put copy first, clip second, for a consistent read order. */
    .img-left .product-row-text[data-v-447ccd60] { order: 0; }
    .img-left .product-row-img[data-v-447ccd60]  { order: 1; }

    .download-btn[data-v-1b315b23] {
        padding: 13px 30px;
        font-size: 18px;
    }

    /* Footer: wrap the contact columns into a 2-column layout. */
    .app_footer .contact .container[data-v-1a987a36] {
        flex-wrap: wrap;
        padding: 36px 16px 20px !important;
        row-gap: 24px;
    }
    .app_footer .contact dl[data-v-1a987a36] {
        width: 50%;
        height: auto;
        padding: 0 8px;
        border-right: 0;
        box-sizing: border-box;
    }
    .app_footer .slogan[data-v-1a987a36] {
        height: auto;
        line-height: 1.6;
        padding: 32px 20px;
        flex-direction: column;
        align-items: center;
        gap: 18px;
        text-align: center;
    }
    .app_footer .slogan a[data-v-1a987a36] {
        height: auto;
        line-height: 1.4;
        font-size: 20px;
    }
    .app_footer .copyright[data-v-1a987a36] {
        height: auto;
        padding: 30px 16px;
    }

    /* Login / register: stack the brand word and the form card. */
    .login-section[data-v-f69a8ed9] {
        flex-direction: column;
        justify-content: center;
        gap: 24px;
        min-height: 0;
        padding: 32px 20px;
    }
    .login-section .logo-text[data-v-f69a8ed9] {
        font-size: 52px;
        text-align: center;
    }
    .login-section .wrapper[data-v-f69a8ed9] {
        width: 100%;
        max-width: 380px;
    }
    .login-header .container[data-v-f69a8ed9] {
        padding: 0 16px;
    }
}

/* ---- 3) Small tablets / large phones: relax the fixed width too -------- */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    body { min-width: 0 !important; }
    .container {
        width: 100% !important;
        padding-left: 24px !important;
        padding-right: 24px !important;
        box-sizing: border-box;
    }
}

/* ---- 4) Hamburger navigation (driven by assets/mobile-fix.js) ---------- */
/* The injected button is always in the DOM but only visible on phones. */
.tx-burger {
    display: none;
    margin-left: auto;
    width: 42px;
    height: 40px;
    padding: 8px 9px;
    background: transparent;
    border: 1px solid #555;
    border-radius: 6px;
    cursor: pointer;
    flex: 0 0 auto;
    box-sizing: border-box;
}
.tx-burger span {
    display: block;
    height: 2px;
    margin: 4px 0;
    background: #fff;
    border-radius: 2px;
    transition: transform .25s ease, opacity .2s ease;
}
.tx-burger.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.tx-burger.is-open span:nth-child(2) { opacity: 0; }
.tx-burger.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media screen and (max-width: 768px) {
    .tx-burger { display: block; }

    /* Stack each nav: burger on the first row, links below (hidden until open). */
    .app-topnav .container,
    .app-header-sticky .container {
        flex-wrap: wrap;
        align-items: center;
        row-gap: 0;
    }
    /* Default collapsed: hide both link groups until the burger opens them.
     * Qualified with body so these outrank the earlier generic flex-wrap rule. */
    body .app-topnav .container .project-tip,
    body .app-header-sticky .container .project-tip,
    body .app-topnav ul,
    body .app-header-sticky ul {
        display: none !important;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        height: auto !important;
        padding: 4px 0 10px;
    }
    .app-topnav .container .project-tip { flex-wrap: nowrap; }
    .app-topnav .container .project-tip .router-row,
    .app-header-sticky .container .project-tip .router-row,
    .app-topnav ul li a,
    .app-header-sticky ul li a,
    .app-topnav ul .router-row,
    .app-header-sticky ul .router-row {
        margin: 0 !important;
        padding: 12px 4px !important;
        border-bottom: 1px solid #2a2a2a;
        font-size: 16px;
        width: 100%;
        box-sizing: border-box;
    }
    body.tx-nav-open .app-topnav .container .project-tip,
    body.tx-nav-open .app-header-sticky .container .project-tip,
    body.tx-nav-open .app-topnav ul,
    body.tx-nav-open .app-header-sticky ul {
        display: flex !important;
    }
    /* The fixed sticky header must grow to fit the open menu instead of clipping. */
    .app-header-sticky { max-height: 100vh; overflow-y: auto; }
}

/* ---- 5) Portrait hero: show the whole picture, no side cropping -------- */
/* The desktop rule keeps aspect-ratio 864/486 (cover crops the sides on a
 * narrow screen). On phones use "contain" with a matching dark backdrop so
 * the entire montage is visible (letterboxed, never stretched/cropped). */
@media screen and (max-width: 768px) {
    .home-main-img img[data-v-1b315b23] {
        object-fit: contain;
        aspect-ratio: auto;
        background: #111;
        border-radius: 4px;
    }
}

/* ---- 6) Inner pages: make fixed-width blocks fluid on phones ----------- */
/* These pages sit behind login (cart / product / order / address / member),
 * which the headless harness cannot reach; the rules target the exact fixed
 * widths found in the bundle plus Element Plus primitives, so they only take
 * effect at <=768px and never change the desktop layout. */
@media screen and (max-width: 768px) {

    /* Generic guard: every common block fits the viewport and scrolls if needed. */
    .container,
    .container * { box-sizing: border-box; }
    .el-card,
    .el-table,
    .el-form,
    .el-pagination,
    .el-carousel,
    .el-dialog,
    .el-message-box { max-width: 100%; }

    /* Dialogs: the bundle default --el-dialog-width is 50%; make near-full width. */
    .el-dialog {
        --el-dialog-width: 92%;
        width: 92% !important;
        margin-top: 8vh !important;
    }
    .el-overlay-dialog .el-dialog__body { padding: 12px; }

    /* Wide data tables scroll horizontally inside their card instead of overflowing. */
    .el-table { width: 100% !important; }
    .el-table .el-table__inner-wrapper { overflow-x: auto; }
    .order-detail table,
    table { display: block; width: 100%; overflow-x: auto; }

    /* Inline forms stack vertically. */
    .el-form--inline .el-form-item {
        display: flex;
        margin-right: 0;
        margin-bottom: 14px;
        width: 100%;
    }
    .el-form--inline .el-form-item__content { flex: 1; }

    /* Product detail page (scoped ids from the bundle). */
    .xtx-goods-page .goods-info .media[data-v-447ccd60] {
        width: 100% !important;
        padding: 16px !important;
    }
    .xtx-goods-page .goods-footer .goods-article[data-v-447ccd60] {
        width: 100% !important;
        margin-right: 0 !important;
    }
    .xtx-goods-page .goods-footer .goods-aside[data-v-447ccd60] {
        width: 100% !important;
        min-height: 0 !important;
        margin-top: 16px;
    }
    .xtx-goods-page .g-service[data-v-447ccd60],
    .xtx-goods-page .goods-sales[data-v-447ccd60] {
        width: 100% !important;
    }

    /* Product image zoom area: shrink and drop the absolute large-view panel. */
    .goods-image[data-v-686a58aa] {
        width: 100% !important;
        height: auto !important;
        flex-direction: column;
    }
    .goods-image .middle[data-v-686a58aa] {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 1 / 1;
    }
    .goods-image .large[data-v-686a58aa] { display: none !important; }
    .goods-image .small { width: 100%; }

    /* Product list grid cards become full-width rows. */
    .goods-list li[data-v-a4b08712] {
        width: 100% !important;
        height: auto !important;
        margin: 0 0 12px !important;
    }

    /* Cart. */
    .cart .layer[data-v-2875d681] {
        width: 100% !important;
        height: auto !important;
        right: 0;
    }
    .xtx-cart-page .goods > div[data-v-1b00c0e0] { width: auto !important; }

    /* Address / member / order fixed columns. */
    .address .action[data-v-84d13eab] { width: 100% !important; }
    .my-btn[data-v-84d13eab] { width: 100% !important; margin: 0 0 10px !important; }
    .total dl dd[data-v-84d13eab],
    .order-detail .total dl dd[data-v-af76b1a1] {
        width: 100% !important;
        padding-right: 0 !important;
        text-align: left !important;
    }
    .container .xtx-member-aside[data-v-c02b005e] {
        width: 100% !important;
        margin: 0 0 16px !important;
    }
    .order-item .body .column.goods ul li .info[data-v-58b61225],
    .order-item .body .column.amount[data-v-58b61225] {
        width: auto !important;
    }
}

