:root {
    --acwpp-radius: 12px;
    --acwpp-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    --acwpp-gradient: linear-gradient(135deg, #FF416C 0%, #FF4B2B 100%);
    --acwpp-text-color: #333333;
}

/* 
 * 1. Force Hide Default Elements (Astra overrides)
 */
.woocommerce-product-gallery, 
.woocommerce-tabs.wc-tabs-wrapper,
.ast-woocommerce-container .woocommerce-product-gallery {
    display: none !important;
}

/* 
 * 2. Reset Default WooCommerce Container Grid
 */
.woocommerce div.product {
    display: block !important;
}

/* 
 * 3. Our Custom Wrapper Layout (Fixes the messy grid)
 */
.acwpp-product-wrapper {
    display: grid;
    /* In Persian RTL: 55% is the right column (Gallery), 42% is the left column (Details) */
    grid-template-columns: 55% 40%;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 60px;
}

/* 
 * 4. Masonry Gallery Layout
 */
.acwpp-masonry-gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}
.acwpp-img {
    width: 100%;
    height: 100%;
    border-radius: var(--acwpp-radius);
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}
.acwpp-img:hover {
    transform: translateY(-5px);
}
.acwpp-main-img {
    grid-column: span 2;
    max-height: 600px; /* جلوگیری از بیش از حد بزرگ شدن عکس اصلی */
}

/* 
 * 5. Sticky Product Summary (The White Box)
 */
.acwpp-product-wrapper .summary.entry-summary {
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
    position: sticky;
    top: 40px; /* فاصله از بالای صفحه هنگام اسکرول */
    background: #ffffff;
    padding: 30px;
    border-radius: var(--acwpp-radius);
    box-shadow: var(--acwpp-shadow);
    border: 1px solid #f2f2f2;
}

/* Add to Cart Button */
.woocommerce div.product form.cart .button {
    width: 100%;
    background: var(--acwpp-gradient) !important;
    color: #ffffff !important;
    border: none;
    border-radius: var(--acwpp-radius) !important;
    padding: 18px 20px;
    font-size: 16px;
    font-weight: 700;
    transition: all 0.4s ease;
}
.woocommerce div.product form.cart .button:hover {
    box-shadow: 0 10px 25px rgba(255, 65, 108, 0.4);
    transform: translateY(-3px);
}

/* Accordion */
.acwpp-accordion-wrapper {
    margin-top: 25px;
    border-top: 1px solid #eee;
    padding-top: 10px;
}
.acwpp-accordion {
    border-bottom: 1px solid #eee;
    padding: 15px 0;
}
.acwpp-accordion-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--acwpp-text-color);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.acwpp-accordion-title::-webkit-details-marker {
    display: none;
}
.acwpp-accordion-title::after {
    content: "+";
    font-size: 20px;
    color: #888;
}
.acwpp-accordion[open] .acwpp-accordion-title::after {
    content: "-";
}
.acwpp-accordion-content {
    padding-top: 15px;
    font-size: 14px;
    color: #555;
    line-height: 1.8;
}

/* 
 * 6. Mobile Responsiveness
 */
.acwpp-mobile-sticky-bar {
    display: none;
}

@media (max-width: 768px) {
    .acwpp-product-wrapper {
        grid-template-columns: 1fr; /* تبدیل به یک ستون در موبایل */
        gap: 30px;
    }
    .acwpp-product-wrapper .summary.entry-summary {
        position: relative;
        top: 0;
        padding: 20px;
    }
    
    /* Mobile Sticky Bottom Bar */
    .acwpp-mobile-sticky-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #ffffff;
        padding: 15px 20px;
        box-shadow: 0 -5px 25px rgba(0,0,0,0.15);
        z-index: 99999;
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .acwpp-mobile-sticky-bar.acwpp-show {
        transform: translateY(0);
    }
    .acwpp-msb-price .amount {
        font-weight: 800;
        font-size: 18px;
        color: var(--acwpp-text-color);
    }
    .acwpp-msb-btn {
        background: var(--acwpp-gradient);
        color: #fff;
        border: none;
        border-radius: var(--acwpp-radius);
        padding: 12px 25px;
        font-weight: 700;
    }
}
/* 
 * 7. ThemeHigh Extra Product Options (THWEPO) Compatibility & Styling
 */

/* شکستن ساختار جدولی پیش‌فرض افزونه و تمام‌عرض کردن آن */
.acwpp-product-wrapper .thwepo-extra-options,
.acwpp-product-wrapper table.thwepo-extra-options,
.acwpp-product-wrapper table.thwepo-extra-options tbody,
.acwpp-product-wrapper table.thwepo-extra-options tr {
    display: block !important;
    width: 100% !important;
    border: none !important;
}

/* فاصله دادن کل بخش فیلدها از دکمه افزودن به سبد خرید */
.acwpp-product-wrapper table.thwepo-extra-options {
    margin-bottom: 25px !important;
    padding-bottom: 20px !important;
    border-bottom: 1px dashed #e2e8f0 !important;
}

/* تبدیل سلول‌های جدول به بلاک‌های مرتب برای راست‌چین (RTL) */
.acwpp-product-wrapper .thwepo-extra-options th,
.acwpp-product-wrapper .thwepo-extra-options td {
    display: block !important;
    width: 100% !important;
    padding: 5px 0 15px 0 !important;
    text-align: right !important;
    border: none !important;
    background: transparent !important;
}

/* استایل‌دهی به عناوین (لیبل‌های) فیلدها */
.acwpp-product-wrapper .thwepo-extra-options label.title {
    font-weight: 700 !important;
    color: #1e293b !important;
    font-size: 14px !important;
    display: block !important;
    margin-bottom: 8px !important;
}

/* استایل‌دهی به خود فیلدها (متن، عدد، لیست کشویی و...) */
.acwpp-product-wrapper .thwepo-extra-options input[type="text"],
.acwpp-product-wrapper .thwepo-extra-options input[type="password"],
.acwpp-product-wrapper .thwepo-extra-options input[type="email"],
.acwpp-product-wrapper .thwepo-extra-options input[type="number"],
.acwpp-product-wrapper .thwepo-extra-options input[type="file"],
.acwpp-product-wrapper .thwepo-extra-options textarea,
.acwpp-product-wrapper .thwepo-extra-options select {
    width: 100% !important;
    padding: 12px 15px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    background-color: #f8fafc !important;
    color: var(--acwpp-text-color) !important;
    font-family: inherit !important;
    font-size: 14px !important;
    transition: all 0.3s ease !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
    height: auto !important;
}

/* افکت جذاب هنگام تایپ یا کلیک روی فیلدهای افزونه ThemeHigh */
.acwpp-product-wrapper .thwepo-extra-options input[type="text"]:focus,
.acwpp-product-wrapper .thwepo-extra-options input[type="number"]:focus,
.acwpp-product-wrapper .thwepo-extra-options textarea:focus,
.acwpp-product-wrapper .thwepo-extra-options select:focus {
    border-color: #FF416C !important;
    box-shadow: 0 0 0 3px rgba(255, 65, 108, 0.1) !important;
    outline: none !important;
    background-color: #ffffff !important;
}

/* تنظیمات دکمه‌های رادیویی و چک‌باکس‌ها */
.acwpp-product-wrapper .thwepo-extra-options ul.thwepo-ul-options {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 15px !important;
}

.acwpp-product-wrapper .thwepo-extra-options ul.thwepo-ul-options li {
    display: inline-flex !important;
    align-items: center !important;
}

.acwpp-product-wrapper .thwepo-extra-options input[type="radio"],
.acwpp-product-wrapper .thwepo-extra-options input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    margin-left: 8px !important; /* برای راست‌چین */
    accent-color: #FF416C !important;
    cursor: pointer !important;
}

.acwpp-product-wrapper .thwepo-extra-options span.label {
    font-size: 14px !important;
    color: #475569 !important;
    cursor: pointer !important;
}