﻿.productv-box {
    display: flex;
    justify-content: space-between;
    padding-bottom: 60px;
}

.gallery-img {
    width: 48%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* 强制行高由自身内容（1:1比例）决定，而不是被父级拉伸 */
    grid-auto-rows: min-content;
/*    gap: 10px;*/
    align-content: start; /* 顶部对齐，多余空间留给底部 */
}

/* 2. 锁定 1:1 比例 */
.gallery-imli {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1; /* 锁定正方形 */
    overflow: hidden;
    background-color: #f5f5f5; /* 占位色 */
    border-radius: 8px;
}

/* 3. 强制图片“铺满”且“不留白” */
.main-img {
    width: 100% !important;
    height: 100% !important; /* 必须强制 100% */
    display: block;
    object-fit: cover; /* 关键：裁切原图以充满正方形，绝不留白 */
    object-position: center;
}

.gallery-max {
    width: 55px;
    height: 55px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 10;
}

    .gallery-max > img {
        width: 100%;
        height: 100%;
        border-radius: 50%;
    }





.productv-info {
    width: 48%;
}

.info-collect {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

    .info-collect > h1 {
        width: 95%;
        font-size: 36px;
        font-weight: 500;
        color: #333;
    }

    .info-collect > img {
        width: 20px;
        height: 20px;
        margin: 18px 0;
    }

.info-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 10px;
    font-size: 14px;
}

.info-stars {
    color: #ffc107;
}

.info-rating span {
    font-size: 20px;
    color: #666666;
}

.info-price {
    font-size: 20px;
    color: #e63946;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e5e5;
}

    .info-price span {
        font-size: 18px;
    }


.variant-selector {
    margin-bottom: 15px;
}

.selector-label {
    display: block;
    font-size: 14px;
    margin-bottom: 10px;
    color: #666666;
}

    .selector-label span {
        color: #999999;
    }

.pattern-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.pattern-dot {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    border: 2px solid #fff; /* �ڲ��ױߣ����Ӿ��¸� */
    box-shadow: 0 0 0 1px #ccc; /* Ĭ�ϻ�ɫϸ�߿� */
    cursor: pointer;
    /* ����ͼ���Ĵ��� */
    background-repeat: no-repeat;
    background-size: cover; /* ���ģ��ȱ����Ų�����������ü����ಿ�� */
    background-position: center; /* ���ģ�ʼ�վ���չʾͼƬ�������� */
    background-color: #f5f5f5; /* ����ǰ��ͼƬȱʧʱ��ռλ��ɫ */
    /* ����ƽ������ */
    transition: all 0.2s ease-in-out;
}

    /* �����ͣЧ�� */
    .pattern-dot:hover {
        box-shadow: 0 0 0 1px #16add7;
        transform: translateY(-2px); /* ΢С���ϸ���Ч */
    }

    /* ѡ�м���״̬ */
    .pattern-dot.active {
        box-shadow: 0 0 0 2px #16add7; /* ѡ��ʱ�߿�Ӵֲ���ɫ */
        border-color: #fff; /* ���ְױ߲������� */
    }

.size-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 10px;
}

.quantity-selector {
    margin-bottom: 20px;
}

.quantity-disp {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.selector-num {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .selector-num button {
        width: 30px;
        height: 30px;
        border: 1px solid #ccc;
        background: #fff;
        border-radius: 4px;
        cursor: pointer;
    }



.shipping-policy {
    background: #f0f7ff;
    border: 1px solid #d4e8f7;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #555;
    line-height: 1.6;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
}

.btn-primary {
    background: #00a8e8;
    color: #fff;
}

.btn-outline {
    background: #fff;
    color: #00a8e8;
    border: 2px solid #00a8e8;
}

.layui-form-select dl dd.layui-this {
    background-color: #00a8e8;
}





.productv-effect {
    padding-bottom: 100px;
}

.effect-tit {
    font-size: 40px;
}

.effect-img {
    padding-top: 35px;
}

    .effect-img > img {
        width: 100%;
        height: auto;
    }





/* ͼƬԤ�� */
.preview-popup {
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999;
    background-color: #ffffff;
    overflow: hidden;
}

.preview-popimg {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease; /* �Ŵ���С�Ĺ��ɶ��� */
}

/* .preview-popimg>img {
    width: auto;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
} */

/* ͼƬ��ʽ */
.zoom-img {
    width: auto;
    height: 100%;
    object-fit: cover;
    display: block;
    user-select: none;
    /* ��ֹѡ��ͼƬ���� */
    -webkit-user-drag: none;
    /* ��ֹ�����Ĭ����ק */
}

/* �Ŵ�״̬�� */
.zoomed-in {
    /* �Ŵ��� */
    transform: scale(2.5);
    z-index: 1000;
    /* ��֤�Ŵ�������ϲ� */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* ��קʱ����ʽ��ȥ�����ɶ�������֤�������� */
.dragging {
    transition: none !important;
    cursor: grabbing;
    /* �����ץȡ״̬ */
}



.preview_button {
    width: 55px;
    height: 55px;
    position: absolute;
    padding: 10px;
    background: #ffffffb3;
    color: #000;
    pointer-events: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

    .preview_button i {
        font-size: 24px;
    }

.preview-close {
    top: 0;
    right: 0;
}

.preview-switch-left {
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.preview-switch-right {
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.preview-instruct {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px;
    background-color: #ffffff;
    display: flex;
    gap: 5px;
}

    .preview-instruct a {
        width: 70px;
        height: 70px;
    }

        .preview-instruct a img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }






@media only screen and (max-width: 1540px) {
    .productv-box {
        padding-bottom: 50px;
    }

    .gallery-max {
        width: 50px;
        height: 50px;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .info-collect > h1 {
        font-size: 32px;
    }

    .pattern-dot {
        width: 70px;
        height: 70px;
    }

.info-rating span {
    font-size: 18px;
}


    .productv-effect {
        padding-bottom: 90px;
    }

    .effect-tit {
        font-size: 38px;
    }

    .effect-img {
        padding-top: 30px;
    }
}


@media only screen and (max-width: 1440px) {

    .productv-box {
        padding-bottom: 45px;
    }

    .gallery-max {
        width: 45px;
        height: 45px;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .info-collect > h1 {
        font-size: 28px;
    }
    
    .info-rating span {
    font-size: 16px;
}

    .pattern-dot {
        width: 60px;
        height: 60px;
    }

    .info-collect {
        margin-bottom: 10px;
    }

        .info-collect > img {
            width: 18px;
            height: 18px;
            margin: 15px 0;
        }

    .info-rating {
        margin-bottom: 8px;
        font-size: 13px;
    }

    .info-price {
        font-size: 18px;
        margin-bottom: 16px;
        padding-bottom: 16px;
    }

    .selector-label {
        font-size: 13px;
        margin-bottom: 8px;
    }

    .variant-selector {
        margin-bottom: 10px;
    }

    .quantity-selector {
        margin-bottom: 15px;
    }

    .productv-effect {
        padding-bottom: 80px;
    }

    .effect-tit {
        font-size: 36px;
    }

    .effect-img {
        padding-top: 25px;
    }
}


@media only screen and (max-width: 1340px) {
    .productv-box {
        padding-bottom: 40px;
    }

    .info-collect > h1 {
        font-size: 26px;
    }


    .productv-effect {
        padding-bottom: 70px;
    }

    .effect-tit {
        font-size: 32px;
    }

    .effect-img {
        padding-top: 20px;
    }
}



@media only screen and (max-width: 769px) {
    .productv-box {
        gap: 10px;
        flex-direction: column;
        padding: 0 .1rem .4rem;
    }

    .gallery-img {
        width: 100%;
    }

    .productv-info {
        width: 100%;
    }

    .info-collect > h1 {
        font-size: 20px;
    }

    .shipping-policy {
        padding: 10px 12px;
        font-size: 13px;
        margin-bottom: 12px;
    }

    .productv-effect {
        padding: 0 .1rem .6rem;
    }

    .effect-tit {
        font-size: 26px;
    }

    .effect-img {
        padding-top: .2rem;
    }
}
/* ===== 样品请求弹出框 ===== */
.sample-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.show-form {
    display: flex !important;
}
.sample-popup-mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.sample-popup-box {
    position: relative;
    width: 520px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 60px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: samplePopupIn 0.25s ease-out;
}
@keyframes samplePopupIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.sample-popup-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e5e5e5;
    flex-shrink: 0;
}
.sample-popup-head h3 {
    font-size: 20px;
    font-weight: 500;
    color: #333;
    margin: 0;
}
.sample-popup-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 18px;
    transition: all 0.2s ease-in-out;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}
.sample-popup-close:hover {
    background: #e5e5e5;
    color: #333;
}
.sample-popup-close:focus-visible {
    outline: 2px solid #00a8e8;
    outline-offset: 2px;
}
.sample-popup-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1 1 auto;
}
.sample-form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}
.sample-form-row:last-child {
    margin-bottom: 0;
}
.sample-form-grp {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.sample-form-grp label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}
.sample-form-grp label .required {
    color: #e63946;
    margin-left: 2px;
}
.sample-form-grp input[type="text"],
.sample-form-grp input[type="email"],
.sample-form-grp input[type="tel"],
.sample-form-grp input[type="number"],
.sample-form-grp select,
.sample-form-grp textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    background: #fff;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    box-sizing: border-box;
    font-family: inherit;
}
.sample-form-grp input:focus,
.sample-form-grp select:focus,
.sample-form-grp textarea:focus {
    border-color: #00a8e8;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 168, 232, 0.15);
}
.sample-form-grp input::placeholder,
.sample-form-grp textarea::placeholder {
    color: #999;
}
.sample-form-grp textarea {
    resize: vertical;
    min-height: 80px;
}
.sample-form-grp .field-hint {
    font-size: 12px;
    color: #999;
    line-height: 1.4;
}
.sample-popup-foot {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px 20px;
    border-top: 1px solid #e5e5e5;
    flex-shrink: 0;
}
.sample-popup-foot .btn {
    min-width: 100px;
    text-align: center;
}
.sample-popup-foot .btn:focus-visible {
    outline: 2px solid #00a8e8;
    outline-offset: 2px;
}
/* 表单校验错误 */
.sample-form-grp .field-error {
    font-size: 12px;
    color: #e63946;
    line-height: 1.4;
    display: none;
}
.sample-form-grp.has-error input,
.sample-form-grp.has-error select,
.sample-form-grp.has-error textarea {
    border-color: #e63946;
}
.sample-form-grp.has-error .field-error {
    display: block;
}

@media only screen and (max-width: 769px) {
    .sample-popup-box {
        width: 100%;
        max-width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
        border-radius: 10px;
    }
    .sample-popup-head {
        padding: 14px 16px 12px;
    }
    .sample-popup-head h3 {
        font-size: 18px;
    }
    .sample-popup-body {
        padding: 14px 16px;
    }
    .sample-form-row {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 12px;
    }
    .sample-popup-foot {
        padding: 12px 16px 16px;
        flex-direction: column;
    }
    .sample-popup-foot .btn {
        width: 100%;
    }
}