/* common.css - Global & Utility Styles for Demei Chemical */

/* ------------------ General Reset & Base ------------------ */
html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

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

ul, ol {
    list-style: none;
}

button,
input,
textarea,
select {
    font-family: inherit;
    font-size: 16px;
}

input:focus,
textarea:focus,
button:focus {
    outline: none;
}

.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* ------------------ Utility Classes ------------------ */
.text-primary { color: #e74c3c; }
.text-dark { color: #2c3e50; }
.text-light { color: #ecf0f1; }
.text-muted { color: #7f8c8d; }

.bg-primary { background-color: #e74c3c !important; }
.bg-dark { background-color: #2c3e50 !important; }
.bg-light { background-color: #f8f9fa !important; }

.d-block { display: block; }
.d-flex { display: flex; }
.justify-content-center { justify-content: center; }
.align-items-center { align-items: center; }
.flex-column { flex-direction: column; }

.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.mt-30 { margin-top: 30px; }
.mb-30 { margin-bottom: 30px; }
.p-20 { padding: 20px; }

/* ------------------ Buttons ------------------ */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
}

.btn-primary {
    background-color: #e74c3c;
    color: white;
}

.btn-primary:hover {
    background-color: #c0392b;
    color: white;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid #e74c3c;
    color: #e74c3c;
}

.btn-outline:hover {
    background-color: #e74c3c;
    color: white;
}

/* ------------------ Cards / Boxes ------------------ */
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.card-img {
    width: 100%;
    height: auto;
}

.card-body {
    padding: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #2c3e50;
}

.card-text {
    color: #555;
    font-size: 14px;
    line-height: 1.5;
}

/* ------------------ Forms ------------------ */
.form-group {
    margin-bottom: 20px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-control:focus {
    border-color: #e74c3c;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.15);
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

/* ------------------ Section Padding (for inner pages) ------------------ */
.page-header {
    background: #2c3e50;
    color: white;
    padding: 60px 0;
    text-align: center;
}

.page-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
}

.breadcrumb {
    background: #f8f9fa;
    padding: 15px 0;
    margin-bottom: 30px;
    font-size: 14px;
}

.breadcrumb a {
    color: #e74c3c;
}


/* ------------------ Responsive Utilities ------------------ */
.hide-sm {
    display: block;
}

@media (max-width: 768px) {
    .hide-sm {
        display: none !important;
    }

    .text-center-sm {
        text-align: center !important;
    }

    .d-flex-sm {
        display: flex !important;
    }

    .flex-column-sm {
        flex-direction: column !important;
    }
}

/* ------------------ Print Styles (Optional) ------------------ */
@media print {
    .top-header,
    .main-nav,
    .site-footer,
    .back-to-top {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }
}

/* Swiper styles */
.swiper-container {
    width: 100%;
    height: 100vh; /* 设置高度为视口高度 */
    position: relative;
    padding: 0;
}

.swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    position: relative;
}

.swiper-slide .slide-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.swiper-caption {
    position: relative;
    z-index: 10;
    color: white;
    text-align: center;
    padding: 20px;
    max-width: 80%; /* 控制最大宽度，避免过长的文字 */
    margin: auto;
    background: rgba(0, 0, 0, 0.5); /* 半透明背景 */
    border-radius: 5px;
}

.swiper-pagination {
    position: absolute;
    text-align: center;
    transition: .3s opacity;
    transform: translate3d(0, 0, 0);
    z-index: 10;
    bottom: 10px;
    width: 100%;
}

/* 确保在没有图片时仅显示背景颜色 */
.swiper-slide::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: inherit; /* 继承父元素的背景颜色 */
    z-index: 1;
}

/* 响应式设计：确保移动端的布局合理 */
@media (max-width: 768px) {
    .swiper-slide {
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 50px; /* 调整文字与顶部的距离 */
    }

    .swiper-caption {
        max-width: 90%; /* 更大的宽度适应小屏幕 */
        padding: 15px;
    }
}
/* ========== 通用顶部栏 ========== */
.top-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.contact-info {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.language-switcher {
  white-space: nowrap;
}