/* Carousel Styles */
#m1 {
    padding: 0;
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
}

@media (max-width: 1133px) {
    #m1 {
        display: block;
    }
    
    #mainimg {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex: none !important;
    }
    
    .carousel {
        height: auto !important;
        aspect-ratio: 730 / 380;
    }
    
    #mainimg_right {
        height: auto !important;
        margin-left: 0 !important;
        margin-top: 20px !important;
    }
    
    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    .carousel-prev {
        left: 10px;
    }
    
    .carousel-next {
        right: 10px;
    }
}

/* mainimg fixed width on desktop */
#mainimg {
    flex: 0 0 730px;
    width: 730px;
    max-width: 730px;
    min-width: 730px;
}

.carousel {
    position: relative;
    width: 100%;
    height: 380px;
    overflow: hidden;
    border-radius: 8px;
}

.carousel-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    font-size: 30px;
    cursor: pointer;
    z-index: 10;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.carousel-btn:hover {
    background: rgba(0,0,0,0.8);
}

.carousel-prev {
    left: 20px;
}

.carousel-next {
    right: 20px;
}

.carousel-pagination {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.carousel-pagination span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background 0.3s ease;
}

.carousel-pagination span.active {
    background: white;
}

/* Right panel (mainimg_right) */
#mainimg_right {
    flex: 1 1 auto;
    min-width: 380px;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    height: 380px;
    margin-left: 20px;
}

.o-title {
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.o-title-icon {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    color: #333;
}

.o-desc {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
}

.o-controls {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 10px;
}

.o-input {
    flex: 1;
    height: 36px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0 10px;
    font-size: 13px;
}

.o-btn {
    padding: 0 16px;
    height: 36px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
    font-size: 13px;
}

.sn-notice {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
}

.sn-notice-text {
    font-size: 10.5px;
    color: #666;
    margin: 0;
}

.o-sep {
    height: 1px;
    background: #eee;
    margin: 12px 0;
}

.as-box {
    background: #333;
    color: #fff;
    padding: 15px;
    border-radius: 6px;
}

.as-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.as-text {
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 8px;
}

.as-time {
    font-size: 11px;
    margin-bottom: 10px;
}

.as-actions {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

.as-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 6px;
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    color: #fff;
}

.as-btn--dark { background: #444; }
.as-btn--gray { background: #555; }

.as-icon {
    width: 14px;
    height: 14px;
    margin-right: 6px;
}

/* Product Section (#m2) */
#m2 {
    display: flex;
    gap: 20px;
    margin: 40px 0;
}

#m2_left {
    flex: 0 0 730px;
    width: 730px;
    max-width: 730px;
    min-width: 730px;
    height: 635px;
}

/* M3 Section */
#m3 {
    display: flex;
    gap: 20px;
    margin: 20px 0 40px 0;
}

#m3_left {
    flex: 0 0 730px;
    width: 730px;
    max-width: 730px;
    min-width: 730px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#m3_right {
    flex: 1 1 auto;
    min-width: 380px;
    margin-top: 20px;
}

.card {
    background: #fff;
    border: 1px solid #eef1f5;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 16px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

/* Center header content for banner controls in m3_right */
#m3_right .section-header { justify-content: center; }

.section-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #222;
    margin: 0;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.card-grid li {
    background: #fafbfc;
    border: 1px solid #eef1f5;
    border-radius: 8px;
    padding: 10px;
    min-width: 0; /* allow children to shrink inside grid */
}

/* Prevent text overflow inside preview2 items */
#preview2_con li a,
#preview2_con li p,
#preview2_con li span,
#preview2_con li div {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#preview2_con li img { max-width: 100%; height: auto; display: block; }

/* Refined typography and layout for preview2 */
#preview2 .section-header h3 { font-size: 16px; font-weight: 700; color: #222; }

#preview2 a { text-decoration: none; }
#preview2 a:hover { text-decoration: none; }

#preview2_con { gap: 12px; }

#preview2_con li {
    background: #fff;
    border: 1px solid #eef1f5;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

#preview2_con li:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

#preview2_con li img {
    border-radius: 8px;
    margin-bottom: 8px;
}

/* Title (likely anchor) */
#preview2_con li > a:first-child {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

#preview2_con li > a:first-child:hover { color: #111; }

/* Description paragraphs */
#preview2_con li p {
    font-size: 12px;
    color: #666;
    margin-top: 6px;
    white-space: normal;               /* allow wrapping for clamp */
    display: -webkit-box;              /* multi-line clamp */
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Meta/info lines */
#preview2_con li span { font-size: 11px; color: #888; }

.news-tabs {
    display: flex;
    gap: 16px;
    list-style: none;
    padding: 0;
    margin: 0 0 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.news-tab a {
    display: block;
    padding: 8px 0;
    color: #666;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    font-size: 14px;
    font-weight: 500;
}

.news-tab.active a, .news-tab a:hover {
    color: #333;
    border-bottom-color: #333;
}

.news-con {
    list-style: none;
    padding: 0;
    margin: 0;
}

.news-con li a { color: inherit; text-decoration: none; }

/* Clean typography for news tab content */
#news .news-con li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    border-bottom: 1px solid #f0f2f5;
}

#news .news-con li:last-child { border-bottom: none; }

#news .news-con li a {
    flex: 1 1 auto;
    font-size: 13px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#news .news-con li span {
    flex: 0 0 auto;
    font-size: 11px;
    color: #888;
}

#news a { text-decoration: none; }

.banner-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.banner-viewport { max-height: calc(8 * 64px + 7 * 20px + 12px); padding: 6px 0; overflow: hidden; position: relative; }
.banner-list { display: flex; flex-direction: column; gap: 20px; transition: transform 0.3s ease; }
.banner-list li { height: 64px; background: transparent; border: 0; border-radius: 0; padding: 0; display: flex; align-items: center; justify-content: center; }

.banner-list img { max-width: 100%; max-height: 100%; height: auto; display: block; border: 1px solid #eef1f5; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

.banner-controls { display: flex; gap: 6px; justify-content: center; }
.banner-btn { border: none; background: transparent; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.banner-btn:hover { background: transparent; }
.banner-btn img { width: 20px; height: 20px; display: block; }
.banner-controls-bottom { justify-content: center; margin-top: 8px; }

@media (max-width: 1133px) {
    #m3 {
        flex-direction: column;
        gap: 20px;
    }
    #m3_left, #m3_right {
        flex: none;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
    .card-grid { grid-template-columns: repeat(2, 1fr); }
}

#m2_right {
    flex: 1 1 auto;
    min-width: 380px;
    height: 635px;
    /* padding: 12px; */
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* product1 shortcuts */
.product-shortcuts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.product-shortcuts .shortcut {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: #fff;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
}

.product-shortcuts .shortcut:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
    transform: translateY(-1px);
}

.product-shortcuts .shortcut svg {
    width: 18px;
    height: 18px;
    color: #666;
}

.product-shortcuts .shortcut span {
    font-size: 13px;
    font-weight: 600;
}

.product-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.product-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.more-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: #f8f9fa;
    color: #333;
    text-decoration: none;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.more-btn:hover {
    background: #e9ecef;
    color: #333;
}

.more-btn svg {
    width: 14px;
    height: 14px;
    margin-left: 4px;
}

.product-tabs {
    display: flex;
    list-style: none;
    margin: 0 0 20px 0;
    padding: 0;
    border-bottom: 1px solid #e5e7eb;
}

.product-tab {
    margin-right: 20px;
}

.product-tab a {
    display: block;
    padding: 10px 0;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.product-tab.active a,
.product-tab a:hover {
    color: #333;
    border-bottom-color: #333;
}

.product-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

/* product-row wrappers removed in markup; keep selectors if legacy remains */

.product-item {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e9f0;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease, transform 0.2s ease, filter 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-sizing: border-box;
    height: 225px;
    overflow: hidden;
}

.product-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    filter: brightness(0.9);
    transform: translateY(-5px);
}

.product-item img {
    max-width: 100%;
    height: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Ensure image wrappers center their contents */
.product-item a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

/* Text styles inside product cards */
/* .product-item .p_title,
.product-item .p_desc,
.product-item a .p_title,
.product-item a .p_desc {
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
} */

.product-item .p_title,
.product-item a .p_title {
    font-size: 14px;
    font-weight: 600;
    color: #4080d5;
    margin-top: 8px;
}

.product-item .p_desc,
.product-item a .p_desc {
    font-size: 12px; /* smaller than title */
    color: #666;
    margin-top: 4px;
}

#preview1 {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #eef1f5;
}

#preview1 h3 {
    font-size: 16px;
    font-weight: 700;
    color: #222;
    margin: 0 0 12px 0;
}

#preview1_con {
    list-style: none;
    margin: 0;
    padding: 0;
}

#preview1_con li {
    background: #fafbfc;
    border: 1px solid #eef1f5;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    font-size: 12px
}

#preview1_con li:last-child {
    margin-bottom: 0;
}

#preview1_con li a {
    color: inherit;
    text-decoration: none;
}

#preview1_con li:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.quick-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.quick-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 16px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #eef1f5;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.quick-link:hover {
    box-shadow: 0 6px 14px rgba(0,0,0,0.10);
    transform: translateY(-1px);
    background: #fafbfc;
}

.quick-link svg {
    width: 24px;
    height: 24px;
    margin-right: 0;
    margin-bottom: 8px;
    color: #666;
    background: #f3f5f9;
    border-radius: 50%;
    padding: 6px;
}

.quick-link span {
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

@media (max-width: 1133px) {
    #m2 {
        flex-direction: column;
        gap: 20px;
    }
    
    #m2_left,
    #m2_right {
        flex: none;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
    }
    
    /* 2-column grid on mobile */
    .product-content {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quick-links {
        grid-template-columns: repeat(2, 1fr);
    }
}
