/* components.css - 通用组件样式 */

/* ========== 按钮组件 ========== */
.nav-icon-btn {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-normal) var(--ease-snappy);
    position: relative;
    box-shadow: var(--shadow-sm);
}

.nav-icon-btn .iconify {
    font-size: 24px;
}

.cart-trigger {
    background: var(--gradient-primary);
    color: var(--bg-primary);
}

.profile-btn {
    background: var(--gradient-warm);
    color: var(--bg-primary);
}

.orders-btn {
    background: var(--gradient-secondary);
    color: var(--bg-primary);
}

.nav-icon-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-glow);
}

.search-btn {
    padding: var(--space-lg) var(--space-2xl);
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-lg);
    color: var(--bg-primary);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-base);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-snappy);
    margin-right: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.search-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.search-btn:active {
    transform: scale(0.98);
}

.add-cart-btn {
    width: 100%;
    padding: var(--space-md);
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: var(--bg-primary);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-base);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    transition: all var(--duration-normal) var(--ease-snappy);
    box-shadow: var(--shadow-sm);
}

.add-cart-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    flex: 1;
    padding: var(--space-xl) var(--space-2xl);
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: var(--bg-primary);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    transition: all var(--duration-normal) var(--ease-snappy);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    padding: var(--space-xl) var(--space-2xl);
    background: transparent;
    border: 3px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: #1a1a1a;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    transition: all var(--duration-normal) var(--ease-snappy);
}

.btn-secondary:hover {
    background: rgba(255, 107, 74, 0.08);
    border-color: var(--primary);
    transform: translateY(-3px);
}

.checkout-btn {
    width: 100%;
    padding: var(--space-xl);
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: var(--bg-primary);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-black);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-snappy);
    margin-bottom: var(--space-md);
    box-shadow: var(--shadow-sm);
}

.checkout-btn:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-glow);
}

.view-orders-btn {
    width: 100%;
    padding: var(--space-lg);
    background: transparent;
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-snappy);
}

.view-orders-btn:hover {
    background: rgba(255, 107, 74, 0.08);
    border-color: var(--primary);
    transform: translateY(-3px);
}

.edit-btn {
    background: transparent;
    border: none;
    color: var(--primary);
    cursor: pointer;
    margin-left: var(--space-sm);
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all var(--duration-fast) var(--ease-snappy);
}

.edit-btn:hover {
    background: rgba(255, 107, 107, 0.1);
    transform: scale(1.1);
}

.edit-btn .iconify {
    font-size: 16px;
}

.delete-btn {
    background: transparent;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all var(--duration-fast) var(--ease-snappy);
}

.delete-btn:hover {
    background: rgba(255, 107, 107, 0.1);
    transform: scale(1.1);
}

.delete-btn .iconify {
    font-size: 16px;
}

.default-btn {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    cursor: pointer;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    transition: all var(--duration-fast) var(--ease-snappy);
}

.default-btn:hover {
    background: rgba(255, 107, 74, 0.08);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-3px);
}

.add-address-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-lg) var(--space-xl);
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-lg);
    color: var(--bg-primary);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-black);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-snappy);
    margin-top: var(--space-xl);
}

.add-address-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.add-address-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.add-address-btn .iconify {
    font-size: 20px;
}

.confirm-btn-main {
    width: 100%;
    padding: 25px 40px;
    background: linear-gradient(135deg, #ff6b4a, #ffb84d);
    border: none;
    border-radius: 20px;
    color: #fff;
    font-size: 20px;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s;
    box-shadow: 0 8px 24px rgba(255, 107, 74, 0.3);
    margin-bottom: 15px;
}

.confirm-btn-main:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(255, 107, 74, 0.4);
}

.confirm-btn-main:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.edit-btn-main {
    width: 100%;
    padding: 20px;
    background: transparent;
    border: 3px solid rgba(255, 107, 74, 0.3);
    border-radius: 20px;
    color: #ff6b4a;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.edit-btn-main:hover {
    background: rgba(255, 107, 74, 0.1);
    border-color: #ff6b4a;
    transform: translateY(-3px);
}

.btn-primary-large {
    padding: 25px 40px;
    background: linear-gradient(135deg, #ff6b4a, #ffb84d);
    border: none;
    border-radius: 20px;
    color: #fff;
    font-size: 20px;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(255, 107, 74, 0.3);
}

.btn-primary-large:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(255, 107, 74, 0.4);
}

.btn-secondary-large {
    padding: 25px;
    background: transparent;
    border: 3px solid rgba(255, 107, 74, 0.3);
    border-radius: 20px;
    color: #ff6b4a;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-secondary-large:hover {
    background: rgba(255, 107, 74, 0.1);
    border-color: #ff6b4a;
    transform: translateY(-3px);
}

/* ========== 卡片组件 ========== */
.product-card {
    background: var(--bg-card);
    border: 3px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-snappy);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-12px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.order-card:hover {
    border-color: var(--primary);
    transform: translateX(8px);
    box-shadow: var(--shadow-md);
}

.address-form-container:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.cart-item:hover {
    border-color: var(--primary);
    transform: translateX(-4px);
}

.item-card-detail:hover {
    border-color: #ff6b4a;
    transform: translateX(-5px);
}

/* ========== 徽章组件 ========== */
.default-badge {
    background: var(--gradient-primary);
    color: var(--bg-primary);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-black);
}

.order-status {
    padding: var(--space-sm) var(--space-xl);
    border-radius: var(--radius-full);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-sm);
}

.status-pending {
    background: var(--gradient-primary);
    color: var(--bg-primary);
}

.status-completed {
    background: var(--gradient-secondary);
    color: var(--bg-primary);
}

/* ========== 分类标签 ========== */
.category-tag {
    padding: var(--space-md) var(--space-xl);
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--duration-normal) var(--ease-snappy);
}

.category-tag:hover {
    transform: translateY(-3px);
    background: var(--bg-secondary);
    border-color: var(--border-medium);
}

.category-tag.active {
    background: var(--gradient-primary);
    color: var(--bg-primary);
    border-color: transparent;
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

/* ========== 侧边栏组件 ========== */
.sidebar-item {
    padding: var(--space-lg) var(--space-xl);
    margin-bottom: var(--space-sm);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    transition: all var(--duration-normal) var(--ease-snappy);
    color: var(--text-secondary);
    font-weight: var(--font-weight-bold);
}

.sidebar-item:hover {
    background: rgba(255, 107, 74, 0.08);
    color: var(--text-primary);
    transform: translateX(5px);
}

.sidebar-item.active {
    background: var(--gradient-primary);
    color: var(--bg-primary);
    box-shadow: var(--shadow-md);
}

.sidebar-item .iconify {
    font-size: 20px;
}

.logout-item {
    margin-top: auto;
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
    border: 2px solid rgba(255, 107, 107, 0.3);
}

.logout-item:hover {
    background: rgba(255, 107, 107, 0.2);
    color: #ff4757;
    border-color: rgba(255, 107, 107, 0.5);
    transform: translateX(5px);
}

.logout-item .iconify {
    font-size: 20px;
}

/* ========== 加载状态组件 ========== */
.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.loading-spinner {
    width: 80px;
    height: 80px;
    border: 6px solid var(--border-light);
    border-top-color: var(--primary);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
}

.loading-spinner-small {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ========== 空状态组件 ========== */
.empty-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-xl);
    color: var(--text-muted);
}

.empty-icon {
    font-size: 100px;
    margin-bottom: var(--space-xl);
    opacity: 0.3;
}

.empty-text {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
}

.no-address {
    text-align: center;
    padding: var(--space-2xl) 0;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border-light);
}

.no-address-icon {
    margin-bottom: var(--space-lg);
}

.no-address h3 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.no-address p {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    font-weight: var(--font-weight-bold);
}

.error-state {
    text-align: center;
    padding: 100px 20px;
}

.error-icon {
    font-size: 120px;
    color: rgba(255, 107, 74, 0.3);
    margin-bottom: 30px;
}

.error-text {
    font-size: 28px;
    font-weight: 700;
    color: #666;
    margin-bottom: 30px;
}

/* ========== 图标组件 ========== */
.logo {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-black);
    letter-spacing: -1px;
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.logo-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    cursor: pointer;
    transition: transform var(--duration-fast) var(--ease-bounce);
}

.logo-text:hover {
    transform: scale(1.05);
}

.product-icon {
    font-size: 110px;
    color: var(--primary);
    transition: all var(--duration-slow) var(--ease-bounce);
}

.product-card:hover .product-icon {
    transform: scale(1.15) rotate(5deg);
}

.product-icon-large {
    font-size: 200px;
    color: #ff6b4a;
    position: relative;
    z-index: 1;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.cart-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cart-item-icon {
    width: 100%;
    height: 100%;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--primary);
}

.item-icon-display {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(255, 107, 74, 0.1), rgba(78, 205, 196, 0.1));
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    flex-shrink: 0;
    color: #ff6b4a;
}

.avatar-large {
    width: 120px;
    height: 120px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    color: var(--bg-primary);
}

.product-image-area {
    width: 100%;
    aspect-ratio: 1/1; /* 强制1:1方形比例 */
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* 方形图片样式 */
.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 保持比例，裁剪多余部分 */
    display: block;
}

/* 图片加载失败时的回退样式 */
.product-image-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
}

.product-image-fallback .product-icon {
    font-size: 80px;
    color: var(--primary);
    opacity: 0.7;
}

/* 商品详情页的方形图片区域 */
.product-image-section {
    width: 100%;
    aspect-ratio: 1/1;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border: 3px solid var(--border-light);
}

.product-image-section .product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-image-section .product-image-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image-section .product-icon-large {
    font-size: 150px;
    color: var(--primary);
    opacity: 0.7;
}

@media (max-width: 768px) {
    .product-image-area {
        aspect-ratio: 1/1; /* 保持方形 */
    }
    
    .product-image-fallback .product-icon {
        font-size: 50px;
    }
    
    .product-image-section .product-icon-large {
        font-size: 100px;
    }
}

.stock-icon {
    font-size: 32px;
    color: #4ecdc4;
}

.theme-toggle {
    padding: var(--space-md);
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-snappy);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* ========== Element Plus Select 自定义样式 ========== */
.el-select {
    --el-select-input-focus-border-color: #ff6b6b !important;
}

.el-input__wrapper {
    background: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 0 0 1px rgba(255, 107, 107, 0.25) inset !important;
    border-radius: 50px !important;
    padding: 8px 16px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.el-input__wrapper:hover {
    box-shadow: 0 0 0 1px rgba(255, 107, 107, 0.35) inset !important;
    background: rgba(255, 255, 255, 0.12) !important;
    transform: translateY(-1px) !important;
}

.el-input__wrapper.is-focus {
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.4) inset, 0 4px 12px rgba(255, 107, 107, 0.15) !important;
    background: rgba(255, 255, 255, 0.15) !important;
}

.el-input__inner {
    color: #2a2a2a !important;
    font-weight: 600 !important;
    font-size: 15px !important;
}

.el-input__inner::placeholder {
    color: rgba(42, 42, 42, 0.5) !important;
    font-weight: 500 !important;
}

.el-select__caret {
    color: rgba(255, 107, 107, 0.7) !important;
    font-size: 18px !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.el-select__caret.is-reverse {
    transform: rotate(180deg) !important;
}

.el-select-dropdown {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(20px) !important;
    border: 1.5px solid rgba(255, 107, 107, 0.15) !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08) !important;
    padding: 6px !important;
}

.el-select-dropdown__item {
    color: #2a2a2a !important;
    font-weight: 500 !important;
    font-size: 15px !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border-radius: 10px !important;
    margin: 2px 4px !important;
    padding: 10px 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    overflow: visible !important;
}

.el-select-dropdown__item:hover {
    background: rgba(255, 107, 107, 0.08) !important;
    color: #ff6b6b !important;
    transform: translateX(4px) !important;
}

.el-select-dropdown__item.is-selected {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.12), rgba(255, 184, 77, 0.08)) !important;
    color: #ff6b6b !important;
    font-weight: 600 !important;
    border: 1.5px solid rgba(255, 107, 107, 0.2) !important;
}

.el-select-dropdown__item.is-selected .item-text {
    flex: 0 0 auto !important;
}

.el-select-dropdown__item.is-selected::after {
    content: '✓' !important;
    flex-shrink: 0 !important;
    color: #ff6b6b !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    margin-left: 12px !important;
}

.el-select__popper .el-popper__arrow::before {
    background: rgba(255, 255, 255, 0.85) !important;
    border: 1.5px solid rgba(255, 107, 107, 0.15) !important;
}

.el-select__popper .el-popper__arrow::after {
    border-top-color: rgba(255, 255, 255, 0.85) !important;
    border-bottom-color: rgba(255, 255, 255, 0.85) !important;
    border-left-color: rgba(255, 255, 255, 0.85) !important;
    border-right-color: rgba(255, 255, 255, 0.85) !important;
}
