/* ==========================================================
   全局自定义样式 (Global Custom Styles)
   ========================================================== */

/* 1. 登录页容器居中 */
.login-container {
    max-width: 400px;
    margin-top: 100px;
}

/* 2. 管理后台商品列表缩略图 (来自 index.html) */
.thumbnail-img {
    /* 恢复到 18px x 18px 的缩略图尺寸 */
    width: 500px !important; 
    height: 500px !important; 
    max-width: 500px !important; 
    max-height: 500px !important; 
    object-fit: contain; 
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1px;
    vertical-align: middle; 
}

/* 3. 商品列表表格列宽控制 (来自 index.html) */
.table-img-col {
    width: 50px; 
    text-align: center;
    white-space: nowrap; 
}
.table-actions-col {
    width: 150px; 
    text-align: center;
    white-space: nowrap; 
}
.table-img-col .text-muted.small {
    display: inline-block;
    line-height: 18px; /* 与图片高度保持一致 */
}

/* ==========================================================
   前台样式优化 (Frontend Styles Optimization)
   ========================================================== */

/* 4. 前台 Home 页面产品卡片 (来自 home.html) */
a.card-link {
    text-decoration: none;
    color: inherit; 
    display: block;
}
.product-card {
    transition: transform 0.2s ease-in-out;
    height: 100%; 
    display: flex; 
    flex-direction: column; 
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2) !important; 
}
.filter-btn-link.active {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}
.card-img-container {
    position: relative;
    height: 200px; /* 统一图片展示区高度 */
    overflow: hidden;
    background-color: #f8f9fa; /* 统一背景色 */
    display: flex;
    align-items: center;
    justify-content: center;
    border-top-left-radius: 6px; /* 匹配 card-img-top 的圆角 */
    border-top-right-radius: 6px;
}
.card-img-container img {
    max-height: 100%;
    width: auto;
    object-fit: contain;
}
.card-img-overlay {
    background-color: rgba(0, 0, 0, 0.5); /* 遮罩颜色 */
    color: white;
    padding: 5px 10px;
    border-radius: 0 0 6px 6px;
    top: auto; 
    bottom: 0;
    width: 100%;
    left: 0;
}

/* ==========================================================
   产品详情页样式 (Product Detail Styles)
   ========================================================== */

/* 5. 详情页轮播图/图片区域美化 (来自 product_detail.html) */
.carousel-item img {
    height: 400px; 
    object-fit: contain; 
    background-color: #f8f9fa; 
    border-radius: 5px;
}
#productCarousel {
    border: 1px solid #ddd; 
    border-radius: 8px; 
    overflow: hidden; 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); 
}
.product-price {
    color: #dc3545; 
    font-size: 2.5rem; 
    font-weight: 700;
}
.product-description-content {
    white-space: pre-wrap; /* 允许文本自动换行 */
}

/* ==========================================================
   编辑产品页样式 (Edit Product Styles)
   ========================================================== */

/* 6. 编辑页图片预览和删除按钮定位 (来自 edit_product.html) */
.image-preview {
    width: 100%;
    height: 120px; 
    object-fit: contain; 
    border: 1px solid #ccc;
    padding: 5px;
    border-radius: 5px;
}
.image-container {
    position: relative;
    margin-bottom: 15px;
}
.delete-btn-form { 
    position: absolute;
    top: 5px; 
    right: 5px; 
    z-index: 10;
}
.delete-btn { 
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.primary-tag {
    position: absolute;
    bottom: 15px;
    left: 5px;
    z-index: 10;
}
.set-primary-btn-form {
    position: absolute;
    bottom: 5px;
    left: 5px;
    z-index: 10;
}

/* ==========================================================
   企业品牌样式 (Corporate Branding Styles)
   ========================================================== */

/* 企业品牌颜色 */
:root {
    --brand-primary: #1f5f6f;
    --brand-secondary: #6c757d;
    --brand-accent: #b21f2d;
    --brand-light: #f8f9fa;
    --brand-dark: #212529;
    --brand-success: #198754;
    --brand-warning: #ffc107;
    --brand-info: #0dcaf0;
    --brand-ink: #1f2933;
    --brand-muted: #607080;
}

.site-body {
    color: var(--brand-ink);
    background: #ffffff;
}

@media (min-width: 992px) {
    .site-body .navbar > .container,
    .site-body main > section > .container,
    .site-footer > .container {
        max-width: none;
        padding-left: 0;
        padding-right: 0;
        width: min(100% - 64px, 1240px);
    }
}

.navbar-logo {
    height: 42px;
    width: 150px;
    object-fit: contain;
    object-position: left center;
}

.brand-wordmark {
    font-weight: 700;
    color: var(--brand-ink);
    letter-spacing: 0;
}

.navbar .nav-link {
    font-weight: 600;
}

.navbar .container {
    position: relative;
}

@media (min-width: 1200px) {
    .site-body .navbar > .container {
        align-items: center;
        display: grid;
        gap: 1.25rem;
        grid-template-columns: minmax(285px, 1fr) auto minmax(285px, 1fr);
    }

    .site-body .navbar .brand-lockup {
        justify-self: start;
        margin-right: 0;
    }

    .site-body .navbar .site-nav-shell {
        display: contents !important;
    }

    .main-site-nav {
        gap: 0.35rem;
        grid-column: 2;
        justify-self: center;
        margin: 0 !important;
    }

    .header-action-nav {
        grid-column: 3;
        justify-self: end;
        margin: 0 !important;
    }
}

.mega-dropdown {
    position: static;
}

.ppe-mega-menu {
    border: 1px solid #dfe7ed;
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(31, 41, 51, 0.14);
    left: 50% !important;
    margin-top: 0;
    padding: 1.1rem;
    right: auto !important;
    top: 100%;
    transform: translateX(-50%) !important;
    width: min(1120px, calc(100vw - 2rem));
}

.products-mega-menu {
    max-height: calc(100vh - 5.5rem);
    overflow-y: auto;
}

.mega-section + .mega-section {
    border-top: 1px solid #e9eef2;
    margin-top: 1.2rem;
    padding-top: 1.2rem;
}

.reusable-mega-section .mega-column {
    border-left-color: #e8eef0;
}

.support-mega-section {
    padding-bottom: 0.15rem;
}

.support-menu-head {
    align-items: end;
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.support-menu-head span {
    color: var(--brand-muted);
    display: block;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.support-menu-head strong {
    color: var(--brand-ink);
    display: block;
    font-size: 0.98rem;
    line-height: 1.2;
}

.support-menu-note {
    color: #7a8994 !important;
    font-size: 0.76rem !important;
    font-weight: 700 !important;
    letter-spacing: 0;
    text-align: right;
    text-transform: none !important;
}

.support-mega-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 720px;
}

.support-mega-column {
    border-left: 2px solid #edf2f5;
    padding-left: 0.75rem;
}

.support-mega-column h3 {
    color: var(--brand-ink);
    font-size: 0.86rem;
    font-weight: 800;
    margin: 0 0 0.38rem;
}

.support-mega-column > span {
    color: var(--brand-muted);
    display: block;
    font-size: 0.82rem;
    line-height: 1.35;
    margin-bottom: 0.28rem;
}

/* 2026-08-10: compact navigation search and a quieter supplemental range. */
.nav-search-wrap {
    align-items: center;
    display: flex;
    position: relative;
}

.nav-search-toggle {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 4px;
    color: var(--brand-ink);
    display: inline-flex;
    font-size: 1.05rem;
    height: 34px;
    justify-content: center;
    padding: 0;
    transition: background-color .18s ease, color .18s ease;
    width: 34px;
}

.nav-search-toggle:hover,
.nav-search-toggle:focus-visible {
    background: #f0f4f7;
    color: var(--brand-blue);
    outline: 0;
}

.nav-product-search {
    align-items: center;
    background: #fff;
    border: 1px solid #d5dfe6;
    border-radius: 5px;
    box-shadow: 0 12px 30px rgba(25, 41, 54, .14);
    display: flex;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    position: absolute;
    right: 0;
    top: calc(100% + .5rem);
    transform: translateY(-4px);
    transition: opacity .18s ease, transform .18s ease;
    visibility: hidden;
    width: 270px;
    z-index: 1100;
}

.nav-search-wrap.is-open .nav-product-search {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    visibility: visible;
}

.nav-product-search input {
    border: 0;
    color: var(--brand-ink);
    font-size: .85rem;
    min-width: 0;
    outline: 0;
    padding: .62rem .72rem;
    width: 100%;
}

.nav-product-search button {
    align-items: center;
    align-self: stretch;
    background: var(--brand-blue);
    border: 0;
    color: #fff;
    display: inline-flex;
    justify-content: center;
    padding: 0 .72rem;
}

.support-mega-section {
    background: #f7f9fb;
    border-top: 1px solid #e1e8ed;
    margin: 1.1rem -1.1rem -1.1rem;
    padding: .9rem 1.1rem 1rem;
}

.support-menu-head strong a {
    font-size: .9rem;
}

.support-mega-grid {
    gap: 1.2rem;
    max-width: 42rem;
}

.support-mega-column {
    border-left-color: #dfe7ed;
}

.support-mega-column h3 {
    font-size: .8rem;
}

@media (max-width: 1199.98px) {
    .nav-search-wrap { margin: .35rem 0; }
    .nav-product-search { left: 0; right: auto; }
}

.mega-menu-head {
    align-items: center;
    border-bottom: 1px solid #e9eef2;
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
}

.mega-menu-head span {
    color: var(--brand-muted);
    display: block;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.mega-menu-head strong {
    color: var(--brand-ink);
    display: block;
    font-size: 1.05rem;
    line-height: 1.2;
}

.mega-menu-head a,
.mega-column a {
    text-decoration: none;
}

.mega-menu-head a {
    color: var(--brand-primary);
    font-size: 0.88rem;
    font-weight: 800;
}

.mega-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.mega-column {
    border-left: 2px solid #edf2f5;
    padding-left: 0.8rem;
}

.mega-column h3 {
    font-size: 0.92rem;
    font-weight: 800;
    margin-bottom: 0.55rem;
}

.mega-column h3 a {
    color: var(--brand-ink);
}

.mega-column > a {
    color: var(--brand-muted);
    display: block;
    font-size: 0.88rem;
    line-height: 1.35;
    margin-bottom: 0.42rem;
}

.mega-column > a:hover,
.mega-column h3 a:hover,
.mega-menu-head a:hover {
    color: var(--brand-accent);
}

.brand-lockup,
.footer-brand {
    align-items: center;
    display: inline-flex;
    gap: 0.65rem;
    text-decoration: none;
}

.brand-logo {
    display: block;
    height: 38px;
    object-fit: contain;
    width: 72px;
}

.brand-mark {
    align-items: center;
    background: var(--brand-primary);
    border-radius: 8px;
    color: #ffffff;
    display: inline-flex;
    font-weight: 800;
    height: 36px;
    justify-content: center;
    letter-spacing: 0;
    width: 58px;
}

.brand-name {
    color: var(--brand-ink);
    font-size: 0.98rem;
    font-weight: 800;
}

.nav-rfq-button {
    white-space: nowrap;
}

.footer-brand {
    color: #ffffff;
    font-weight: 800;
}

.footer-brand-logo {
    display: block;
    height: 42px;
    object-fit: contain;
    width: 76px;
}

.footer-brand .brand-mark {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.section-kicker {
    color: var(--brand-accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    margin-bottom: 0.6rem;
    text-transform: uppercase;
}

.btn-brand {
    background: var(--brand-accent);
    border-color: var(--brand-accent);
    color: #ffffff;
    font-weight: 700;
}

.btn-brand:hover,
.btn-brand:focus {
    background: #941a25;
    border-color: #941a25;
    color: #ffffff;
}

.site-footer {
    background: #1f2933;
    font-size: 14px;
}

.site-footer p,
.site-footer li,
.site-footer a {
    font-size: 0.95rem;
    line-height: 1.55;
}

.site-footer h6 {
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.footer-logo {
    max-width: 260px;
    width: 100%;
    height: auto;
    background: #ffffff;
    border-radius: 6px;
    padding: 6px;
}

.footer-badge {
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    font-size: 0.85rem;
}

.footer-links li {
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
}

.footer-links a:hover {
    color: #ffffff;
}

.footer-socials {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.site-footer .footer-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    color: #ffffff;
    font-size: 1.22rem;
    line-height: 1;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.22);
    transition: box-shadow 160ms ease, transform 160ms ease;
}

.site-footer .footer-social-link--instagram {
    background: radial-gradient(circle at 30% 105%, #ffd600 0 18%, #ff7a00 31%, #ff0169 52%, #d300c5 72%, #7638fa 100%);
}

.site-footer .footer-social-link--tiktok {
    background: #050505;
}

.site-footer .footer-social-link--tiktok i {
    color: #ffffff;
    filter: drop-shadow(-1.5px 0 #25f4ee) drop-shadow(1.5px 0 #fe2c55);
}

.site-footer .footer-social-link--youtube {
    background: #ff0000;
}

.site-footer .footer-social-link:hover,
.site-footer .footer-social-link:focus-visible {
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px) scale(1.04);
}

.footer-bottom {
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    justify-content: space-between;
}

.footer-legal {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.site-footer .footer-legal a {
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.86rem;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.38);
    text-underline-offset: 0.2em;
}

.site-footer .footer-legal a:hover,
.site-footer .footer-legal a:focus-visible {
    color: #ffffff;
    text-decoration-color: currentColor;
}

/* 导航栏logo优化 */
.navbar-brand img {
    height: 45px;
    max-width: 200px;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.navbar-brand img:hover {
    opacity: 0.9;
}

/* ==========================================================
   企业抬头图片增强样式 (Corporate Header Images Enhancement)
   ========================================================== */
/* 企业抬头图片样式 */
.header-images {
    display: flex;
    align-items: center;
}

.header-images img {
    height: 30px;
    max-width: 100px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.header-images img:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.4);
}

/* 移动端调整 */
@media (max-width: 768px) {
    .header-images img {
        height: 25px;
        max-width: 80px;
    }
    .navbar-brand img {
        height: 35px;
        max-width: 150px;
    }
}

@media (max-width: 1199.98px) {
    .ppe-mega-menu {
        border-radius: 8px;
        box-shadow: none;
        left: 0 !important;
        margin-top: 0.6rem;
        position: static;
        transform: none !important;
        width: 100%;
    }

    .mega-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .mega-menu-head {
        align-items: flex-start;
        display: block;
    }

    .mega-menu-head a {
        display: inline-block;
        margin-top: 0.55rem;
    }

    .mega-grid {
        grid-template-columns: 1fr;
    }

    .support-menu-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.3rem;
    }

    .support-menu-note {
        text-align: left;
    }

    .support-mega-grid {
        gap: 0.75rem;
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1199.98px) {
    .mobile-products-nav {
        border-bottom: 1px solid #e9eef2;
    }

    .mobile-products-accordion > summary,
    .mobile-product-range > summary {
        align-items: center;
        cursor: pointer;
        display: flex;
        font-weight: 600;
        justify-content: space-between;
        list-style: none;
    }

    .mobile-products-accordion > summary {
        color: var(--brand-ink);
        min-height: 42px;
        padding: 0.5rem 0;
    }

    .mobile-products-accordion > summary::-webkit-details-marker,
    .mobile-product-range > summary::-webkit-details-marker {
        display: none;
    }

    .mobile-products-accordion > summary:focus-visible,
    .mobile-product-range > summary:focus-visible {
        outline: 2px solid rgba(31, 95, 111, 0.42);
        outline-offset: -2px;
    }

    .mobile-products-accordion[open] > summary {
        color: var(--brand-primary);
    }

    .mobile-products-chevron {
        color: #7a8994;
        font-size: 0.78rem;
        transition: color .18s ease, transform .18s ease;
    }

    .mobile-products-accordion[open] > summary > .mobile-products-chevron,
    .mobile-product-range[open] > summary > .mobile-products-chevron {
        color: var(--brand-primary);
        transform: rotate(180deg);
    }

    .mobile-products-panel {
        border-top: 1px solid #e9eef2;
        padding: 0 0 0.8rem;
    }

    .mobile-product-range {
        border-bottom: 1px solid #e9eef2;
    }

    .mobile-product-range > summary {
        color: #263746;
        min-height: 44px;
        padding: 0.65rem 0.8rem;
    }

    .mobile-product-range[open] > summary {
        background: #f2f7f6;
        color: var(--brand-primary);
    }

    .mobile-product-range-links {
        background: #ffffff;
        padding: 0 0.8rem;
    }

    .mobile-product-range-links a {
        align-items: center;
        border-top: 1px solid #edf2f5;
        color: #4d6272;
        display: flex;
        font-size: 0.9rem;
        justify-content: space-between;
        min-height: 42px;
        padding: 0.45rem 0;
        text-decoration: none;
    }

    .mobile-product-range-links a:hover,
    .mobile-product-range-links a:focus-visible {
        color: var(--brand-accent);
    }

    .mobile-product-range-links .mobile-product-range-all {
        border-top: 0;
        color: var(--brand-primary);
        font-weight: 700;
    }

    .mobile-product-range-links i {
        color: #7a8994;
        font-size: 0.78rem;
    }

    .mobile-product-catalogue {
        align-items: center;
        background: var(--brand-accent);
        border: 1px solid var(--brand-accent);
        border-radius: 4px;
        color: #ffffff;
        display: flex;
        font-size: 0.88rem;
        font-weight: 700;
        justify-content: center;
        margin: 0.9rem 0.8rem 0;
        min-height: 42px;
        text-decoration: none;
    }

    .mobile-product-catalogue:hover,
    .mobile-product-catalogue:focus-visible {
        background: #941a25;
        border-color: #941a25;
        color: #ffffff;
    }
}

/* 企业按钮样式 */
.btn-brand {
    background: var(--brand-accent);
    border: 1px solid var(--brand-accent);
    color: white;
    font-weight: 700;
}

.btn-brand:hover {
    background: #941a25;
    border-color: #941a25;
    color: white;
}

/* 企业卡片样式 */
.card-brand {
    border: none;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-brand:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-up {
    animation: fadeInUp 0.8s ease forwards;
}
.nav-inline-search-wrap {
    margin-right: .35rem;
}

.nav-inline-search {
    align-items: center;
    background: #f5f7f9;
    border: 1px solid #dce4e9;
    border-radius: 4px;
    display: flex;
    height: 34px;
    overflow: hidden;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
    width: 168px;
}

.nav-inline-search:focus-within {
    background: #fff;
    border-color: #8aa6b8;
    box-shadow: 0 0 0 2px rgba(33, 82, 108, .1);
}

.nav-inline-search input {
    background: transparent;
    border: 0;
    color: #263746;
    font-size: .82rem;
    min-width: 0;
    outline: 0;
    padding: 0 .15rem 0 .7rem;
    width: 100%;
}

.nav-inline-search button {
    align-items: center;
    background: transparent;
    border: 0;
    color: #4d6272;
    display: flex;
    height: 100%;
    justify-content: center;
    padding: 0;
    width: 34px;
}

.nav-inline-search button:hover {
    color: var(--brand-blue);
}

@media (max-width: 1199.98px) {
    .nav-inline-search-wrap {
        margin: .55rem 0;
    }

    .nav-inline-search {
        width: min(100%, 320px);
    }
}
