/* ==========================================================================
   CITYHOME 百货项目核心 CSS 样式表 (主页深蓝+黄色点缀 / 手风琴 Footer)
   ========================================================================== */

:root {
    --primary-blue: #0f2b5c;      /* 深蓝色主色 */
    --primary-blue-dark: #0a1c3d; /* 深蓝加深 */
    --accent-yellow: #ffc72c;     /* 亮黄色点缀 */
    --primary-red: #c92a2a;       /* 极简通知栏红 */
    --text-dark: #212529;
    --text-muted: #6c757d;
    --bg-light: #f8f9fa;
    --border-color: #dee2e6;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --radius-sharp: 4px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-light);
    line-height: 1.5;
}

.top-notice-bar {
    background-color: var(--primary-red);
    color: #ffffff;
    font-size: 0.82rem;
    padding: 0.35rem 1rem;
    text-align: center;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.site-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-top-row {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.6rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: var(--primary-blue);
    line-height: 1;
}

.logo-wrapper {
    display: flex;
    align-items: center;
}

.logo-main-img {
    height: 38px;
    width: auto;
    display: block;
}

/* 高端椭圆搜索框样式 (纯 CSS SVG 矢量放大镜图标) */
.header-search {
    position: relative;
    flex: 1;
    max-width: 420px;
    margin: 0 1.5rem;
}

.header-search input {
    width: 100%;
    padding: 0.55rem 1rem 0.55rem 2.6rem;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    background-color: var(--bg-light);
    font-size: 0.92rem;
    color: var(--text-dark);
    transition: all 0.25s ease;
}

.header-search::before {
    content: "";
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236c757d' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z' /%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
    transition: stroke 0.2s;
}

.header-search input:focus {
    outline: none;
    border-color: var(--primary-blue);
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(15, 43, 92, 0.1);
}

.header-search input:focus + ::before,
.header-search:focus-within::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%230f2b5c' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z' /%3E%3C/svg%3E");
}

.header-actions {
    display: flex;
    align-items: center;
}

.cart-link {
    background-color: var(--bg-light);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    text-decoration: none;
    color: var(--primary-blue);
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.cart-link:hover {
    border-color: var(--primary-blue);
    background-color: #ffffff;
}

.cart-link .badge {
    background-color: var(--accent-yellow);
    color: var(--primary-blue);
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 800;
}

.header-nav {
    background-color: var(--primary-blue);
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 0.65rem 1rem;
}

.header-nav a {
    color: #ffffff;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    white-space: nowrap;
    transition: color 0.2s;
}

.header-nav a:hover, .header-nav a.active {
    color: var(--accent-yellow);
}

.container {
    max-width: 1200px;
    margin: 1.5rem auto;
    padding: 0 1rem;
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 380px;
    overflow: hidden;
    border-radius: var(--radius-sharp);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease-in-out;
}

.carousel-slide {
    height: 100%;
    flex-shrink: 0;
}

.carousel-slide a {
    display: block;
    width: 100%;
    height: 100%;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.carousel-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.2s;
}

.carousel-dots .dot.active {
    background-color: var(--accent-yellow);
}

.section-title {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 1.2rem;
    color: var(--primary-blue);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.2rem;
}

.product-card {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sharp);
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-blue);
}

.promo-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: var(--accent-yellow);
    color: var(--primary-blue);
    padding: 0.15rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 800;
    border-radius: var(--radius-sharp);
    z-index: 2;
}

.product-card img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    margin-bottom: 0.8rem;
}

.product-card h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-card h3 a {
    color: var(--text-dark);
    text-decoration: none;
}

.price-row {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.price-box {
    display: flex;
    flex-direction: column;
}

.old-price {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.price {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary-blue);
}

.btn-add {
    background-color: var(--primary-blue);
    color: #ffffff;
    border: none;
    padding: 0.45rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: var(--radius-sharp);
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-add:hover {
    background-color: var(--primary-blue-dark);
}

/* 悬浮客服 */
.cs-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.cs-toggle-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #25d366;
    color: #ffffff;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.cs-menu {
    position: absolute;
    bottom: 65px;
    right: 0;
    width: 220px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.cs-menu.active {
    display: flex;
}

.cs-header {
    background-color: var(--primary-blue);
    color: #ffffff;
    padding: 0.6rem;
    font-weight: 700;
    font-size: 0.85rem;
    text-align: center;
}

.cs-option {
    padding: 0.7rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 0.85rem;
    border-bottom: 1px solid var(--bg-light);
}

/* 页脚 Footer 样式 */
.site-footer {
    background-color: #14171c;
    color: #e2e8f0;
    padding: 2.5rem 1rem 1.5rem;
    margin-top: 3rem;
    border-top: 3px solid var(--primary-blue);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-col-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.6rem;
}

.footer-links a {
    color: #a0aec0;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent-yellow);
}

.footer-bottom {
    border-top: 1px solid #2d3748;
    padding-top: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.social-links {
    display: flex;
    gap: 1.2rem;
}

.social-links a {
    color: #ffffff;
    font-size: 1.4rem;
    text-decoration: none;
    transition: transform 0.2s, color 0.2s;
}

.social-links a:hover {
    color: var(--accent-yellow);
    transform: translateY(-2px);
}

.footer-copyright {
    font-size: 0.82rem;
    color: #718096;
}

.footer-arrow {
    display: none;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

/* 响应式媒体查询 */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .header-top-row {
        padding: 0.5rem 0.8rem;
    }

    .logo-main-img {
        height: 30px;
    }

    .header-search {
        max-width: 170px;
        margin: 0 0.4rem;
    }

    .header-search input {
        padding: 0.4rem 0.8rem 0.4rem 2.1rem;
        font-size: 0.85rem;
    }

    .header-nav {
        display: none;
        flex-direction: column;
        gap: 0;
        background-color: var(--primary-blue);
    }

    .header-nav.mobile-open {
        display: flex;
    }

    .header-nav a {
        padding: 0.75rem 1.2rem;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }

    .carousel-container {
        height: 200px;
        margin-bottom: 1.2rem;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }

    .product-card {
        padding: 0.5rem;
    }

    .product-card img {
        height: 130px;
    }

    .product-card h3 {
        font-size: 0.82rem;
    }

    .price {
        font-size: 0.98rem;
    }

    .btn-add {
        padding: 0.35rem 0.5rem;
        font-size: 0.72rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .footer-col {
        border-bottom: 1px solid #2d3748;
    }

    .footer-col-title {
        padding: 1rem 0;
        margin-bottom: 0;
        cursor: pointer;
    }

    .footer-arrow {
        display: inline-block;
    }

    .footer-links {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, padding 0.3s ease;
    }

    .footer-col.active .footer-links {
        max-height: 200px;
        padding-bottom: 1rem;
    }

    .footer-col.active .footer-arrow {
        transform: rotate(180deg);
    }
}