/* 产品详情页移动端优化样式 */

/* 移动端优化容器 */
.product-detail-container {
    padding-bottom: 100px; /* 为底部固定按钮留出空间 */
}

/* 轮播样式 */
.swiper-container {
    width: 100%;
    height: 300px;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
}

.swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.swiper-pagination {
    position: absolute;
    bottom: 10px !important;
}

.swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 1;
}

.swiper-pagination-bullet-active {
    background: var(--primary-color);
}

.swiper-button-next,
.swiper-button-prev {
    color: white;
    background: rgba(0, 0, 0, 0.3);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.swiper-button-next:after,
.swiper-button-prev:after {
    font-size: 18px;
}

/* 缩略图 */
.product-thumbnails {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
}

.thumbnail-btn {
    flex: 0 0 auto;
    width: 80px;
    height: 60px;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-light);
    position: relative;
    padding: 0;
}

.thumbnail-btn.active {
    border-color: var(--primary-color);
}

.thumbnail-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-btn i {
    font-size: 20px;
    color: var(--text-medium);
}

.thumbnail-btn span {
    display: block;
    font-size: 12px;
    color: var(--text-medium);
}

/* 规格摘要 */
.spec-item {
    background: var(--bg-light);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    transition: all 0.2s ease;
}

.spec-item:hover {
    background: var(--border-color);
}

.spec-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.spec-value {
    font-size: 1.125rem;
    line-height: 1.2;
}

.spec-label {
    font-size: 0.75rem;
    line-height: 1.2;
}

/* 颜色选择 */
.color-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-sm);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    background: var(--bg-light);
    transition: all 0.2s ease;
}

.color-option.active {
    border-color: var(--primary-color);
    background: var(--bg-white);
}

.color-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-bottom: var(--space-xs);
    border: 2px solid transparent;
}

.color-option.active .color-dot {
    border-color: var(--primary-color);
}

.color-label {
    font-size: 0.875rem;
    color: var(--text-medium);
}

/* 数量选择器 */
.quantity-selector {
    background: var(--bg-light);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
}

.quantity-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
}

.quantity-input {
    width: 60px;
    height: 44px;
    font-size: 1.125rem;
    font-weight: 600;
}

.quantity-input::-webkit-inner-spin-button,
.quantity-input::-webkit-outer-spin-button {
    opacity: 1;
    height: 44px;
}

/* 快速操作按钮 */
.quick-actions {
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1030;
}

.quick-actions .btn {
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.quick-actions .btn i {
    font-size: 1.25rem;
    margin-bottom: 2px;
}

/* 加密货币优惠 */
.crypto-discount-banner {
    background: linear-gradient(135deg, var(--primary-color), #3B82F6);
}

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

/* 用户评价 */
.review-item {
    padding-top: var(--space-md);
}

.review-images img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-md);
}

/* 常见问题 */
.accordion-button {
    font-weight: 500;
    padding: var(--space-md);
}

.accordion-button:not(.collapsed) {
    background-color: var(--primary-color);
    color: white;
}

.accordion-button:focus {
    box-shadow: none;
    border-color: var(--primary-color);
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    box-shadow: var(--shadow-md);
    z-index: 1020;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.back-to-top:hover {
    background: #1D4ED8;
    transform: translateY(-2px);
}

/* Toast消息 */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1060;
    max-width: 90%;
}

/* 移动端优化响应式 */
@media (max-width: 374px) {
    .swiper-container {
        height: 250px;
    }
    
    .thumbnail-btn {
        width: 70px;
        height: 50px;
    }
    
    .quick-actions .btn {
        height: 50px;
        font-size: 0.75rem;
    }
    
    .quick-actions .btn i {
        font-size: 1rem;
    }
}

@media (min-width: 768px) {
    .quick-actions {
        position: static;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: var(--space-md) 0;
    }
    
    .quick-actions .container {
        max-width: 400px;
    }
    
    .quick-actions .btn {
        height: 50px;
        flex-direction: row;
        font-size: 1rem;
    }
    
    .quick-actions .btn i {
        font-size: 1rem;
        margin-bottom: 0;
        margin-right: 8px;
    }
    
    .product-detail-container {
        padding-bottom: 0;
    }
}

/* 横屏优化 */
@media (orientation: landscape) and (max-width: 767px) {
    .swiper-container {
        height: 200px;
    }
    
    .quick-actions {
        bottom: 0;
    }
}

/* 暗色模式优化 */
@media (prefers-color-scheme: dark) {
    .spec-item {
        background: #374151;
    }
    
    .color-option {
        background: #374151;
    }
    
    .quantity-selector {
        background: #374151;
    }
    
    .thumbnail-btn {
        background: #374151;
    }
}

/* 加载状态 */
.loading-placeholder {
    background: var(--bg-light);
    border-radius: var(--radius-md);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* 触摸反馈优化 */
.touch-feedback-area {
    position: relative;
    overflow: hidden;
}

.touch-feedback-area:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%, -50%);
    transform-origin: 50% 50%;
}

.touch-feedback-area:active:after {
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

/* 移动端优化滚动条 */
.mobile-scroll-container {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.mobile-scroll-container::-webkit-scrollbar {
    height: 4px;
}

.mobile-scroll-container::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 2px;
}

.mobile-scroll-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

/* 移动端优化过渡 */
.fade-in-up {
    animation: fadeInUp 0.3s ease-out;
}

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

/* 移动端优化工具提示 */
.mobile-tooltip {
    position: relative;
}

.mobile-tooltip:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-dark);
    color: white;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1070;
}

.mobile-tooltip:hover:before {
    opacity: 1;
    visibility: visible;
}

/* 移动端优化焦点状态 */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 移动端优化禁用状态 */
:disabled,
.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    touch-action: none;
}