/* Advanced Add to Cart Widget CSS file */


/* Main Actions Wrapper - Contains Quantity and Buttons */

.woolements-actions-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
}

.woolements-buttons-wrapper {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1 1 auto;
    min-width: 0;
    order: 2;
    /* Adjust as needed */
}

.woolements-quick-buy-button {
    order: 1;
    flex: 0 0 auto;
    min-width: fit-content;
}

.woolements-add-to-cart-button {
    order: 2;
    flex: 0 0 auto;
    width: 100%;
}

.woolements-add-to-cart-button,
.woolements-quick-buy-button {
    /* Button Base Styles */
    padding: 10px 20px;
    border: 1px solid #ccc;
    background-color: #f0f0f0;
    color: #333;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.woolements-add-to-cart-button.loading,
.woolements-quick-buy-button.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.woolements-add-to-cart-button:disabled,
.woolements-quick-buy-button:disabled,
.woolements-quantity-button:disabled,
.woolements-quantity-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.woolements-quantity-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid #eee;
    border-radius: 5px;
    overflow: visible;
    max-width: 150px;
    min-width: 120px;
    position: relative;
    flex-shrink: 0;
    order: 1;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    /* Adjust as needed */
}

.woolements-quantity-wrapper[style*="display: none"] {
    display: none !important;
}

.woolements-quantity-input {
    width: 50px;
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
    border: none;
    outline: none;
    padding: 5px 10px;
}

.woolements-quantity-button {
    background-color: #f0f0f0;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 16px;
    color: #333;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    flex-grow: 0;
}

.woolements-quantity-button.quantity-decrease {
    order: 1;
}

.woolements-quantity-input {
    order: 2;
}

.woolements-quantity-button.quantity-increase {
    order: 3;
}

.woolements-quantity-button:hover {
    background-color: #e0e0e0;
}

/* When stacked, ensure increase is top and decrease is bottom with higher specificity */
.woolements-advanced-add-to-cart-widget .woolements-quantity-wrapper.woolements-quantity-buttons-stacked .quantity-increase { order: 1 !important; }
.woolements-advanced-add-to-cart-widget .woolements-quantity-wrapper.woolements-quantity-buttons-stacked .woolements-quantity-input { order: 2 !important; }
.woolements-advanced-add-to-cart-widget .woolements-quantity-wrapper.woolements-quantity-buttons-stacked .quantity-decrease { order: 3 !important; }
.woolements-advanced-add-to-cart-widget .woolements-quantity-wrapper.woolements-quantity-buttons-stacked .woolements-quantity-button { width: 100% !important; }

/* Ensure both increase and decrease buttons match exactly when stacked */
.woolements-advanced-add-to-cart-widget .woolements-quantity-wrapper.woolements-quantity-buttons-stacked .quantity-increase,
.woolements-advanced-add-to-cart-widget .woolements-quantity-wrapper.woolements-quantity-buttons-stacked .quantity-decrease {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 8px 12px !important;
}

.woolements-out-of-stock-message {
    color: #ff0000;
    font-weight: bold;
    padding: 10px;
    background-color: #ffebeb;
    border: 1px solid #ffcccc;
    border-radius: 5px;
}


/* Target common WooCommerce price markup inside the widget */

.woolements-product-price,
.woolements-product-price-variable {
    display: flex !important;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
    visibility: visible !important;
}

.woolements-product-price .price-wrapper,
.woolements-product-price .price,
.woolements-product-price .amount,
.woolements-product-price ins .amount,
.woolements-product-price del .amount,
.woolements-product-price-variable .price,
.woolements-product-price-variable .amount,
.woolements-product-price-variable ins .amount,
.woolements-product-price-variable del .amount {
    font-size: 1.2em;
    font-weight: bold;
    color: inherit;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    /* allow container color control */
}


/* Fallback stronger specificity for themes that style .price/.amount aggressively */

.woolements-advanced-add-to-cart-widget .woolements-product-price,
.woolements-advanced-add-to-cart-widget .woolements-product-price-variable {
    display: flex !important;
    visibility: visible !important;
}

.woolements-advanced-add-to-cart-widget .woolements-product-price .price,
.woolements-advanced-add-to-cart-widget .woolements-product-price-variable .price {
    color: inherit !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.woolements-advanced-add-to-cart-widget .woolements-product-price .amount,
.woolements-advanced-add-to-cart-widget .woolements-product-price-variable .amount {
    display: inline !important;
    visibility: visible !important;
    opacity: 1 !important;
}


/* Stock Quantity Display */

.woolements-stock-quantity {
    display: inline-block;
    margin-right: 10px;
    padding: 4px 10px;
    background-color: #f0f8ff;
    color: #2271b1;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: 600;
    border: 1px solid #d0e5f5;
}


/* No Price Message */

.woolements-no-price-message {
    display: inline-block;
    font-size: 1.2em;
    font-weight: bold;
    color: #e74c3c;
}


/* Modern Variations Table Styles */

.woolements-variations-table-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    margin-bottom: 20px;
    /* اسکرول بار سفارشی برای مرورگرهای Webkit */
    -webkit-overflow-scrolling: touch;
}

.woolements-variations-table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.woolements-variations-table-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.woolements-variations-table-wrapper::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.woolements-variations-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.woolements-variations-table {
    width: 100%;
    min-width: 800px;
    /* حداقل عرض تا از فشرده شدن جلوگیری کنه - برای دسکتاپ */
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.woolements-variations-table th,
.woolements-variations-table td {
    padding: 12px 16px;
    text-align: center;
    vertical-align: middle;
    border: none;
    transition: all 0.3s ease;
}


/* Border for rows - only internal borders */


/* Default values will be overridden by Elementor controls */

.woolements-variations-table tr:not(:last-child) td,
.woolements-variations-table tr:not(:last-child) th {
    border-bottom-width: 0;
    border-bottom-style: none;
    border-bottom-color: #e0e0e0;
}


/* Border for columns - only internal borders between cells */


/* Default values will be overridden by Elementor controls */

.woolements-variations-table td:not(:first-child):not(:last-child),
.woolements-variations-table th:not(:first-child):not(:last-child) {
    border-left-width: 0;
    border-left-style: none;
    border-left-color: #e0e0e0;
    border-right-width: 0;
    border-right-style: none;
    border-right-color: #e0e0e0;
}

.woolements-variations-table td:first-child:not(:last-child),
.woolements-variations-table th:first-child:not(:last-child) {
    border-left-width: 0;
    border-left-style: none;
    border-left-color: #e0e0e0;
}

.woolements-variations-table td:last-child:not(:first-child),
.woolements-variations-table th:last-child:not(:first-child) {
    border-right-width: 0;
    border-right-style: none;
    border-right-color: #e0e0e0;
}

.woolements-variations-table .attribute-label {
    font-weight: 600;
    background-color: #f8f9fa;
    text-align: right;
    padding-right: 20px;
    color: #333;
}

.woolements-variations-table .attribute-value {
    background-color: #ffffff;
    color: #555;
    font-weight: 500;
}

.woolements-variations-table .selection-row {
    background-color: #f8f9fa;
}

.woolements-variations-table .selection-row .selection-label {
    font-weight: 600;
    text-align: right;
    padding-right: 20px;
    color: #333;
}

.woolements-variations-table .variation-radio-cell {
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.woolements-variations-table .variation-radio-cell:hover {
    background-color: #f0f8ff;
}

.woolements-variations-table .selected-variation-cell {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    position: relative;
}

.woolements-variations-table .selected-variation-cell::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    color: #2196F3;
    font-weight: bold;
    font-size: 14px;
}


/* Modern Radio Button Styles */

.woolements-variations-table .variation-radio {
    display: none;
}

.woolements-variations-table .variation-radio+label {
    position: relative;
    padding-left: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.woolements-variations-table .variation-radio+label:before {
    content: '';
    width: 22px;
    height: 22px;
    border: 2px solid #ddd;
    border-radius: 50%;
    background: #fff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.woolements-variations-table .variation-radio+label:after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2196F3;
    transform: scale(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.woolements-variations-table .variation-radio:checked+label:before {
    border-color: #2196F3;
    border-width: 2px;
    box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.1);
}

.woolements-variations-table .variation-radio:checked+label:after {
    transform: scale(1);
}

.woolements-variations-table .variation-radio+label:hover:before {
    border-color: #2196F3;
    box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.05);
}


/* Unavailable Variation Text */

.woolements-unavailable-variation-text {
    display: inline-block;
    padding: 4px 12px;
    background-color: #ffebee;
    color: #c62828;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.woolements-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    /* Hidden by default */
    z-index: 9999;
}

.woolements-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: none;
    /* Hidden by default */
    z-index: 10000;
    max-width: 90%;
    text-align: center;
}

.woolements-popup-content {
    position: relative;
}

.woolements-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    cursor: pointer;
    color: #aaa;
}

.woolements-popup-close:hover {
    color: #333;
}

.woolements-popup-message {
    margin: 20px 0;
    font-size: 1.1em;
}


/* WooCommerce Notices in Popup */

.woolements-wc-notices {
    margin-top: 15px;
    text-align: right;
    direction: rtl;
}

.woolements-wc-notices>div {
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 0.95em;
    line-height: 1.5;
}

.woolements-wc-notices .woocommerce-message,
.woolements-wc-notices .woocommerce-info {
    background-color: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
}

.woolements-wc-notices .woocommerce-error {
    background-color: #ffebee;
    border-color: #f44336;
    color: #c62828;
}

.woolements-wc-notices .woocommerce-notice {
    background-color: #fff3e0;
    border-color: #ff9800;
    color: #e65100;
}

.woolements-wc-notices a {
    color: inherit;
    text-decoration: underline;
    font-weight: bold;
}

.woolements-wc-notices a:hover {
    opacity: 0.8;
}

.woolements-price-hidden {
    display: none;
}


/* =====================================
   Loading Animation Styles
   ===================================== */

.woolements-loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-in-out;
}

.woolements-loading-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.woolements-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}


/* Cart Animation Container */

.woolements-cart-animation {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* Cart Icon */

.woolements-cart-icon {
    width: 80px;
    height: 80px;
    fill: #fff;
    animation: cartBounce 0.6s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

@keyframes cartBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}


/* Product Box Animation */

.woolements-product-box {
    position: absolute;
    top: -20px;
    right: -30px;
    width: 30px;
    height: 30px;
    animation: productToCart 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

.woolements-product-box svg {
    width: 100%;
    height: 100%;
    fill: #4CAF50;
    stroke: #fff;
    stroke-width: 2;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

@keyframes productToCart {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }

    20% {
        transform: translate(-10px, 10px) scale(0.95) rotate(-15deg);
        opacity: 1;
    }

    40% {
        transform: translate(-20px, 25px) scale(0.85) rotate(-30deg);
        opacity: 0.9;
    }

    60% {
        transform: translate(-30px, 35px) scale(0.65) rotate(-45deg);
        opacity: 0.7;
    }

    80% {
        transform: translate(-38px, 42px) scale(0.4) rotate(-60deg);
        opacity: 0.4;
    }

    100% {
        transform: translate(-42px, 48px) scale(0.1) rotate(-90deg);
        opacity: 0;
    }
}


/* Responsive Styles for Mobile */

@media screen and (max-width: 768px) {
    .woolements-variations-table-wrapper {
        margin-bottom: 15px;
    }

    .woolements-variations-table {
        min-width: 500px;
        /* کمتر برای موبایل */
    }

    .woolements-variations-table th,
    .woolements-variations-table td {
        padding: 10px 12px;
        font-size: 14px;
    }

    .woolements-variations-table .attribute-label {
        font-size: 13px;
    }
}

@media screen and (max-width: 480px) {
    .woolements-variations-table {
        min-width: 400px;
    }

    .woolements-variations-table th,
    .woolements-variations-table td {
        padding: 8px 10px;
        font-size: 13px;
    }
}


/* Loading Dots */

.woolements-loading-dots {
    display: flex;
    gap: 10px;
}

.woolements-loading-dots span {
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    animation: dotPulse 1.4s ease-in-out infinite;
}

.woolements-loading-dots span:nth-child(1) {
    animation-delay: 0s;
}

.woolements-loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}


.woolements-variations-summary {
    font-size: 1.1em;
    color: #333;
    line-height: 1.6;
}

.woolements-variations-summary .summary-attr {
    display: inline-block;
    margin-right: 5px;
}

.woolements-popup-trigger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: #2196F3;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    width: fit-content;
}

.woolements-popup-trigger-button:hover {
    background-color: #1976D2;
    transform: translateY(-2px);
}

.woolements-popup-trigger-button i,
.woolements-popup-trigger-button svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Variation Modal */
.woolements-variation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    /* High z-index */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.woolements-variation-modal.active {
    opacity: 1;
    visibility: visible;
}

.woolements-variation-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
}

.woolements-variation-modal-content {
    position: relative;
    background-color: #fff;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    padding: 30px;
    z-index: 100001;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.woolements-variation-modal.active .woolements-variation-modal-content {
    transform: scale(1);
}

.woolements-variation-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 28px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    transition: color 0.2s ease;
    z-index: 10;
}

.woolements-variation-modal-close:hover {
    color: #333;
}

.woolements-variation-modal-body {
    margin-top: 10px;
}

/* Adjust table inside modal */
.woolements-variation-modal-body .woolements-variations-table-wrapper {
    margin-bottom: 0;
    box-shadow: none;
    /* Remove shadow inside modal as modal has shadow */
}

.woolements-variation-modal-body .woolements-variations-table {
    box-shadow: none;
    border: 1px solid #eee;
}

/* ==============================================
   New Table View Styles for Variation Selection
   ============================================== */

/* Table Header Cells */
.woolements-table-header-cell {
    font-weight: 600;
    background-color: #f8f9fa;
    text-align: right;
    padding-right: 20px;
    color: #333;
    white-space: nowrap;
    min-width: 120px;
}

/* Table Data Cells */
.woolements-table-cell {
    background-color: #ffffff;
    color: #555;
    font-weight: 500;
    text-align: center;
    vertical-align: middle;
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: 100px;
}

.woolements-table-cell:hover {
    background-color: #f0f8ff;
}

/* Selected Cell State */
.woolements-cell-selected {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%) !important;
    position: relative;
    border-color: #2196F3 !important;
}

/* Attribute Row Styles */
.woolements-table-attribute-row .woolements-table-cell {
    font-size: 14px;
}

/* Price Row Styles */
.woolements-table-price-row .woolements-table-header-cell {
    background-color: #f5f5f5;
}

.woolements-table-price-cell {
    font-weight: 600;
}

/* Price Layout - Inline */
.woolements-price-inline {
    white-space: nowrap;
}

.woolements-price-inline del,
.woolements-price-inline ins {
    display: inline;
    margin: 0 4px;
}

.woolements-price-inline del {
    color: #999;
    text-decoration: line-through;
    font-weight: 400;
}

.woolements-price-inline ins {
    color: #27ae60;
    text-decoration: none;
}

/* Price Layout - Stacked */
.woolements-price-stacked {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.woolements-price-stacked del,
.woolements-price-stacked ins {
    display: block;
    margin: 0;
}

.woolements-price-stacked del {
    color: #999;
    text-decoration: line-through;
    font-weight: 400;
    font-size: 0.9em;
}

.woolements-price-stacked ins {
    color: #27ae60;
    text-decoration: none;
    font-size: 1.1em;
}

.woolements-current-price {
    color: #333;
    font-weight: 600;
}

.woolements-regular-price {
    color: #999;
}

.woolements-sale-price {
    color: #27ae60;
    font-weight: 600;
}

/* Selection Row Styles */
.woolements-table-selection-row .woolements-table-header-cell {
    background-color: #f0f4f8;
}

.woolements-table-selection-cell {
    padding: 16px 12px;
}

/* Radio Button Styles */
.woolements-variation-radio {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #2196F3;
}

.woolements-variation-radio:checked {
    transform: scale(1.1);
}

/* Selection Button Styles */
.woolements-variation-select-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background-color: #f0f0f0;
    border: 2px solid #ddd;
    border-radius: 6px;
    color: #333;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
}

.woolements-variation-select-button:hover {
    background-color: #e3f2fd;
    border-color: #2196F3;
    color: #2196F3;
}

.woolements-variation-select-button.woolements-button-selected {
    background-color: #2196F3;
    border-color: #2196F3;
    color: #fff;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.4);
}

/* Scroll Support for Table */
.woolements-variations-table-wrapper.woolements-table-scroll-enabled {
    overflow-x: auto;
    overflow-y: auto;
}

/* Sticky Header Cell when scrolling */
.woolements-table-scroll-enabled .woolements-table-header-cell {
    position: sticky;
    left: 0;
    z-index: 2;
    background-color: #f8f9fa;
}

/* RTL Support for Table */
[dir="rtl"] .woolements-table-header-cell,
.rtl .woolements-table-header-cell {
    text-align: right;
    padding-left: 20px;
    padding-right: 16px;
}

[dir="rtl"] .woolements-table-scroll-enabled .woolements-table-header-cell,
.rtl .woolements-table-scroll-enabled .woolements-table-header-cell {
    left: auto;
    right: 0;
}

/* Responsive Styles for New Table View */
@media screen and (max-width: 768px) {
    .woolements-table-header-cell,
    .woolements-table-cell {
        min-width: 80px;
        padding: 10px 8px;
    }

    .woolements-variation-select-button {
        padding: 6px 12px;
        font-size: 13px;
        min-width: 60px;
    }
}

@media screen and (max-width: 480px) {
    .woolements-table-header-cell,
    .woolements-table-cell {
        min-width: 60px;
        padding: 8px 6px;
        font-size: 12px;
    }
}