/*
   Theme Name: Kaveh Theme
   Description: Kaveh Theme is undoubtedly the best e-commerce theme produced in the WordPress industry of Iran.
   Theme URI: https://rtl-theme.com/author/moein757
   Version: 4.8.2
   Author: Moein WordPress
   Author URI: https://rtl-theme.com/author/moein757
   Requires at least: 6.2
   Tested up to: 6.4.2
   Requires PHP: 7.4
   License: GNU General Public License v2 or later
   License URI: http://www.gnu.org/licenses/gpl-2.0.html
   Text Domain: kavehTheme
   Tags: responsive, e-commerce, customizable
*/



.boostify-menu .megamenu{
   position: absolute;
   right: -3000px;
   opacity: 0;
   visibility: hidden;
   transition: opacity 0.3s ease, visibility 0.3s ease, right 0s 0.3s;
   pointer-events: none;
}
.boostify-menu .menu-item-has-children:hover .megamenu {
   right: 0;
   opacity: 1;
   visibility: visible;
   transition: opacity 0.3s ease, visibility 0.3s ease, right 0s;
   pointer-events: auto;
}

.boostify-menu .megamenu-two{
   position: absolute;
   right: -3000px;
   opacity: 0;
   visibility: hidden;
   transition: opacity 0.3s ease, visibility 0.3s ease, right 0s 0.3s;
   pointer-events: none;
}

.boostify-menu .menu-item-has-children:hover .megamenu-two {
   right: 0;
   opacity: 1;
   visibility: visible;
   transition: opacity 0.3s ease, visibility 0.3s ease, right 0s;
   pointer-events: auto;
}

/* =====================================================
   Kaveh Variation Modal - Variable Product Selector
   ===================================================== */

.kaveh-variation-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    align-items: center;
    justify-content: center;
}

.kaveh-variation-modal.active {
    display: flex;
}

.kaveh-modal-open {
    overflow: hidden;
}

.kaveh-variation-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.kaveh-variation-modal__content {
    position: relative;
    background: #fff;
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: kavehModalSlideIn 0.3s ease-out;
}

@keyframes kavehModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.kaveh-variation-modal__close {
    position: absolute;
    top: 16px;
    left: 16px;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
    z-index: 10;
}

.kaveh-variation-modal__close:hover {
    background: #e0e0e0;
    color: #333;
}

.kaveh-variation-modal__header {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    padding-top: 20px;
}

.kaveh-variation-modal__image {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #f9f9f9;
}

.kaveh-variation-modal__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kaveh-variation-modal__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.kaveh-variation-modal__title {
    font-size: 16px;
    font-weight: 700;
    color: #212529;
    margin: 0 0 8px 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kaveh-variation-modal__price {
    font-size: 18px;
    font-weight: 800;
    color: #212529;
}

.kaveh-variation-modal__price del {
    color: #9E9E9E;
    font-size: 14px;
    font-weight: 400;
    margin-left: 8px;
}

.kaveh-variation-modal__price ins {
    text-decoration: none;
}

.kaveh-variation-modal__body {
    margin-bottom: 24px;
}

.kaveh-variation-attr {
    margin-bottom: 16px;
}

.kaveh-variation-attr label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.kaveh-variation-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.kaveh-variation-option {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kaveh-variation-option:hover {
    border-color: #333;
    color: #333;
}

.kaveh-variation-option.selected {
    border-color: #212529;
    background: #212529;
    color: #fff;
}

/* Color swatch options */
.kaveh-variation-option--color {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    border-width: 3px;
    position: relative;
}

.kaveh-variation-option--color.selected {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #212529;
}

.kaveh-variation-option--color .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Out of stock options */
.kaveh-variation-option.out-of-stock {
    opacity: 0.5;
    position: relative;
}

.kaveh-variation-option.out-of-stock:not(.kaveh-variation-option--color)::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #999;
    transform: rotate(-10deg);
}

.kaveh-variation-option--color.out-of-stock::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #fff;
    transform: translate(-50%, -50%) rotate(-45deg);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.3);
}

.kaveh-variation-option.out-of-stock:hover {
    border-color: #999;
    color: #666;
}

.kaveh-variation-modal__quantity {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #f1f3f4 100%);
    border-radius: 16px;
    border: 1px solid #e9ecef;
}

.kaveh-variation-modal__quantity label {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    margin: 0;
}

.kaveh-quantity-selector {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #fff;
    border-radius: 12px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.kaveh-quantity-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #f8f9fa;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kaveh-quantity-btn:hover {
    background: #212529;
    color: #fff;
    transform: scale(1.05);
}

.kaveh-quantity-btn:active {
    transform: scale(0.95);
}

.kaveh-quantity-input {
    width: 50px;
    height: 36px;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: #212529;
    -moz-appearance: textfield;
}

.kaveh-quantity-input::-webkit-outer-spin-button,
.kaveh-quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.kaveh-variation-modal__footer {
    margin-top: 16px;
}

.kaveh-variation-modal__add-btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    background: #212529;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.kaveh-variation-modal__add-btn:hover:not(:disabled) {
    background: #000;
}

.kaveh-variation-modal__add-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.kaveh-variation-modal__add-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.kaveh-variation-modal__add-btn.loading svg {
    display: none;
}

.kaveh-variation-modal__add-btn.loading::before {
    content: '';
    width: 18px;
    height: 18px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: kavehSpinner 0.8s linear infinite;
}

@keyframes kavehSpinner {
    to {
        transform: rotate(360deg);
    }
}

/* Loading state for modal */
.kaveh-variation-modal.loading .kaveh-variation-modal__content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 10;
    border-radius: 20px;
}

.kaveh-variation-modal.loading .kaveh-variation-modal__content::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #212529;
    border-top-color: transparent;
    border-radius: 50%;
    animation: kavehSpinner 0.8s linear infinite;
    z-index: 11;
}

/* Toast notification */
.kaveh-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #28a745;
    color: #fff;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    z-index: 9999999;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: all 0.3s ease;
}

.kaveh-toast.active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Mobile responsive */
@media screen and (max-width: 480px) {
    .kaveh-variation-modal__content {
        width: 95%;
        padding: 16px;
        max-height: 85vh;
    }
    
    .kaveh-variation-modal__header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .kaveh-variation-modal__image {
        width: 120px;
        height: 120px;
    }
    
    .kaveh-variation-modal__title {
        font-size: 14px;
    }
    
    .kaveh-variation-option {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .kaveh-variation-option--color {
        width: 32px;
        height: 32px;
    }
}

/* Loading state for ajax add to cart buttons */
.ajax_add_to_cart.kaveh-loading,
.kaveh-variation-modal-trigger.kaveh-loading {
    pointer-events: none;
    position: relative;
}

.ajax_add_to_cart.kaveh-loading i,
.kaveh-variation-modal-trigger.kaveh-loading i {
    visibility: hidden;
}

.ajax_add_to_cart.kaveh-loading::after,
.kaveh-variation-modal-trigger.kaveh-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: kavehSpinner 0.8s linear infinite;
}

.boostify-menu .megamenu-three{
   display: none !important;
}

.boostify-menu .menu-item-has-children:hover .megamenu-three {
   display: block!important;
}


.swiper.swiper-detail-product-four-related{
 overflow: visible !important;
 padding: 40px 0;
}