/* Product Detail Page Styles */
/* 产品详情页面样式 */

:root {
    --primary-color: #111111;
    --secondary-color: #333333;
    --accent-color: #111111;
    --success-color: #111111;
    --warning-color: #888888;
    --danger-color: #111111;
    --dark-color: #111111;
    --light-color: #E5E5E5;
}

html,
body {
    max-width: 100%;
    overflow-x: clip;
}

/* Rebel-style PDP columns: laptop 2:1, desktop ~2.4:1 */
@media (min-width: 992px) {
    .product-detail-layout {
        display: grid;
        grid-template-columns: 2fr 1fr;
        column-gap: 1rem;
        align-items: start;
        margin-left: 0;
        margin-right: 0;
        --bs-gutter-x: 0;
    }
    .product-detail-layout > .product-detail-media,
    .product-detail-layout > .product-detail-buybox {
        width: 100%;
        max-width: 100%;
        flex: none;
        padding-left: 0;
        padding-right: 0;
    }
}

.custom-upload-buybox { border:1px solid #d8d5cf; background:#f7f5f0; padding:24px; margin-top:22px; }
.custom-upload-buybox__price { display:flex; justify-content:space-between; align-items:baseline; gap:16px; padding-bottom:18px; border-bottom:1px solid #d8d5cf; font-size:.82rem; text-transform:uppercase; letter-spacing:.08em; }
.custom-upload-buybox__price strong { font-size:1.25rem; letter-spacing:0; text-transform:none; color:#111; }
.custom-upload-buybox__intro { padding:22px 0 14px; }
.custom-upload-buybox__eyebrow,.custom-product-story__header>span,.custom-product-story__kicker { display:block; font-size:.72rem; font-weight:700; letter-spacing:.16em; margin-bottom:8px; }
.custom-upload-buybox__intro h2 { font-size:1.6rem; margin:0 0 10px; }
.custom-upload-buybox__intro p { color:#57534e; line-height:1.6; margin:0; }
.custom-upload-buybox__steps { list-style:none; padding:0; margin:6px 0 20px; }
.custom-upload-buybox__steps li { display:flex; gap:12px; align-items:center; padding:13px 0; border-top:1px solid #dedbd4; }
.custom-upload-buybox__steps li>span { display:grid; place-items:center; width:30px; height:30px; flex:0 0 30px; border-radius:50%; background:#111; color:#fff; font-size:.75rem; }
.custom-upload-buybox__steps strong,.custom-upload-buybox__steps small { display:block; }
.custom-upload-buybox__steps small { color:#6b6862; margin-top:2px; }
.custom-upload-buybox__cta { display:flex; justify-content:center; align-items:center; gap:12px; min-height:54px; background:#111; color:#fff!important; font-weight:700; letter-spacing:.08em; text-decoration:none!important; }
.custom-upload-buybox__cta:hover { background:#333; }
.custom-upload-buybox__review { margin:14px 0 0; font-size:.8rem; color:#4f4b45; text-align:center; }

/* Wall-size unit switcher: the currently selected unit is always black. */
.walltool-unit-toggle {
    display: inline-flex;
    gap: 5px;
}
.walltool-unit-toggle__btn {
    min-width: 40px;
    min-height: 32px;
    padding: 4px 9px;
    border: 1px solid #111;
    background: #fff;
    color: #111;
    line-height: 1;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.walltool-unit-toggle__btn:hover {
    background: #efefef;
}
.walltool-unit-toggle__btn.active,
.walltool-unit-toggle__btn[aria-pressed="true"] {
    background: #111;
    border-color: #111;
    color: #fff;
}
.walltool-unit-toggle__btn.active:hover,
.walltool-unit-toggle__btn[aria-pressed="true"]:hover {
    background: #111;
    color: #fff;
}
.walltool-unit-toggle__btn:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
}
.custom-product-story { max-width:1180px; margin:0 auto; padding:24px 0 8px; }
.custom-product-story__header { max-width:720px; margin:0 auto 28px; text-align:center; }
.custom-product-story__header h2 { font-size:clamp(1.8rem,3vw,3rem); margin:0 0 10px; }
.custom-product-story__header p { color:#68645e; font-size:1.05rem; }
.custom-product-story__hero { display:block; width:100%; height:auto; margin:0 0 36px; border-radius:0; box-shadow:none; }
.custom-process-grid { list-style:none; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:1px; padding:0; margin:0 0 52px; background:#d8d5cf; border:1px solid #d8d5cf; }
.custom-process-grid li { background:#fff; padding:28px; min-height:220px; }
.custom-process-grid span { font-size:.75rem; font-weight:700; letter-spacing:.14em; color:#8b3f2f; }
.custom-process-grid h3 { font-size:1.12rem; margin:18px 0 10px; }
.custom-process-grid p { color:#625e58; line-height:1.65; margin:0; }
.custom-product-story__split { display:grid; grid-template-columns:1.15fr .85fr; gap:48px; align-items:center; margin-bottom:52px; }
.custom-product-story__split img { width:100%; height:auto; margin:0; border-radius:0; box-shadow:none; }
.custom-product-story__split h2 { font-size:clamp(1.6rem,2.6vw,2.4rem); margin:0 0 18px; }
.custom-product-story__split ul { padding-left:20px; line-height:1.8; color:#4f4b45; }
.custom-product-story__cta { display:flex; justify-content:space-between; align-items:center; gap:28px; padding:34px 38px; background:#222621; color:#fff; }
.custom-product-story__cta span { font-size:.7rem; letter-spacing:.15em; }
.custom-product-story__cta h2 { margin:5px 0 0; font-size:1.65rem; }
.custom-product-story__cta a { flex:0 0 auto; padding:16px 22px; background:#fff; color:#111!important; font-weight:700; text-decoration:none!important; }
@media (max-width:767.98px) {
    .custom-upload-buybox { padding:18px; }
    .custom-process-grid { grid-template-columns:1fr; }
    .custom-process-grid li { min-height:0; }
    .custom-product-story__split { grid-template-columns:1fr; gap:24px; }
    .custom-product-story__cta { align-items:flex-start; flex-direction:column; padding:26px; }
}
@media (min-width: 1536px) {
    .product-detail-layout {
        grid-template-columns: 2.4fr 1fr;
    }
}

/* Product Description Content Styles */
.product-description-content {
    line-height: 1.8;
    color: #333;
}

.product-description-content p {
    margin-bottom: 1rem;
}

.product-description-content picture {
    display: block;
    margin: 1rem 0;
}

.product-description-content picture img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
}

.product-description-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
}

.product-description-content a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-description-content a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.product-description-content font {
    color: inherit;
}

/* 产品详情页面容器背景 - 与首页分类展示区域颜色一致 */
.container.my-5 {
    background-color: #ffffff !important;
    padding: 10px 20px;
    border-radius: 8px;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
}

.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.nav-link {
    color: white !important;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--accent-color) !important;
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(54, 156, 168, 0.4);
}

.product-image {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.product-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-image:hover img {
    transform: scale(1.05);
}

.price {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.compare-price {
    font-size: 1.2rem;
    color: #999;
    text-decoration: line-through;
}

.rating {
    color: var(--warning-color);
}

.product-info {
    background: #fff;
    border-radius: 15px;
    padding: 30px;
}

/* 产品标题 - 语义清晰，避免使用 .h2 造成混淆 */
.product-title {
    font-size: 1.75rem;
    font-weight: 500;
    line-height: 1.2;
}

.product-model {
    margin-bottom: 1rem;
}

.model-text {
    color: #666;
    font-size: 0.95rem;
    font-weight: 500;
}

.model-text i {
    color: #6c757d;
}

/* Enhanced Breadcrumb Styles */
.breadcrumb {
    background: transparent;
    padding: 0.3rem 0 0.75rem;
    margin-bottom: 0.3rem;
    font-size: 0.875rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.breadcrumb-item a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #6c757d;
    font-weight: 500;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    color: #adb5bd;
    padding: 0 0.75rem;
    font-weight: normal;
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.feature-list li:last-child {
    border-bottom: none;
}

.feature-list i {
    color: var(--success-color);
    margin-right: 10px;
}

.quantity-input {
    width: 80px;
    text-align: center;
}

/* Tab Styles */
.nav-tabs {
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 0;
    background: #ffffff;
    border-radius: 10px 10px 0 0;
}

.nav-tabs .nav-link {
    color: #000000 !important;
    background: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    border-bottom: 3px solid transparent !important;
    padding: 12px 20px !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-color) !important;
    border-bottom-color: var(--primary-color) !important;
    background: #ffffff !important;
    text-decoration: none !important;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color) !important;
    background: #ffffff !important;
    border-bottom-color: var(--primary-color) !important;
    font-weight: 600 !important;
    text-decoration: none !important;
}

.tab-content {
    background: #fff;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 10px 10px;
    min-height: 200px;
}

.tab-pane {
    padding: 0;
}

.tab-pane .p-4 {
    padding: 2rem !important;
}

/* Specifications: common wallpaper material comparison */
.product-material-guide {
    border-top: 1px solid #e2e2e2;
    padding-top: 2rem;
}

.product-material-guide__viewport {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    border: 1px solid #dedede;
    background: #f7f5f0;
}

.product-material-guide__image {
    display: block;
    width: 100%;
    height: auto;
}

/* Buy box: image-led wallpaper material selector */
.buybox-material-picker {
    margin: 1.25rem 0;
    padding-top: 1.1rem;
    border-top: 1px solid #e3e3e3;
}

.buybox-material-picker__head {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin-bottom: .75rem;
}

.buybox-material-picker__head h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: .01em;
}

.rw-wallsize__step-head {
    margin-bottom: 1rem;
}

.buybox-material-picker__step {
    display: inline-flex;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #111;
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1;
}

.buybox-material-picker__info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: #111;
    font-size: 1rem;
}

.buybox-material-picker__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.buybox-material-card {
    display: flex;
    min-width: 0;
    min-height: 128px;
    flex-direction: column;
    padding: 4px 4px 8px;
    border: 1px solid #d8d8d8;
    background: #fff;
    color: #333;
    cursor: pointer;
    text-align: center;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.buybox-material-card:hover { border-color: #777; }

.buybox-material-card.is-selected,
.buybox-material-card:has(.buybox-material-card__input:checked) {
    border-color: #111;
    box-shadow: inset 0 0 0 1px #111;
}

.buybox-material-card:focus-within {
    outline: 2px solid #111;
    outline-offset: 2px;
}

.buybox-material-card.is-disabled {
    cursor: not-allowed;
    opacity: .48;
}

.buybox-material-card__media {
    display: block;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 1 / 1;
    margin-bottom: 7px;
    background: #f1f1ef;
}

.buybox-material-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.buybox-material-card__name {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    font-size: .72rem;
    font-weight: 500;
    line-height: 1.25;
}

.buybox-material-card__stock {
    margin-top: 3px;
    font-size: .62rem;
    color: #777;
}

.material-help__intro {
    margin: 0 0 1rem;
    color: #666;
}

.material-help__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
}

.material-help__card {
    overflow: hidden;
    border: 1px solid #ddd;
    background: #fff;
}

.material-help__card > img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #f1f1ef;
}

.material-help__body {
    padding: .85rem;
}

.material-help__body h6 {
    margin: 0 0 .35rem;
    font-size: .95rem;
    font-weight: 700;
}

.material-help__body p {
    min-height: 2.6em;
    margin: 0 0 .55rem;
    color: #555;
    font-size: .78rem;
    line-height: 1.3;
}

.material-help__body ul {
    margin: 0;
    padding-left: 1rem;
    font-size: .75rem;
    line-height: 1.45;
}

.material-help__note {
    margin: 1rem 0 0;
    color: #777;
    font-size: .75rem;
}

@media (max-width: 767.98px) {
    .material-help__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 420px) {
    .buybox-material-picker__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
    .product-material-guide__image {
        width: 980px;
        max-width: none;
    }
}

/* Review System Styles */
.rating-input .stars {
    font-size: 1.5rem;
    color: #ddd;
    cursor: pointer;
}

.rating-input .stars i {
    transition: color 0.2s ease;
}

.rating-input .stars i:hover,
.rating-input .stars i.active {
    color: #111111;
}

.rating-text {
    font-size: 0.9rem;
    color: #666;
}

.review-item {
    border-bottom: 1px solid #eee;
    padding: 1rem 0;
}

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

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.review-author {
    font-weight: 600;
    color: #333;
}

.review-date {
    font-size: 0.85rem;
    color: #666;
}

.review-rating {
    color: #111111;
    margin-bottom: 0.5rem;
}

.review-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.review-content {
    color: #666;
    line-height: 1.5;
}

.rating-distribution {
    font-size: 0.9rem;
}

.rating-bar {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.rating-label {
    width: 30px;
    text-align: left;
    margin-right: 0.75rem;
    font-weight: 500;
    color: #333;
}

.rating-progress {
    flex: 1;
    height: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin-right: 0.75rem;
    position: relative;
}

.rating-fill {
    height: 100%;
    background: #111111;
    transition: width 0.5s ease;
    border-radius: 5px;
}

.rating-count {
    width: 40px;
    text-align: right;
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

/* Review Images Styles */
.review-images {
    margin-top: 0.75rem;
}

.review-image-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid #ddd;
    transition: all 0.3s ease;
}

.review-image-thumbnail:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Review Item Enhanced Styles */
.review-item {
    border-bottom: 1px solid #e9ecef;
    padding: 1.5rem 0;
    margin-bottom: 0;
}

.review-item:first-child {
    padding-top: 0;
}

.review-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.review-item + .review-item {
    margin-top: 0;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.review-author {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.review-date {
    font-size: 0.85rem;
    color: #666;
}

.review-rating {
    color: #111111;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.review-rating i {
    margin-right: 2px;
}

.review-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
    font-size: 1.1rem;
}

.review-content {
    color: #666;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-bottom: 0.5rem;
}

/* Review Summary Enhanced */
#reviewSummary {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

#averageRating {
    font-size: 3rem;
    font-weight: bold;
    line-height: 1;
    margin-bottom: 0.5rem;
}

#ratingStars {
    margin-bottom: 0.5rem;
}

#ratingStars i {
    font-size: 1.5rem;
    margin-right: 2px;
}

#totalReviews {
    font-size: 0.9rem;
    color: #666;
}

/* Rating Distribution Enhanced */
.rating-distribution {
    font-size: 0.9rem;
    padding-top: 0.5rem;
}

.rating-bar {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
}

.rating-bar:last-child {
    margin-bottom: 0;
}

.rating-label {
    width: 30px;
    text-align: left;
    margin-right: 0.75rem;
    font-weight: 500;
    color: #333;
}

.rating-progress {
    flex: 1;
    height: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin-right: 0.75rem;
    position: relative;
}

.rating-fill {
    height: 100%;
    background: #111111;
    transition: width 0.5s ease;
    border-radius: 5px;
}

.rating-count {
    width: 40px;
    text-align: right;
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

/* Review Modal Styles */
#reviewModal .modal-body {
    padding: 2rem;
}

#reviewModal .form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

#reviewModal .form-control {
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 0.75rem;
    transition: all 0.3s ease;
}

#reviewModal .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(54, 156, 168, 0.25);
}

#reviewModal textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* 商品图 / 评论图 / 写评论 / 量墙指南：弹窗需高于导航栏(z-index 10003+)。模态节点由 JS 挂到 body，避免 main.content-wrapper 的层叠上下文压住弹窗 */
#imageModal.modal,
#reviewImageModal.modal,
#reviewModal.modal,
#applicationImageModal.modal,
#walltoolMeasureHelpModal.modal,
#walltoolMaterialHelpModal.modal {
    z-index: 10050 !important;
}

/* 商品详情页：若某模态启用 backdrop，遮罩需高于导航(≈10003)、低于模态本体(10050) */
body[data-product-id].modal-open .modal-backdrop {
    z-index: 10040 !important;
}

/* 商品图弹窗：主图可点击关闭（见 product_detail_new.js handleBlankAreaClose） */
#imageModal #modalMainImage {
    cursor: pointer;
}

/* Review Image Modal */
#reviewImageModal .modal-body {
    padding: 1rem;
    text-align: center;
}

#reviewImageModal .modal-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* No Reviews Message */
#noReviewsMessage {
    text-align: center;
    padding: 3rem 1rem;
}

#noReviewsMessage i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 1rem;
}

#noReviewsMessage h5 {
    color: #666;
    margin-bottom: 0.5rem;
}

#noReviewsMessage p {
    color: #999;
    margin-bottom: 1.5rem;
}

/* Load More Button */
#loadMoreContainer {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

#loadMoreBtn {
    border-radius: 25px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

#loadMoreBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Product Images — stacked gallery; each image keeps its native aspect ratio */
.product-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
}

.product-gallery-grid.custom-upload-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.custom-upload-gallery .product-gallery-item--custom-thumb {
    grid-column: auto;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}
.custom-upload-gallery .product-gallery-item--custom-thumb picture,
.custom-upload-gallery .product-gallery-item--custom-thumb img {
    width: 100%;
    height: 100%;
}
.custom-upload-gallery .product-gallery-item--custom-thumb img {
    object-fit: cover;
}
@media (max-width: 575.98px) {
    .product-gallery-grid.custom-upload-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .custom-upload-gallery .product-gallery-item--custom-thumb:last-child { grid-column: 1 / -1; }
}

.product-gallery-item {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: transparent;
    position: relative;
    height: auto;
}

.product-gallery-item--full,
.product-gallery-item--natural {
    grid-column: 1 / -1;
    width: 100%;
    height: auto;
    aspect-ratio: var(--img-ratio, auto);
    max-height: none;
}

/* Portrait: half column, centered — same as Rebel col-span-2 col-start-2 */
.product-gallery-item--natural.product-gallery-item--portrait {
    grid-column: 2 / span 2;
    width: 100%;
    justify-self: stretch;
}

.product-gallery-item--half {
    grid-column: 2 / span 2;
    width: 100%;
    aspect-ratio: var(--img-ratio, auto);
    max-height: none;
}

.product-gallery-item picture {
    display: block;
    width: 100%;
    height: auto;
    line-height: 0;
}

.product-gallery-img,
.product-gallery-img--native,
.product-gallery-img--contain {
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    border-radius: 0 !important;
    box-shadow: none !important;
    cursor: pointer;
}

/* Pair row: 2nd+3rd same size/ratio → side by side; height from native ratio */
.product-gallery-pair-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
    align-items: start;
    background: transparent;
}

.product-gallery-pair-row .product-gallery-item--pair {
    grid-column: auto;
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: var(--pair-img-ratio, var(--img-ratio, auto));
    max-height: none;
    display: block;
    background: transparent;
}

.product-gallery-pair-row .product-gallery-item--pair picture {
    display: block;
    width: 100%;
    height: auto;
}

.product-gallery-pair-row .product-gallery-img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Hide rows beyond the first 3 until LOAD MORE */
.product-gallery-item--more {
    display: none;
}

.product-images.is-gallery-expanded .product-gallery-item--more {
    display: block;
}

.product-gallery-load-more {
    display: block;
    width: 100%;
    margin: 24px 0 8px;
    padding: 14px 20px;
    box-sizing: border-box;
    background: #ffffff;
    border: 1px solid #000000;
    border-radius: 0;
    color: #000000;
    font-family: var(--font-ui, 'Open Sans', system-ui, sans-serif);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-align: center;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.product-gallery-load-more:hover,
.product-gallery-load-more:focus {
    background: #000000;
    color: #ffffff;
    outline: none;
}

@media (max-width: 991.98px) {
    .product-gallery-item--half,
    .product-gallery-item--full,
    .product-gallery-item--natural {
        grid-column: 1 / -1;
        aspect-ratio: var(--img-ratio, auto);
        max-height: none;
    }

    /* Keep portrait half-width on tablet+; full width only on small phones handled below */
    .product-gallery-item--natural.product-gallery-item--portrait {
        grid-column: 2 / span 2;
    }
}

@media (max-width: 575.98px) {
    .product-gallery-item--natural.product-gallery-item--portrait {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .product-gallery-item--full,
    .product-gallery-item--natural,
    .product-gallery-item--pair,
    .product-gallery-item--half {
        aspect-ratio: var(--img-ratio, auto);
        max-height: none;
    }
}

/* Legacy thumbnail / square main (kept for other pages if any) */
.thumbnail-image {
    transition: all 0.3s ease;
}

.thumbnail-image:hover {
    transform: scale(1.05);
    border-color: var(--primary-color) !important;
}

.thumbnail-image.active {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px rgba(54, 156, 168, 0.2);
}

.main-image-container {
    position: relative;
    width: 100%;
}

.main-image-container::before {
    content: '';
    display: block;
    padding-bottom: 75%; /* landscape fallback if legacy markup remains */
}

.main-image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    transition: transform 0.3s ease;
}

.main-image-container img:hover {
    transform: none;
}

/* Image Modal Navigation Styles */
.image-viewer-container {
    position: relative;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.image-nav-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transform: translateY(-50%) scale(1.1);
}

.image-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.image-nav-prev {
    left: 10px;
}

.image-nav-next {
    right: 10px;
}

.image-counter {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 10;
}

.modal-thumbnail {
    transition: all 0.2s ease;
}

.modal-thumbnail:hover {
    transform: scale(1.05);
    border-color: var(--primary-color) !important;
}

.modal-thumbnail.active {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px rgba(54, 156, 168, 0.2);
}

/* Product Options Validation Styles */
.product-option-select.is-invalid {
    border-color: var(--danger-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(225, 112, 85, 0.25) !important;
}

.product-option-select.is-invalid:focus {
    border-color: var(--danger-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(225, 112, 85, 0.5) !important;
}

#product-options-section .form-label .text-danger {
    font-weight: 600;
}

/* Mobile Optimization Styles */
@media (max-width: 768px) {
    .product-info {
        padding: 20px !important;
    }
    
    .thumbnail-container .col-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }
    
    .thumbnail-image {
        height: 60px !important;
    }
    
    /* Optimize font sizes for mobile */
    .price {
        font-size: 1.5rem !important;
    }
    
    .product-title {
        font-size: 1.5rem !important;
    }
    
    /* Reduce padding on mobile */
    .tab-pane .p-4 {
        padding: 1rem !important;
    }
}

/* Image Loading Optimization — 默认略可见；.product-card-media 内由 global.css 保持不透明 */
img[loading="lazy"] {
    opacity: 0.92;
    transition: opacity 0.25s ease;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

.product-card .product-card-media img[loading="lazy"],
.product-card .product-card-media img[loading="eager"] {
    opacity: 1;
}

/* Related products (You May Also Like) - square images when no media wrapper */
.product-card .card-img-top {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

.product-card .product-card-media .card-img-top {
    aspect-ratio: unset;
}

/* Product gallery: solid placeholder (no checkerboard); .img-ready clears bg after paint */
.product-images img {
    background-color: #eef1ea;
    background-image: none;
    opacity: 1;
}

.product-images img.img-ready {
    background-color: transparent;
}

/* Other listing cards — simple solid placeholder */
.product-card:not(:has(.product-card-media)) img {
    background-color: #f8f9fa;
    background-image: none;
}

/* Touch-friendly buttons on mobile */
@media (max-width: 768px) {
    .btn {
        min-height: 44px;
        padding: 10px 20px;
    }
    
    .wishlist-btn {
        width: 44px !important;
        height: 44px !important;
    }
}

/* Optimize animations for mobile */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Inspiration — in-use / lifestyle gallery */
.product-inspiration-panel {
    position: relative;
    background: #FAFAFA;
    border: 1px solid rgba(54, 156, 168, 0.18);
    border-radius: 16px;
    padding: clamp(1.25rem, 4vw, 2rem);
    box-shadow: 0 6px 32px rgba(45, 52, 54, 0.07);
    overflow: hidden;
}

.product-inspiration-panel::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: min(180px, 45%);
    height: min(180px, 40%);
    background: radial-gradient(circle at 100% 0%, rgba(54, 156, 168, 0.12) 0%, transparent 72%);
    pointer-events: none;
}

.product-inspiration-panel__header {
    position: relative;
    z-index: 1;
    margin-bottom: 1.25rem;
}

@media (min-width: 768px) {
    .product-inspiration-panel__header {
        margin-bottom: 1.5rem;
    }
}

.product-inspiration-panel__title-row {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.product-inspiration-panel__icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    font-size: 1.2rem;
    line-height: 1;
    box-shadow: 0 4px 14px rgba(54, 156, 168, 0.35);
}

.product-inspiration-panel__icon--sm {
    width: 1.85rem;
    height: 1.85rem;
    font-size: 0.95rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(54, 156, 168, 0.3);
}

.product-inspiration-panel__titles {
    min-width: 0;
}

.product-inspiration-panel__title {
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--dark-color);
    margin-bottom: 0.35rem;
}

.product-inspiration-panel__lead {
    font-size: 0.9rem;
    line-height: 1.55;
    max-width: 40rem;
}

.product-inspiration-panel__grid {
    position: relative;
    z-index: 1;
}

.application-image-tile {
    border-radius: 12px !important;
    box-shadow: 0 2px 14px rgba(45, 52, 54, 0.09);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.application-image-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 36px rgba(54, 156, 168, 0.22);
}

.application-image-tile:focus-visible {
    outline: 3px solid rgba(54, 156, 168, 0.55);
    outline-offset: 3px;
}

.application-image-tile__ratio {
    border-radius: 12px;
    overflow: hidden;
}

.application-image-tile__ratio picture,
.application-image-tile__ratio img {
    display: block;
    width: 100%;
    height: 100%;
}

.application-image-tile__ratio img {
    transition: transform 0.4s ease;
}

.application-image-tile:hover .application-image-tile__ratio img {
    transform: scale(1.05);
}

.application-image-zoom-badge {
    font-size: 0.75rem;
    background: rgba(45, 52, 54, 0.55) !important;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0.92;
    transition: opacity 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.application-image-tile:hover .application-image-zoom-badge {
    opacity: 1;
    background: #111111 !important;
}










