/* Base styles */
:root {
    --transition-speed: 0.3s;
    --primary: #232222;
    --secondary: #4ecdc4;
    --dark: #292f36;
    --light: #f7f7f7;
    --gray: #e0e0e0;
    --black: #121212;
    --dark-gray: #1e1e1e;
    --medium-gray: #2d2d2d;
    --light-gray: #3c3c3c;
    --lighter-gray: #4a4a4a;
    --lightest-gray: #e0e0e0;
    --white: #ffffff;
    --accent: #ffffff;
    --text: #f5f5f5;
    --text-dark: #212529;
    --text-light: #b0b0b0;
    --success: #4caf50;
    --warning: #ff9800;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* General styles */
body {
    line-height: 1.6;
    color: var(--text);
    background-color: #f9f9f9;
}

/* Navigation */
.navbar-brand img {
    height: 40px;
    width: auto;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--light-gray)!important;
    color: var(--lightest-gray)!important;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.btn:hover {
    transform: translateY(-3px);
    background-color: var(--primary)!important;
    color: var(--light) !important;
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.btn-secondary {
    background: var(--secondary);
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
}

.btn-secondary:hover {
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
}

.btn-custom {
    background-color: var(--primary);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 30px;
    transition: all var(--transition-speed) ease;
}

.btn-custom:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}
/* 页脚链接样式 */
.footer-link {
    color: rgba(200, 200, 200, 0.7);
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    transition: color 0.3s ease;
}

.footer-link:hover,
.footer-link:focus {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
}

/* 社交媒体图标样式 */
.social-icon {
    color: #adb5bd;
    font-size: 1.5rem; /* 调整图标大小 */
    transition: color 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.social-icon:hover,
.social-icon:focus {
    color: #fff;
    transform: scale(1.1); /* 悬停时轻微放大 */
    text-decoration: none;
}

/* 确保页脚版权信息文字大小合适 */
footer .small {
    font-size: 0.875rem;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #aaa;
    font-size: 14px;
}


.a-link {
    color: #495057;
    text-decoration: none;
    display: flex;
    justify-content: space-between;
}

.a-link:hover {
    color: #0d6efd;
}

/* Responsive styles */
/* 响应式设计 */
@media (max-width: 992px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }

    .order-container {
        flex-direction: column;
    }

    .order-summary {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .payment-options {
        flex-direction: column;
        align-items: center;
    }

    .header-container {
        flex-direction: column;
        text-align: center;
    }

    nav {
        margin: 15px 0;
    }
}

@media (max-width: 576px) {
    .footer-content {
        grid-template-columns: 1fr;
    }

    .cart-header, .cart-item {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .cart-item-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .cart-item-img {
        margin-bottom: 10px;
    }
}

/* 页面切换效果 */
.page {
    display: none;
    animation: fadeIn 0.5s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* --- 确保导航栏样式正确 --- */
#mainNav.navbar {
    /* position: fixed 已在 HTML class 中设置 */
    top: 0;
    left: 0;
    right: 0;
    /* width: 100% 已在 HTML class 中通过 w-100 设置 */
    z-index: 1030; /* Bootstrap 5 默认 navbar z-index 是 1030，确保它在其他内容之上 */
    /* 移除任何可能的 margin */
    margin: 0 !important; /* !important 用于覆盖可能的外部样式 */
    border-radius: 0 !important; /* 确保没有圆角 */
    /* Bootstrap 的 fixed-top 类已经处理了 position: fixed; top: 0; left: 0; right: 0; z-index: 1030; */
    /* shadow-sm 已在 HTML class 中设置 */
}

/* --- 为主要内容添加顶部内边距 --- */
/* 这是为了防止页面内容被固定定位的导航栏遮挡 */
/* 使用 Bootstrap 5 的工具类 pt-navbar (约等于 3.5rem = 56px) 是推荐做法 */
/*
.pt-navbar {
    padding-top: 3.5rem;
}
*/
/* 如果 pt-navbar 不可用或你想自定义，可以使用自定义 CSS */
/*
main {
    padding-top: 56px;
}
@media (max-width: 575.98px) {
    main {
        padding-top: 48px;
    }
}
*/

/* --- 可选：优化导航栏在滚动时的外观 --- */
/* 如果你在 JavaScript 中添加了 'scrolled' 类 */
#mainNav.navbar.scrolled {
    /* 例如，添加一个微妙的背景过渡或阴影加强 */
    /* background-color 通常由 bg-dark 提供 */
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    /* 如果需要更强的背景色变化 */
    /* background-color: rgba(33, 37, 41, 0.95) !important; */ /* 深灰半透明 */
}

/* --- 针对性解决可能的布局问题 --- */
/* 如果发现导航栏上方仍有白条，检查是否有隐藏的元素 */
body::before {
    content: "";
    display: none; /* 确保没有伪元素占用空间 */
}

/* --- 确保导航栏内部元素紧凑 --- */
#mainNav .navbar-brand {
    /* 移除品牌 logo 的 margin/padding，如果需要 */
    margin-right: 1rem; /* Bootstrap 默认有 */
}

#mainNav .navbar-toggler {
    /* 确保汉堡按钮没有额外边距 */
    border: none; /* 移除默认边框 */
    box-shadow: none; /* 移除可能的阴影 */
    padding: 0.25rem 0.5rem; /* 适当内边距 */
    margin-left: 0.5rem; /* 与品牌间距 */
}

/* --- 响应式调整 --- */
@media (max-width: 575.98px) { /* Extra small devices (portrait phones, less than 576px) */
    #mainNav .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    /* 确保在极小屏幕上也没有额外空间 */
    #mainNav.navbar {
        min-height: 48px; /* 设定最小高度 */
    }
}

/* --- 确保页面内容从顶部开始 --- */
/* 如果使用了 d-flex flex-column 在 body 上 */
body.d-flex.flex-column {
    min-height: 100vh; /* 视口高度 */
    margin: 0;
    padding: 0;
}
/* main.flex-grow-1 会填充剩余空间 */
.stat-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--success)!important;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--primary)!important;
    margin: 0;
    font-size: 1.1rem;
}