/* 通用页面样式 - 所有页面共享 */

/* 导入基础变量 */
@import url('../base/variables.css');

/* 主题色彩变量 - 使用variables.css中定义的变量 */

/* 主题色彩工具类 */
.text-primary { color: var(--primary-color); }
.bg-primary { background-color: var(--primary-color); }
.text-secondary { color: var(--secondary-color); }
.bg-secondary { background-color: var(--secondary-color); }
.text-accent { color: var(--accent-color); }
.bg-accent { background-color: var(--accent-color); }
.text-dark { color: var(--dark-color); }
.bg-dark { background-color: var(--dark-color); }
.text-neutral { color: var(--neutral-color); }

/* 通用卡片悬停效果 - 增强版 */
.card-hover {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}
.card-hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
    z-index: 1;
}
.card-hover:hover::before {
    left: 100%;
}
.card-hover:hover {
    transform: translateY(-12px) scale(1.03);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15), 0 10px 20px rgba(255, 107, 53, 0.1);
    border-color: rgba(255, 107, 53, 0.2);
}

/* 卡片内部元素动画 */
.card-hover img {
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.card-hover:hover img {
    transform: scale(1.15);
}

/* 卡片标题动画 */
.card-hover h3 {
    transition: color 0.3s ease, transform 0.3s ease;
}
.card-hover:hover h3 {
    color: var(--primary-color);
    transform: translateX(4px);
}

/* 卡片价格动画 */
.card-hover .text-primary {
    transition: all 0.3s ease;
}
.card-hover:hover .text-primary {
    transform: scale(1.1);
    text-shadow: 0 2px 10px rgba(255, 107, 53, 0.3);
}

/* 通用按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: 1.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    text-decoration: none;
    min-height: 44px;
    position: relative;
    overflow: hidden;
    margin: var(--spacing-xs);
}

/* 按钮尺寸类 */
.btn-lg {
    padding: var(--spacing-lg) var(--spacing-2xl);
    font-size: 1rem;
    min-height: 50px;
}

.btn-sm {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.8125rem;
    min-height: 38px;
}

.btn-xs {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.75rem;
    min-height: 32px;
}

/* 更小尺寸的按钮，用于热门商品的购物车按钮 */
.btn-smaller {
    padding: 4px 10px;
    font-size: 0.7rem;
    min-height: 28px;
    border-radius: 1rem;
    margin: 0;
}

/* 移动端按钮间距优化 */
@media (max-width: 768px) {
    .btn {
        padding: var(--spacing-sm) var(--spacing-lg);
        margin: var(--spacing-xs) 0;
    }
}

/* 按钮光效动画 */
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

/* 统一的按钮光效类 - 可用于非btn类的按钮元素 */
.btn-glow {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-glow::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-glow:hover::before {
    left: 100%;
}

.btn-glow:hover {
    transform: translateY(-2px) scale(1.02);
}

.btn-glow:active {
    transform: translateY(-1px) scale(1.01);
    transition-duration: 0.1s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #E55A2B);
    color: white;
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.3);
    border: none;
    border-radius: 50px;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #E55A2B, var(--primary-color));
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.4);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, var(--primary-color), #E55A2B);
    color: white;
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.3);
    border: none;
    border-radius: 50px;
}
.btn-secondary:hover {
    background: linear-gradient(135deg, #E55A2B, var(--primary-color));
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.4);
    color: white;
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent-color), #45A049);
    color: white;
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.3);
}
.btn-accent:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(76, 175, 80, 0.4);
    background: linear-gradient(135deg, #45A049, var(--accent-color));
    color: white;
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    position: relative;
    overflow: hidden;
}

.btn-outline::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 107, 53, 0.1), transparent);
    transition: left 0.6s;
}

.btn-outline:hover::before {
    left: 100%;
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.3);
}

/* 导航栏优化 */
.navbar-glass {
    backdrop-filter: blur(15px);
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* 图标显示优化 */
.nav-icon {
    font-size: 1.25rem;
    color: var(--dark-color);
    transition: all 0.3s ease;
    text-shadow: none;
}

.nav-icon:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

/* 图标可见性增强 */
i[class*="fa-"] {
    font-style: normal;
    font-weight: 900;
    line-height: 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* 确保图标在所有背景上可见 */
.icon-enhanced {
    color: var(--dark-color) !important;
    font-weight: 900;
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.5);
}

.icon-enhanced:hover {
    color: var(--primary-color) !important;
}

/* 搜索框优化 */
.search-input {
    background: rgba(248, 249, 250, 0.8);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    border-radius: 2rem;
}
.search-input:focus {
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.1);
}

/* 响应式优化 */
.responsive-text {
    font-size: clamp(1rem, 2.5vw, 1.125rem);
}

/* 工具类 */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* 动画效果 */
.fade-in {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 面包屑导航 */
.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    padding: 0 0.5rem;
    color: var(--neutral-color);
}

/* 全局加载状态 */
.global-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.global-loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.global-loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 107, 53, 0.2);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.global-loading-text {
    margin-top: 1rem;
    color: var(--dark-color);
    font-weight: 500;
    font-size: 1.125rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 按钮加载状态 */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}