/* 手机端商品详情页样式 */

.m-detail-main {
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}

/* 图片轮播 */
.m-detail-gallery {
    position: relative;
    width: 100%;
    background: #fff;
    overflow: hidden;
}

.m-gallery-track {
    display: flex;
    transition: transform 0.3s ease;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    perspective: 1000px;
    -webkit-perspective: 1000px;
}

.m-gallery-item {
    min-width: 100%;
    width: 100%;
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.m-gallery-item img {
    width: 100%;
    max-width: 430px;
    height: 430px;
    object-fit: contain;
    background: #FFFFFF;
    display: block;
}

.m-gallery-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}

.m-gallery-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
}

.m-gallery-dots span.active {
    width: 18px;
    border-radius: 3px;
    background: #C9A86C;
}

/* 商品信息 */
.m-detail-info {
    background: #fff;
    padding: 15px;
    margin-bottom: 10px;
}

.m-price-area {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.m-current-price {
    font-size: 24px;
    font-weight: 600;
    color: #C9A86C;
}

.m-original-price {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
}

.m-discount-tag {
    background: #D4C09A;
    color: #fff;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 3px;
}

.m-goods-title {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
    margin-bottom: 8px;
}

.m-goods-intro {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    height: auto !important;
    display: block !important;
}

/* 规格选择 */
.m-detail-options {
    background: #fff;
    padding: 15px;
    margin-bottom: 10px;
}

.m-option-group {
    margin-bottom: 15px;
}

.m-option-group:last-child {
    margin-bottom: 0;
}

.m-option-group label {
    display: block;
    font-size: 14px;
    color: #333;
    margin-bottom: 10px;
    font-weight: 500;
}

.m-option-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.m-option-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}

.m-option-btn.active {
    border-color: #C9A86C;
    color: #C9A86C;
    background: #fff5f5;
}

/* 数量选择�?*/
.m-quantity-selector {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.m-qty-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    font-size: 18px;
    color: #333;
    cursor: pointer;
}

.m-qty-btn:active {
    background: #eee;
}

.m-quantity-selector input {
    width: 50px;
    height: 36px;
    border: none;
    text-align: center;
    font-size: 14px;
    background: #fff;
}

/* 操作按钮区域（页面内�?*/
.m-detail-actions {
    background: #fff;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.m-fav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    color: #666;
    font-size: 10px;
    cursor: pointer;
}

.m-fav-btn svg {
    width: 22px;
    height: 22px;
    margin-bottom: 2px;
    flex-shrink: 0;
}

/* 默认状态：灰色描边，避免 CSS 未加载时显示为黑色大图标 */
.m-fav-btn .heart-path {
    stroke: #666;
    fill: none;
}

.m-fav-btn.liked {
    color: #C9A86C;
    border-color: #C9A86C;
    background: #fff5f5;
}

.m-fav-btn.liked .heart-path {
    fill: #C9A86C;
    stroke: #C9A86C;
}

.m-add-cart-btn {
    flex: 1;
    height: 44px;
    border: none;
    border-radius: 22px;
    background: linear-gradient(135deg, #D4B896 0%, #C9A86C 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}

.m-add-cart-btn:active {
    opacity: 0.9;
}

/* 商品详情描述 */
.m-detail-desc {
    background: #fff;
    padding: 15px;
    margin-bottom: 10px;
}

.m-desc-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.m-desc-header h2 {
    font-size: 15px;
    font-weight: 500;
    color: #333;
}

.m-desc-content {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    background-color: #fafafa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 100%;
    max-height: 600px;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow-y: auto;
    overflow-x: auto;
}

/* 自定义滚动条样式 */
.m-desc-content::-webkit-scrollbar {
    width: 8px;
}

.m-desc-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.m-desc-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.m-desc-content::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Firefox滚动条样式 */
.m-desc-content {
    scrollbar-width: thin;
    scrollbar-color: #ccc #f1f1f1;
}

.m-desc-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
}

/* 弹窗 */
.m-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
}

.m-modal.show {
    display: flex;
}

.m-modal-content {
    width: 100%;
    max-width: 500px;
    background: #fff;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.m-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.m-modal-header h3 {
    font-size: 16px;
    font-weight: 500;
}

.m-modal-close {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    font-size: 24px;
    color: #999;
    cursor: pointer;
}

.m-modal-body {
    display: flex;
    padding: 15px;
    gap: 15px;
}

.m-modal-body img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 8px;
    background: #FFFFFF;
}

.m-modal-info {
    flex: 1;
}

.m-modal-info p {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

.m-modal-info p:first-child {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.m-modal-price {
    color: #C9A86C !important;
    font-weight: 500;
}

.m-modal-footer {
    display: flex;
    gap: 10px;
    padding: 15px;
    padding-bottom: 25px;
}

.m-modal-btn {
    flex: 1;
    height: 44px;
    border-radius: 22px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
}

.m-modal-btn.secondary {
    background: #f5f5f5;
    color: #666;
}

.m-modal-btn.primary {
    background: #C9A86C;
    color: #fff;
}
