/* Official Image Configuration v1.0 - Frontend Styles */

.official-image-config-wrapper {
    margin: 0 auto;
    padding: 0 0 20px 0;
}

.oic-main-content {
    display: flex;
    gap: 60px;
    position: relative;
}

/* 左侧：图片区域整体固定 */
.oic-left-panel {
    flex: 0 0 auto;
    display: flex;
    gap: 15px;
    position: sticky;
    top: calc(70px + var(--wp-adminbar-height, 0px));
    height: calc(100vh - 70px - var(--wp-adminbar-height, 0px));
}

/* 左侧：变体主图列表 */
.oic-variation-gallery {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 120px;
    flex-shrink: 0;
    overflow-y: auto;
    max-height: 100%;
}

.oic-variation-gallery::-webkit-scrollbar {
    width: 4px;
}

.oic-variation-gallery::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.oic-variation-thumb {
    width: 120px;
    height: 120px;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.oic-variation-thumb-item{
    flex-direction: column;
    display: flex;
}
.oic-variation-thumb-name {
    text-align: center;
    font-size: 12px;
    margin-top: 5px;
}
.oic-variation-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.oic-variation-thumb:hover,
.oic-variation-thumb.is-active {
    border-color: #3D2F26;
    
}

/* 中间：大图 */
.oic-main-image-container {
    width: 550px;
    height: 100%;
    overflow: hidden;
    background: #f5f5f5;
    position: relative;
    flex-shrink: 0;
    border-radius: 10px;
}

.oic-main-image-container img {
    width: 100%;
    height: 100% !important;
    object-fit: cover;
}

.oic-main-image-container a {
    display: block;
    width: 100%;
    height: 100%;
}

/* 放大图标 */
.oic-zoom-icon {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    pointer-events: none;
}

.oic-zoom-icon svg {
    width: 20px;
    height: 20px;
    color: #8B4513;
}

.oic-main-image-container:hover .oic-zoom-icon {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

/* 右侧：图册列表 */
.oic-gallery-panel {
    width: 100px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-height: 100%;
    position: relative;
}

.oic-gallery-nav {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 0px solid rgba(139, 69, 19, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8B4513;
    margin-bottom: 10px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: absolute;
    z-index: 1;
}
.oic-gallery-panel .oic-gallery-nav {
    border: 0px;
    padding: 5px;
}
.oic-gallery-panel .oic-gallery-nav:focus {
    background: #fff;
    color: #000;
}
.oic-gallery-panel .oic-gallery-nav:hover {
    background: #fff;
    color: #000;
}
.oic-gallery-panel .oic-gallery-down{
    bottom: 15px;
}
.oic-gallery-panel .oic-gallery-up{
    top: 15px;
}
.oic-gallery-nav:hover:not(:disabled) {
    /* background: rgba(139, 69, 19, 0.2); */
    border-color: #8B4513;
    /* transform: scale(1.1); */
}

.oic-gallery-nav:last-child {
    margin-bottom: 0;
    margin-top: 10px;
}

.oic-gallery-nav svg {
    width: 36px;
    height: 36px;
}

.oic-gallery-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.oic-gallery-list {
    display: flex;
    grid-template-rows: repeat(5, 1fr);
    gap: 8px;
    overflow: hidden;
    flex: 1;
    min-height: 0;
    position: relative;
    flex-direction: column;
}

.oic-gallery-thumb {
    width: 100%;
    flex: 1;
    min-height: 0;
    cursor: pointer;
    border: 2px solid #F7F4EF;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.oic-gallery-thumb img {
    width: 100%;
    height: 100% !important;
    object-fit: cover;
}

.oic-gallery-thumb:hover,
.oic-gallery-thumb.is-active {
    border-color: #3D2F26;
    /* transform: scale(1.02); */
}

.oic-hidden {
    display: none;
}

/* 右侧：配置内容 */
.oic-right-panel {
    flex: 1;
    min-width: 400px;
    position: relative;
}

.oic-right-panel-scroll {
    overflow-y: auto;
    /* padding-right: 10px; */
}

.oic-right-panel-scroll::-webkit-scrollbar {
    width: 6px;
}

.oic-right-panel-scroll::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.oic-product-title {
    font-size: 32px;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px 0;
}
.separator {
    margin: 20px 0;
    border-bottom: 1px solid #636363;
}
.oic-product-short-description {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
    font-weight: normal;
}

.oic-product-description {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 30px;
}

/* 配置面板 */
.oic-config-panels {
    margin-bottom: 30px;
}

.oic-config-panel {
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
}

/* Extra Product Options集成样式 */
.oic-extra-product-options-wrapper {
    /* 直接使用Add to Cart组件的样式 */
}

/* 隐藏原生的variations表格，但保留功能 */
.oic-extra-product-options-wrapper table.variations {
    display: none !important;
}

/* 确保价格和购物车按钮始终可见 */
.oic-extra-product-options-wrapper .single_variation_wrap {
    display: block !important;
}

.oic-extra-product-options-wrapper .woocommerce-variation-price {
    margin-bottom: 15px;
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.oic-extra-product-options-wrapper .woocommerce-variation-add-to-cart {
    display: flex;
    align-items: center;
    gap: 15px;
}

.oic-extra-product-options-wrapper button.single_add_to_cart_button {
    width: 100%;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
}

/* Extra Product Options section展开/收起样式 */
.oic-extra-product-options-wrapper .thwepo-section {
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.oic-extra-product-options-wrapper .quantity {
    display: none !important;
}

/* 确保 Extra Product Options 的字段区域默认收起 */
.oic-extra-product-options-wrapper .thwepo-field-wrapper {
    display: none;
}

.oic-extra-product-options-wrapper .thwepo-field-wrapper.open {
    display: block;
}

.oic-extra-product-options-wrapper .thwepo-section-header {
    background-color: #f5f5f5;
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 16px;
}

.oic-extra-product-options-wrapper .thwepo-section-header:hover {
    background-color: #e8e8e8;
}

.oic-extra-product-options-wrapper .thwepo-section-toggle {
    font-size: 20px;
    font-weight: bold;
    color: #666;
    transition: transform 0.2s ease;
}

.oic-extra-product-options-wrapper .thwepo-section-content {
    padding: 15px;
}

.oic-extra-product-options-wrapper .thwepo-section-collapsed .thwepo-section-toggle {
    transform: rotate(-90deg);
}

.oic-config-panel[open] {
    border-color: #8B4513;
}

.oic-config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0;
    cursor: pointer;
    font-weight: 600;
}


.oic-config-title {
    font-size: 30px;
}
.thwepo_accordion_style .section-title{
    background: unset !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.thwepo_accordion_style .section-title h3{
    font-size: 30px !important;
    font-weight: 600 !important; 
}
.thwepo_accordion_style .thwepo-section-title.section-title:after{
    content: "+" !important;
    line-height: 25px !important;
    position: relative !important;
}
.thwepo_accordion_style .thwepo-section-title.section-title.active:after{
    content: "-" !important;
    line-height: 20px !important;
    position: unset !important;
}
.thwepo_accordion_style .thwepo-section-title.section-title.active:after,.thwepo_accordion_style .thwepo-section-title.section-title:after{  
    font-size: 25px !important;
    font-weight: 300;
    color: #3D2F26;
    transition: transform 0.2s ease;
    border: 1px solid;
    height: 25px !important;
    width: 25px !important;
    text-align: center;
    align-items: center;
    border-radius: 100px;
    
    right: 0 !important;
    background:unset !important;
    top:0 !important;
}
.oic-toggle-icon {
    font-size: 25px;
    font-weight: 300;
    color: #3D2F26;
    transition: transform 0.2s ease;
    border: 1px solid;
    height: 25px !important;
    width: 25px !important;
    text-align: center;
    align-items: center;
    border-radius: 100px;
    line-height: 25px;
}

.oic-config-content {
    padding: 20px;
}
.oic-config-item-display{
    font-weight: normal;
    font-size: 14px;
}
/* 变体列表 */
.oic-variation-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.oic-variation-item {
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}

.oic-variation-item:hover {
    border-color: #8B4513;
}

.oic-variation-item.is-selected {
    border-color: #8B4513;
}

.oic-variation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}


.oic-variation-header input[type="radio"] {
    margin-right: 12px;
    accent-color: #8B4513;
    height: 20px;
    width: 20px;
}

.oic-variation-name {
    flex: 1;
    font-weight: 500;
    color: #333;
}

.oic-variation-toggle {
    font-size: 20px;
    font-weight: 300;
    color: #3D2F26;
    transition: transform 0.2s ease;
    border: 1px solid;
    height: 25px;
    width: 25px;
    text-align: center;
    align-items: center;
    border-radius: 100px;
    line-height: 25px;
}

.oic-variation-content {
    padding: 15px;
    display: none;
}

.oic-variation-item.is-expanded .oic-variation-content {
    display: block;
}

.oic-variation-description {
    font-size: 14px;
    line-height: 1.8;
    color: #555;
}

.oic-variation-description ul {
    list-style: none;
    padding: 0;
    margin: 0;
    columns: 2;
}

.oic-variation-description li {
    padding: 5px 0;
    position: relative;
    padding-left: 15px;
}

.oic-variation-description li::before {
    content: '●';
    position: absolute;
    left: 0;
    color: #8B4513;
    font-size: 10px;
}

.oic-variation-no-desc {
    color: #999;
    font-style: italic;
}

.oic-extra-product-options {
    min-height: 100px;
    padding: 10px;
    background: #fafafa;
    border-radius: 4px;
}

/* 价格区域 */
.oic-price-container {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 20px;
}

.oic-price-label {
    font-size: 16px;
    color: #666;
}

.oic-price-value {
    font-size: 32px;
    font-weight: 700;
    color: #8B4513;
}

/* 添加购物车按钮 */
.oic-add-to-cart {
    width: 100%;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    background: #8B4513;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.oic-add-to-cart:hover:not(:disabled) {
    background: #a0522d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
}

.oic-add-to-cart:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* thwepo */
.single_variation_wrap{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}
.woocommerce-variation-price .price{
    font-size: 45px !important;
    font-weight: 600;
    color: #3D2F26 !important;
}
.thwepo-field{
    padding: 25px 0 !important;
    border-bottom: 1px solid #636363;
}
.thwepo-field:last-child{
    border: 0 !important;
}
.thwepo-field .label-tag {
    font-size: 24px;
    font-weight: 500;
}
.thwepo-field .required{
    display: none;
}
.thwepo-field.body_type{
    padding-bottom: 0 !important;
    border: 0 !important;
}
.thwepo-field .amount{
    font-size: 12px;
}
.thwepo-field .label br {
  display: none !important;
}
.oic-extra-product-options-wrapper .single_add_to_cart_button{
    background-color: #5D301D !important;
    border-radius: 100px !important;
    padding: 15px 40px !important;
}
.thwepo-option-below .thwepo-image-box{
    border-radius: 10px;
    width: 100% !important;
}
.thwepo-image-label{
    font-weight: 500;
}
.single-product .product .extra-options .value{
    display: grid  !important;
    padding: 0;
    list-style: none;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}
.body_type .value{
    grid-template-columns: repeat(4, 1fr) !important;
}

/* 单选框选中时，整个 LABEL 标签高亮 */
.thwepo-radio-input-field:has(input:checked) {
  border: 2px solid #7B3821 !important;
}
.thwepo-field-wrapper .body .value .radio{
    margin: 0 !important;
    padding: 10% 5px;
    border: 2px solid #ccc;
    border-radius: 10px;
    width: 100%;
    font-weight: 500;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    cursor: pointer;
    line-height: 1.4;
}
.thwepo-field-wrapper .extra_head .value{ 
    grid-template-columns: repeat(4, 1fr) !important;
}
.thwepo-field-wrapper .body .value .radio span:has(.amount){
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.thwepo-image-group-item{
    margin-right: 0 !important;
    margin-bottom: 0 !important;
}
/* 让价格自动换行 */
.thwepo-image-label .woocommerce-Price-amount {
  display: block;
}
.thwepo-popup-image{
    right: 2px;
    bottom: 2px !important;
    left: unset !important;
}
/* 价格前面加 + */
.thwepo-image-label .woocommerce-Price-currencySymbol::before {
  content: "+";
}
.thwepo-img-wrap{
    margin-bottom: 5px;
}
.thwepo-image-label{
    line-height: 1.4 !important;
}

.extra-options .value input[type=checkbox], .extra-options .value input[type=radio]{
    display: none;
}

/* 选项卡 */
.product-configuration-accordion .e-n-accordion-item-title{
    display: flex;
    justify-content: space-between !important;
    align-content: center;
}
.product-configuration-accordion .e-n-accordion-item-title .e-closed,.product-configuration-accordion .e-n-accordion-item-title .e-opened{
    background: #5D301D;
    color: #fff;
    border-radius: 100px;
    height: 30px;
    width: 30px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-configuration-accordion .e-n-accordion-item-title-text{
    display: flex;
    gap: 10px;
}
#configurationAccordion .e-n-accordion-item-title-text::after{
    content: "(T-RRS+)";
  font-size: 18px;  /* 甚至可以单独调整大小 */
  margin-left: 0px;  /* 和前文隔开一点点距离 */
}
#configurationAccordion .e-n-accordion-item:nth-last-child(2) .e-n-accordion-item-title-text::after{
    content: "(T-RRS)";
}
#configurationAccordion .e-n-accordion-item:last-child .e-n-accordion-item-title-text::after{
    content: "";
}
/* 响应式设计 */
@media (max-width: 1400px) {
    .oic-main-image-container {
        width: 400px;
    }
}

@media (max-width: 1200px) {
    .oic-main-content {
        flex-direction: column;
    }
    
    .oic-left-panel {
        flex: none;
        width: 100%;
        position: static;
        height: auto;
        flex-direction: column;
    }
    
    .oic-variation-gallery {
        flex-direction: row;
        width: 100%;
        overflow-x: auto;
        max-height: none;
    }
    
    .oic-main-image-container {
        width: 100%;
        height: 60vh;
    }
    
    .oic-gallery-panel {
        flex-direction: row;
        width: 100%;
        overflow-x: auto;
        max-height: none;
    }
    
    .oic-gallery-list {
        flex-direction: row;
    }
    .oic-gallery-list {
        grid-template-columns: repeat(5, 1fr);
        grid-template-rows: unset;
    }
    .oic-right-panel {
        min-width: 100%;
    }
    
    .oic-right-panel-scroll {
        overflow-y: visible;
        padding-right: 0;
    }
    .product-configuration-list ul{
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .oic-main-image-container{
        height: 150vh;
    }
    .oic-gallery-nav{
        height: 35px;
        width: 35px;
        margin:0;
    }
    .oic-gallery-nav:last-child{
        margin: 0;
    }
    .oic-gallery-panel .oic-gallery-up{
        top: unset;
        transform: rotate(-90deg);
        left: 10px;
    }
    .oic-gallery-panel .oic-gallery-down{
        bottom: unset;
        transform: rotate(-90deg);
        right: 10px;
    }
    .oic-variation-thumb-item{
        flex-direction: column-reverse !important;
    }
}

@media (max-width: 768px) {
    .oic-product-title {
        font-size: 35px;
    }
    .oic-config-items-display{
        grid-template-columns: repeat(1, 1fr) !important;
    }
    .single-product .product .extra-options .value{
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
    .body_type .value {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    .woocommerce-variation-price .price{
        font-size: 30px !important;
    }
    .oic-extra-product-options-wrapper .single_add_to_cart_button{
        padding: 15px 25px !important;
    }
    .oic-config-title,.thwepo_accordion_style .section-title h3{
        font-size: 22px !important;
    }
    .extra-options .value .thwepo-checkbox-group-input-field span, .extra-options .value .thwepo-radio-input-field span{
        font-size: 12px;
    }
    .thwepo-image-label{
        font-size: 12px;
    }
    .thwepo-field .label-tag{
        font-size: 17px;
    }
    .thwepo-field .sublabel-tag{
        font-size: 12px !important;
    }
    .product-configuration-accordion .e-n-accordion-item-title-text{
        font-size: 22px;
    }
    .product-configuration-list li{
        font-size: 12px !important;
    }
    .product-configuration-list ul{
        grid-template-columns: repeat(1, 1fr) !important;
        padding-left: 32px !important;
    }
    .oic-main-image-container{
        height: 70vh;
    }
    .oic-variation-gallery{
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
    .oic-variation-thumb{
        width: 100%;
        aspect-ratio: 1 / 1;
        height: auto;
    }
    .oic-variation-thumb-name{
        font-size: 10px;
    }

}