﻿/* 面料选择侧滑面板 */
.fabric-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

    .fabric-modal.active {
        visibility: visible;
        opacity: 1;
    }

/* 遮罩层 */
.fabric-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    z-index: 1;
}

/* 侧滑面板 */
.fabric-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 600px;
    height: 100%;
    background-color: #ffffff;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 2;
}

.fabric-modal.active .fabric-panel {
    transform: translateX(0);
}

/* 面板头部 */
.fabric-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.fabric-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.2s ease;
}

    .fabric-close:hover {
        background-color: #f3f4f6;
        color: #1f2937;
    }

/* 购物车面板样式 */
.cart-panel {
    max-width: 550px;
    display: flex;
    flex-direction: column;
}

/* 购物车可滚动内容区域 */
.cart-scrollable-content {
    flex: 1;
    overflow-y: auto;
    background-color: #ffffff;
}

/* 购物车商品列表 */
.cart-items-list {
    padding: 0;
}

/* 空购物车样式 */
.empty-cart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

/* 购物车商品项 */
.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
    background-color: #ffffff;
    transition: background-color 0.2s ease;
}

    .cart-item:hover {
        background-color: #f9fafb;
    }

/* 商品图片 */
.cart-item-image {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 0.5rem;
    flex-shrink: 0;
    border: 1px solid #e5e7eb;
}

/* 商品信息 */
.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
}

/* 删除按钮 */
.cart-item-remove {
    position: absolute;
    top: 0;
    right: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1;
    user-select: none;
}

    .cart-item-remove:hover {
        background-color: #000000;
        border-color: #000000;
        color: #ffffff;
    }

    .cart-item-remove:active {
        transform: scale(0.9);
    }

    .cart-item-remove i {
        font-size: 0.875rem;
        pointer-events: none;
    }

/* 商品标题 */
.cart-item-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
    margin-top: 0.5rem;
}

/* 卖家信息 */
.cart-item-seller {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

    .cart-item-seller a {
        color: #1f2937;
        text-decoration: underline;
        transition: color 0.2s ease;
    }

        .cart-item-seller a:hover {
            color: #fb6c23;
        }

/* 规格信息 */
.cart-item-specs {
    font-size: 0.8125rem;
    color: #374151;
    line-height: 1.6;
}

    .cart-item-specs strong {
        font-weight: 600;
        color: #1f2937;
    }

/* 商品底部（数量和价格） */
.cart-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 0.75rem;
}

/* 数量选择器 */
.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.25rem;
    background-color: #ffffff;
}

.quantity-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
    user-select: none;
}

    .quantity-btn:hover {
        background-color: #f3f4f6;
        color: #1f2937;
    }

    .quantity-btn:active {
        background-color: #e5e7eb;
        transform: scale(0.95);
    }

    .quantity-btn i {
        font-size: 0.75rem;
        pointer-events: none;
    }

.quantity-input {
    width: 50px;
    text-align: center;
    border: none;
    outline: none;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #1f2937;
    appearance: textfield;
    -moz-appearance: textfield;
}

    .quantity-input::-webkit-outer-spin-button,
    .quantity-input::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }

/* 价格 */
.cart-item-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.price-current {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.price-original {
    font-size: 1.125rem;
    font-weight: 500;
    color: #9ca3af;
    text-decoration: line-through;
}

/* 购物车底部 */
.cart-footer {
    background-color: #ffffff;
    border-top: 2px solid #e5e7eb;
}

/* 总价区域 */
.cart-total-section {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
}

.cart-total-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-total-label h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
}

.cart-total-note {
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.5;
    width: 100%;
}

.cart-total-price {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    white-space: nowrap;
}

/* 结算按钮 */
.cart-checkout-btn {
    width: calc(100% - 3rem);
    margin: 0 1.5rem 0;
    padding: 1rem;
    background: linear-gradient(to right, #9708CC, #43CBFF);
    color: #ffffff;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .cart-checkout-btn:hover {
        opacity: 0.9;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(151, 8, 204, 0.3);
    }

    .cart-checkout-btn:active {
        transform: translateY(0);
    }

/* 继续购物按钮 */
.cart-continue-shopping-btn {
    width: calc(100% - 3rem);
    margin: 0 1.5rem 1.5rem;
    padding: 1rem;
    background: transparent;
    color: #9708CC;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .cart-continue-shopping-btn:hover {
        background-color: rgba(151, 8, 204, 0.05);
        color: #7506a3;
    }

    .cart-continue-shopping-btn:active {
        background-color: rgba(151, 8, 204, 0.1);
    }

/* 推荐区域 */
.cart-recommendations {
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

.recommendations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.recommendations-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.recommendations-arrow {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background-color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

    .recommendations-arrow:hover {
        background-color: #1f2937;
        transform: scale(1.05);
    }

    .recommendations-arrow:active {
        transform: scale(0.95);
    }

    .recommendations-arrow i {
        font-size: 1rem;
    }

.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.recommendation-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

    .recommendation-item:hover {
        transform: translateY(-2px);
    }

    .recommendation-item img {
        width: 100%;
        aspect-ratio: 1;
        object-fit: cover;
        border-radius: 0.5rem;
        border: 1px solid #e5e7eb;
    }

.recommendation-title {
    font-size: 0.75rem;
    color: #374151;
    line-height: 1.4;
    text-align: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .cart-panel {
        max-width: 100%;
    }

    .cart-item {
        flex-direction: column;
        gap: 1rem;
    }

    .cart-item-image {
        width: 100%;
        height: auto;
        max-height: 250px;
    }

    .cart-item-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .cart-item-quantity {
        justify-content: center;
    }

    .cart-item-price {
        justify-content: center;
    }

    .recommendations-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cart-total-section {
        flex-direction: column;
        gap: 0.75rem;
    }

    .cart-total-price {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .recommendations-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .recommendation-title {
        font-size: 0.6875rem;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .review-panel {
        max-width: 100%;
    }

    .score-number {
        font-size: 2.5rem;
    }

    .reviewer-avatar,
    .avatar-placeholder {
        width: 40px;
        height: 40px;
    }

    .avatar-placeholder {
        font-size: 1rem;
    }

    .reviewer-name {
        font-size: 0.875rem;
    }

    .review-date {
        font-size: 0.75rem;
    }

    .review-text {
        font-size: 0.875rem;
    }

    .rating-select {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .star-rating i {
        font-size: 1.25rem;
    }

    .write-review-section {
        max-height: 60vh;
    }
}
