/* GlobalSIM - Global SIM Card Store Styles */

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(59, 130, 246, 0.5);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* 自定义动画类 */
.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* 产品卡片悬停效果 */
.product-card {
    position: relative;
    overflow: hidden;
}

.product-card::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 ease;
}

.product-card:hover::before {
    left: 100%;
}

/* 购物车侧边栏动画 */
#cartPanel {
    will-change: transform;
}

#cartPanel.open {
    transform: translateX(0);
}

/* 按钮点击效果 */
button:active {
    transform: scale(0.98);
}

/* 导航栏滚动效果 */
#navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* FAQ 展开/收起动画 */
.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-content.active {
    max-height: 500px;
}

.faq-btn i {
    transition: transform 0.3s ease;
}

.faq-btn.active i {
    transform: rotate(180deg);
}

/* Toast 提示动画 */
#toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* 筛选按钮激活状态 */
.filter-btn.active {
    background: linear-gradient(135deg, #2563eb, #9333ea);
    color: white;
}

/* 渐变文字效果增强 */
.bg-clip-text {
    -webkit-background-clip: text;
    background-clip: text;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 购物车项目动画 */
.cart-item {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 数量输入框样式 */
.quantity-input::-webkit-inner-spin-button,
.quantity-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-input {
    -moz-appearance: textfield;
}

/* 响应式字体大小 */
@media (max-width: 640px) {
    html {
        font-size: 14px;
    }
}

/* 打印样式 */
@media print {
    #navbar,
    #cartSidebar,
    #toast,
    footer {
        display: none;
    }
}

/* 焦点样式 */
button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* 禁用状态 */
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 图片懒加载占位 */
img[loading="lazy"] {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

img[loading="lazy"].loaded {
    animation: none;
    background: none;
}