/* Header Enhanced Styles - 购物车、登录、表单功能 */

/* ===== 搜索框样式 ===== */
.search-container {
    position: relative;
    margin-right: 1rem;
}

.search-form {
    align-items: center;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 25px;
    overflow: hidden;
    transition: all 0.3s ease;
    min-width: 200px;
}

.search-form:focus-within {
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    border-color: #3498db;
}

.search-input {
    border: none;
    outline: none;
    padding: 0.75rem 1rem;
    flex: 1;
    font-size: 0.9rem;
    background: transparent;
}

.search-input::placeholder {
    color: #999;
}

.search-btn {
    background: #3498db;
    border: none;
    color: white;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    background: #2980b9;
}

/* ===== 购物车样式 ===== */
.cart-container {
    position: relative;
    margin-right: 1rem;
}

.cart-btn {
    position: relative;
    background: transparent;
    border: 2px solid #3498db;
    color: #3498db;
    padding: 0.75rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-btn:hover {
    background: #3498db;
    color: white;
    transform: scale(1.05);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.cart-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    width: 350px;
    max-height: 500px;
    overflow: hidden;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.cart-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(5px);
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.cart-header h4 {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
}

.close-cart {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    padding: 0.25rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-cart:hover {
    background: #e9ecef;
    color: #333;
}

.cart-items {
    max-height: 300px;
    overflow-y: auto;
}

.cart-items::-webkit-scrollbar {
    width: 6px;
}

.cart-items::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.cart-items::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.empty-cart {
    text-align: center;
    padding: 3rem 2rem;
    color: #999;
}

.empty-cart i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-cart p {
    margin: 0;
    font-size: 1rem;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #eee;
    transition: background 0.3s ease;
}

.cart-item:hover {
    background: #f8f9fa;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 1rem;
    flex-shrink: 0;
}

.cart-item-details {
    flex: 1;
    min-width: 0;
}

.cart-item-details h5 {
    margin: 0 0 0.25rem 0;
    font-size: 0.9rem;
    color: #333;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-item-price {
    color: #3498db;
    font-weight: bold;
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.cart-item-quantity button {
    background: #f8f9fa;
    border: 1px solid #ddd;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.cart-item-quantity button:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.cart-item-quantity span {
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 20px;
    text-align: center;
}

.remove-item {
    background: #e74c3c;
    border: none;
    color: white;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    margin-left: 0.75rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.remove-item:hover {
    background: #c0392b;
    transform: scale(1.05);
}

.cart-footer {
    padding: 1.25rem;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-weight: bold;
    font-size: 1.1rem;
}

.total-amount {
    color: #27ae60;
    font-size: 1.2rem;
}

.cart-actions {
    display: flex;
    gap: 0.75rem;
}

.cart-actions .btn {
    flex: 1;
    padding: 0.75rem;
    text-align: center;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

/* ===== 用户账户样式 ===== */
.user-container {
    position: relative;
    margin-right: 1rem;
}

.auth-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.auth-buttons .btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.auth-buttons .btn:hover {
    transform: translateY(-1px);
}

.user-dropdown {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    border: 1px solid #ddd;
    padding: 0.625rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.user-btn:hover {
    background: #f8f9fa;
    border-color: #3498db;
    transform: translateY(-1px);
}

.user-name {
    font-weight: 500;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #333;
}

.user-btn i:last-child {
    transition: transform 0.3s ease;
    color: #666;
}

.user-dropdown.active .user-btn i:last-child {
    transform: rotate(180deg);
}

.user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    width: 280px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.user-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(5px);
}

.user-menu-header {
    padding: 1.25rem;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info i {
    font-size: 2.5rem;
    color: #3498db;
}

.user-info h5 {
    margin: 0 0 0.25rem 0;
    color: #333;
    font-size: 1rem;
    font-weight: 600;
}

.user-info p {
    margin: 0;
    color: #666;
    font-size: 0.85rem;
}

.user-menu-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.user-menu-items li {
    border-bottom: 1px solid #eee;
}

.user-menu-items li:last-child {
    border-bottom: none;
}

.user-menu-items li.divider {
    height: 1px;
    background: #eee;
    margin: 0.5rem 0;
    border: none;
}

.user-menu-items a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.user-menu-items a:hover {
    background: #f8f9fa;
    color: #3498db;
    transform: translateX(5px);
}

.user-menu-items a i {
    width: 16px;
    color: #666;
    transition: color 0.3s ease;
}

.user-menu-items a:hover i {
    color: #3498db;
}

/* ===== 模态框样式 ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.25rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    padding: 0.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #e9ecef;
    color: #333;
    transform: scale(1.1);
}

.modal-body {
    padding: 2rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

/* ===== 表单样式 ===== */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    transform: translateY(-1px);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #666;
    font-size: 0.8rem;
}

.password-input {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input input {
    padding-right: 3rem;
}

.toggle-password {
    position: absolute;
    right: 0.875rem;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.toggle-password:hover {
    background: #f8f9fa;
    color: #333;
}

.password-strength {
    margin-top: 0.75rem;
}

.strength-bar {
    height: 4px;
    background: #eee;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-text {
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #333;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: #3498db;
}

.form-actions {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.form-actions .btn {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.form-actions .btn:hover {
    transform: translateY(-1px);
}

.form-links {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.form-links a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.form-links a:hover {
    color: #2980b9;
    text-decoration: underline;
}

.form-links span {
    margin: 0 0.5rem;
    color: #999;
}

/* ===== 快速询价浮动按钮 ===== */
.quick-inquiry-float {
    position: fixed;
    bottom: 140px;
    right: 20px;
    z-index: 1000;
}

.quick-inquiry-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50px;
    color: white;
    padding: 1rem 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.9rem;
}

.quick-inquiry-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.5);
}

.quick-inquiry-btn i {
    font-size: 1.1rem;
}

.inquiry-text {
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.quick-inquiry-btn:hover .inquiry-text {
    opacity: 1;
    transform: translateX(0);
}

/* ===== 通知样式 ===== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    border-left: 4px solid #3498db;
    padding: 1rem 1.25rem;
    max-width: 400px;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideIn 0.4s ease;
    backdrop-filter: blur(10px);
}

.notification.success {
    border-left-color: #27ae60;
}

.notification.error {
    border-left-color: #e74c3c;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.notification-content i {
    font-size: 1.25rem;
}

.notification.success i {
    color: #27ae60;
}

.notification.error i {
    color: #e74c3c;
}

.notification.info i {
    color: #3498db;
}

.notification-content span {
    font-size: 0.9rem;
    color: #333;
    font-weight: 500;
}

.notification-close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.notification-close:hover {
    background: #f8f9fa;
    color: #333;
}

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

/* ===== 按钮样式 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-outline {
    background: transparent;
    color: #3498db;
    border: 1px solid #3498db;
}

.btn-outline:hover {
    background: #3498db;
    color: white;
    transform: translateY(-1px);
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #219a52;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    .search-container {
        display: none;
    }
    
    .header-actions {
        gap: 0.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .cart-dropdown,
    .user-menu {
        width: 300px;
        right: -50px;
    }
    
    .modal-content {
        width: 95%;
        margin: 0 auto;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .auth-buttons {
        gap: 0.5rem;
    }
    
    .auth-buttons .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .quick-inquiry-float {
        bottom: 80px;
        right: 15px;
    }
    
    .quick-inquiry-btn {
        padding: 0.875rem;
        border-radius: 50%;
        width: 56px;
        height: 56px;
    }
    
    .inquiry-text {
        display: none;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .cart-dropdown,
    .user-menu {
        width: 280px;
        right: -60px;
    }
    
    .modal-header {
        padding: 1rem 1.5rem;
    }
    
    .modal-body {
        padding: 1rem 1.5rem;
    }
    
    .user-name {
        max-width: 80px;
    }
}



/* ===== 辅助类 ===== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }

/* ===== 平滑滚动 ===== */
html {
    scroll-behavior: smooth;
}

/* ===== 选择文本颜色 ===== */
::selection {
    background: rgba(52, 152, 219, 0.2);
    color: #333;
}

::-moz-selection {
    background: rgba(52, 152, 219, 0.2);
    color: #333;
}

/* Inquiry 按钮容器 */
.inquiry-container {
    margin-right: 15px;
    position: relative;
}

/* Inquiry 按钮主体 - 圆形设计 */
.inquiry-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    position: relative;
    overflow: hidden;
}

/* 按钮悬停效果 */
.inquiry-btn:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

/* 按钮点击效果 */
.inquiry-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* 按钮焦点效果 */
.inquiry-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.3);
}

/* 按钮图标 */
.inquiry-btn i {
    font-size: 18px;
    color: white;
    transition: transform 0.3s ease;
}

/* 图标悬停效果 */
.inquiry-btn:hover i {
    transform: scale(1.1);
}

/* 按钮文字 - 默认隐藏 */
.inquiry-text {
    display: none;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .inquiry-container {
        margin-right: 10px;
    }
    
    .inquiry-btn {
        width: 45px;
        height: 45px;
    }
    
    .inquiry-btn i {
        font-size: 16px;
    }
}

/* 超小屏幕适配 */
@media (max-width: 480px) {
    .inquiry-btn {
        width: 40px;
        height: 40px;
    }
    
    .inquiry-btn i {
        font-size: 14px;
    }
}

/* 按钮禁用状态 */
.inquiry-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.inquiry-btn:disabled:hover {
    transform: none;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

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

.inquiry-btn.loading i {
    animation: spin 1s linear infinite;
}

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

/* 按钮成功状态 */
.inquiry-btn.success {
    background: #28a745;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.inquiry-btn.success:hover {
    background: #218838;
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

/* 按钮错误状态 */
.inquiry-btn.error {
    background: #dc3545;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.inquiry-btn.error:hover {
    background: #c82333;
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

/* 按钮光效 */
.inquiry-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 ease;
}

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