html {
width: 100%;
-webkit-text-size-adjust: 100%;
}

body {
width: 100%;
max-width: 100vw;
position: relative;
overflow-x: hidden;
}

td {
line-height: 160% !important;
padding: 7px 20px !important;
}

/* 确保所有容器不超出视口 */
* {
max-width: 100%;
box-sizing: border-box;
}

@media (min-width: 980px) and (max-width: 1600px) {

/* 主容器自适应宽度 */
.ww {
width: 95% !important;
max-width: 1360px !important;
padding-left: 20px;
padding-right: 20px;
}

/* 导航栏自适应 */
.header .hbox {
width: 95% !important;
max-width: 1360px !important;
}

.header .hlogo .hlbox img {
max-height: 30px !important;
}

#searchword {
max-width: 190px !important;
}

.hsearch .layui-form {
margin: 0px !important;
}

.commenu ul li ul,
.hsearch ul li ul {
max-width: 900px;
}
}

/* 对比按钮激活状态样式 */
.cart-active {
background-color: #111;
}

/* cart-active时a标签背景为黑色，图标为白色 */
.product-add-to-cart.cart-active {
background: #111 !important;
color: #fff !important;
}

.product-add-to-cart.cart-active i {
color: #fff !important;
}

.product-copy-to-compare.compare-active {
background: #111 !important;
color: #fff !important;
}

.product-copy-to-compare.compare-active i {
color: #fff !important;
}


/* 产品项悬停时显示购物车和对比按钮 */
.cpro-list-box .cpitem:hover .comp-ico-cart,
.cpro-list-box .cpitem:hover .comp-ico-copy,
.cpro-list-box .cpitem.cart-item-active .comp-ico-cart,
.cpro-list-box .cpitem.compare-item-active .comp-ico-copy {
opacity: 1 !important;
}


.cpro-list-box .item.compare-item-active .comp-ico-copy {
opacity: 1 !important;
}

/* 默认隐藏购物车和对比按钮 */
.cpro-list-box .cpitem .comp-ico-cart,
.cpro-list-box .cpitem .comp-ico-copy {
margin-top: 60px;
opacity: 0;
transition: opacity 0.3s ease;
}

/* 只对对比按钮添加悬停效果 */
.product-copy-to-compare:hover {
transition: transform 0.2s ease;
background: #111 !important;
}

.product-copy-to-compare:hover i {
color: #fff !important;
}

/* 购物车按钮hover变黑色 */
/* 购物车按钮hover时a标签背景变黑色，图标变白色 */
.product-add-to-cart:hover {
background: #111 !important;
transition: background 0.2s;
}

.product-add-to-cart:hover i {
color: #fff !important;
transition: color 0.2s;
}

/* 筛选器样式 */
.filter-actions {
text-align: center;
}

.clear-all-filters:hover {
background-color: #e0e0e0;
transition: background-color 0.3s ease;
}

/* 筛选结果高亮 */
.cpro-list-box .cpitem {
transition: opacity 0.3s ease;
}

.cpro-list-box .cpitem:not([style*="display: none"]) {
opacity: 1;
}

/* 提升产品项的悬停体验 */
.cpitem {
transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

.cpitem:hover {
transform: translateY(-5px) !important;
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

/* 确保产品图片容器有相对定位 */
.cpitem .img.imgs {
position: relative !important;
overflow: hidden !important;
}

/* 图片悬停效果 */
.cpitem .img.imgs img {
transition: transform 0.3s ease !important;
}

.cpitem:hover .img.imgs img {
transform: scale(1.05) !important;
}

.video-modal {
position: fixed;
z-index: 9999;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.8);
display: flex;
justify-content: center;
align-items: center;
}

.video-modal-content {
position: relative;
background-color: transparent;
padding: 0;
border-radius: 0;
width: 95%;
height: 95%;
max-width: 1200px;
max-height: 800px;
}

.close-video {
position: absolute;
top: -10px;
right: -10px;
color: #fff;
font-size: 30px;
font-weight: bold;
cursor: pointer;
background-color: #ff0000;
width: 40px;
height: 40px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
z-index: 10000;
}

.close-video:hover {
background-color: #cc0000;
}

.video-container {
position: relative;
width: 100%;
height: 100%;
}

.video-container iframe {
width: 100%;
height: 100%;
min-height: 500px;
border: none;
border-radius: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
.video-modal-content {
width: 98%;
height: 90%;
padding: 0;
margin: 0;
}

.video-container iframe {
min-height: 300px;
border-radius: 4px;
}
}

@media (max-width: 480px) {
.video-modal-content {
width: 100%;
height: 85%;
}

.video-container iframe {
min-height: 250px;
}
}

/* Compare Error Modal Styles */
.compare-error-modal {
position: fixed;
z-index: 9999;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
}

.compare-error-modal-content {
position: relative;
background-color: #fff;
border-radius: 8px;
width: 90%;
max-width: 500px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
overflow: hidden;
}

.compare-error-header {
position: relative;
background: #f8f9fa;
padding: 15px 20px;
border-bottom: 1px solid #e9ecef;
}

.close-compare-error {
position: absolute;
top: 50%;
right: 15px;
transform: translateY(-50%);
color: #666;
font-size: 24px;
font-weight: bold;
cursor: pointer;
width: 30px;
height: 30px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
transition: all 0.3s ease;
}

.close-compare-error:hover {
background-color: #e9ecef;
color: #333;
}

.compare-error-body {
padding: 30px 20px 20px;
text-align: center;
}

.error-icon {
margin-bottom: 20px;
}

.error-message h3 {
color: #333;
font-size: 18px;
margin: 0 0 15px;
font-weight: 600;
}

.error-message p {
color: #666;
font-size: 14px;
line-height: 1.5;
margin: 0 0 15px;
}

.category-info {
background: #f8f9fa;
padding: 15px;
border-radius: 4px;
margin: 15px 0;
}

.category-info p {
margin: 0;
font-weight: 500;
color: #333;
}

.error-actions {
display: flex;
justify-content: right;
align-items: center;
gap: 15px;
margin-top: 25px;
}

.error-actions button {
padding: 5px 24px;
border: none;
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: all 0.3s ease;
min-width: 80px;
}

.btn-cancel {
background: #6c757d;
color: white;
}

.btn-cancel:hover {
background: #5a6268;
}

.btn-yes {
background: #003a85;
color: white;
}

.btn-yes:hover {
background: #003a85;
}

/* Responsive design for compare error modal */
@media (max-width: 768px) {
.compare-error-modal-content {
width: 95%;
margin: 10px;
}

.compare-error-body {
padding: 20px 15px;
}

.error-actions {
flex-direction: column;
gap: 10px;
}

.error-actions button {
width: 100%;
}
}

/* 筛选器折叠展开样式 */
.item-tit {
cursor: pointer;
transition: all 0.3s ease;
}

.item-tit:hover {
background-color: rgba(0, 0, 0, 0.05);
}

.item-cc {
overflow: hidden;
transition: all 0.3s ease;
max-height: 0;
opacity: 0;
}

.item-cc.open {
max-height: 1000px;
/* 足够大的值以容纳内容 */
opacity: 1;
}

/* 图标旋转效果 */
.item-tit .iconfont {
transition: transform 0.3s ease;
}

.item-tit.open .iconfont {
transform: rotate(90deg);
}

.whatsapp-hover {
position: relative;
display: inline-block;
}

.whatsapp-hover .hover-image {
position: absolute !important;
top: 100%;
left: 50%;
transform: translateX(-50%);
background: white;
padding: 10px;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
opacity: 0 !important;
visibility: hidden !important;
transition: all 0.3s ease;
z-index: 1000;
margin-top: 5px;
display: block;
}

.whatsapp-hover:hover .hover-image {
opacity: 1 !important;
visibility: visible !important;
}

.whatsapp-hover .hover-image::before {
content: '';
position: absolute;
top: -6px;
left: 50%;
transform: translateX(-50%);
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid white;
}

.wechat-hover {
text-decoration: none;
transition: text-decoration 0.3s ease;
}

.wechat-hover:hover {
text-decoration: underline;
}

.layui-input-block {
min-height: 30px !important;
width: auto !important;
max-width: none !important;
overflow: visible !important;
white-space: nowrap !important;
text-overflow: none !important;
}

.p80 {
padding: 40px 0 40px 0;
}

#conts p {
line-height: 160% !important;
}

.sidebar2 {
position: fixed;
top: 0;
right: -100%;
width: 80%;
height: 100%;
background: white;
z-index: 1000;
transition: right 0.3s ease;
overflow-y: auto;
padding: 20px;
box-sizing: border-box;
}

.sidebar2.active {
right: 0;
}

.overlay2 {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
z-index: 999;
display: none;
}
