/* استایل‌های شورت کد محصول سفارشی */

.custom-product-shortcode {
    margin: 20px 0;
}

.custom-product-shortcode .custom-buttons-wrapper {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.custom-product-shortcode .custom-buttons-wrapper button {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.custom-quick-buy-btn {
    background: #28a745 !important;
    color: white !important;
}

.custom-quick-buy-btn:hover {
    background: #218838 !important;
}

.custom-add-to-cart-btn {
    background: #540980 !important;
    color: white !important;
}

.custom-add-to-cart-btn:hover {
    background: #3d0659 !important;
}

.social-buttons-wrapper {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.social-buttons-wrapper button {
    padding: 12px 18px;
    background: #f8f9fa;
    color: #6c757d;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* حالت فعال شبیه افزونه مرجع */
.social-buttons-wrapper .save-product-btn.is-active { background:#007bff !important; color:#fff !important; border-color:#007bff !important; }
.social-buttons-wrapper .like-product-btn.is-active { background:#dc3545 !important; color:#fff !important; border-color:#dc3545 !important; }
.social-buttons-wrapper .share-product-btn.is-active { background:#28a745 !important; color:#fff !important; border-color:#28a745 !important; }

/* افکت ضربان کوتاه هنگام کلیک */
@keyframes pulseOnce { 0%{transform:scale(1)} 50%{transform:scale(1.06)} 100%{transform:scale(1)} }
.social-buttons-wrapper button.pulse { animation:pulseOnce .25s ease-out; }

.social-buttons-wrapper button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.save-product-btn:hover {
    background: #007bff !important;
    color: white !important;
    border-color: #007bff !important;
    transform: translateY(-2px) scale(1.05);
}

.like-product-btn:hover {
    background: #dc3545 !important;
    color: white !important;
    border-color: #dc3545 !important;
    transform: translateY(-2px) scale(1.05);
}

.share-product-btn:hover {
    background: #28a745 !important;
    color: white !important;
    border-color: #28a745 !important;
    transform: translateY(-2px) scale(1.05);
}

/* انیمیشن کلیک */
.social-buttons-wrapper button:active {
    transform: translateY(0) scale(0.98);
    transition: all 0.1s ease;
}

/* انیمیشن شمارنده */
.social-buttons-wrapper .save-count,
.social-buttons-wrapper .like-count,
.social-buttons-wrapper .share-count {
    transition: all 0.3s ease;
}

.social-buttons-wrapper button:hover .save-count,
.social-buttons-wrapper button:hover .like-count,
.social-buttons-wrapper button:hover .share-count {
    transform: scale(1.1);
}

/* نوار شناور */
.sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    color: #333;
    padding: 15px;
    text-align: center;
    z-index: 9999;
    border-top: 2px solid #e9ecef;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.1);
}

.sticky-bar > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.sticky-decision-btn {
    background: #ff6b35;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sticky-decision-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.sticky-decision-btn:hover::before {
    left: 100%;
}

.sticky-decision-btn:hover {
    background: #e55a2b;
    transform: translateY(-2px);
}

.sticky-decision-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* فیلد تعداد دسکتاپ - استایل مدرن */
.sticky-quantity-desktop {
    display: none;
    opacity: 0;
    transform: translateY(0);
    transition: all 0.3s ease;
}

.sticky-quantity-desktop.show {
    opacity: 1;
    transform: translateY(0);
}

/* بدون لیبل برای فشردگی بیشتر در استیکی */

.sticky-quantity-desktop .quantity-wrapper {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 14px;
    border: 1px solid #ffd6dc;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(255, 80, 100, 0.15);
}

.sticky-quantity-desktop .quantity-btn {
    background: #ff667e;
    color: #fff;
    border: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.2s ease;
    border-radius: 10px;
}

.sticky-quantity-desktop .quantity-btn:hover { background: #ff4d68; }

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

.sticky-quantity-desktop .quantity-input {
    width: 40px;
    height: 32px;
    border: 1px solid #ffe3e7;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    background: #fff;
    color: #333;
    border-radius: 8px;
}

.sticky-quantity-desktop .quantity-input:focus {
    outline: none;
}

/* فیلد تعداد موبایل - استایل مدرن */
.sticky-quantity-mobile {
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px;
    margin: -15px -15px 15px -15px;
    border-bottom: 1px solid #dee2e6;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.sticky-quantity-mobile.show {
    opacity: 1;
    transform: translateY(0);
}

.sticky-quantity-mobile > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sticky-quantity-mobile .quantity-label {
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.sticky-quantity-mobile .quantity-wrapper {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 30px;
    border: 2px solid #540980;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(84, 9, 128, 0.2);
}

.sticky-quantity-mobile .quantity-btn {
    background: #540980;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.sticky-quantity-mobile .quantity-btn:hover {
    background: #3d0659;
}

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

.sticky-quantity-mobile .quantity-input {
    width: 60px;
    height: 35px;
    border: none;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    background: white;
    color: #333;
}

.sticky-quantity-mobile .quantity-input:focus {
    outline: none;
}

/* سبد خرید کناری */
.cart-icon-wrapper {
    position: relative;
    display: inline-block;
}

.cart-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    font-size: 24px;
    position: relative;
}

.cart-count-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    z-index: 99999;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.cart-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-sidebar-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.cart-sidebar-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.cart-sidebar-content {
    padding: 20px;
    padding-bottom: 120px; /* فضا برای footer */
}

.cart-sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

.cart-total {
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.cart-view-btn,
.cart-checkout-btn {
    display: block;
    text-align: center;
    color: white;
    padding: 12px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    margin-top: 10px;
}

.cart-view-btn {
    background: #540980;
}

.cart-checkout-btn {
    background: #28a745;
}

.cart-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 99998;
    display: none;
}

/* آیتم‌های سبد خرید */
.cart-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.cart-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    margin-left: 10px;
    border-radius: 4px;
}

.cart-item > div {
    flex: 1;
}

.cart-item .remove-cart-item {
    background: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.cart-item .remove-cart-item:hover {
    background: #c82333;
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .sticky-bar {
        padding: 10px;
    }
    
    .sticky-bar > div {
        flex-direction: column;
        gap: 10px;
    }
    
    .sticky-bar > div > div:first-child {
        text-align: center;
    }
    
    .sticky-quantity-desktop {
        display: none !important;
    }
    
    .sticky-quantity-mobile {
        display: block !important;
    }
    
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    /* روی موبایل: متن دکمه‌های اجتماعی مخفی، فقط آیکن + شمارنده */
    .social-buttons-wrapper .save-text,
    .social-buttons-wrapper .like-text,
    .social-buttons-wrapper .share-text {
        display: none;
    }
    /* دکمه‌ها کنار هم بمانند */
    .social-buttons-wrapper {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        flex-wrap: nowrap;
    }
    .social-buttons-wrapper button {
        width: auto;
        max-width: none;
        justify-content: center;
        padding: 10px 12px;
    }
}

@media (min-width: 769px) {
    .sticky-quantity-mobile {
        display: none !important;
    }
}

/* انیمیشن‌ها */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideInRight {
    from { 
        transform: translateX(100%); 
        opacity: 0; 
    }
    to { 
        transform: translateX(0); 
        opacity: 1; 
    }
}

@keyframes slideOutRight {
    from { 
        transform: translateX(0); 
        opacity: 1; 
    }
    to { 
        transform: translateX(100%); 
        opacity: 0; 
    }
}

.custom-product-shortcode {
    animation: slideUp 0.5s ease-out;
}

.sticky-bar {
    animation: slideUp 0.3s ease-out;
}

/* نوتیفیکیشن */
.custom-notification {
    animation: slideInRight 0.3s ease-out;
}

.custom-notification.fade-out {
    animation: slideOutRight 0.3s ease-out;
}

/* بهبود ظاهر فیلد تعداد */


.quantity-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.quantity-field input {
    width: 60px;
    height: 36px;
    border: none;
    text-align: center;
    font-size: 16px;
}

.quantity-field input:focus {
    outline: none;
    border-color: transparent;
    box-shadow: none;
}

/* استایل کنترل تعداد شبیه تصویر */
.quantity-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 0;
    background: #fff;
    border-radius: 14px;
    padding: 6px;
    box-shadow: 0 4px 16px rgba(255, 80, 100, 0.15);
    border: 1px solid #ffd6dc;
}
.quantity-btn {
    background: #ff667e;
    color: #fff;
    border: none;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.2s ease;
}
.quantity-btn.quantity-minus::before { content: '🗑️' !important; font-size: 16px !important; }
.quantity-btn.quantity-plus::before { content: '+' !important; font-weight: 700 !important; font-size: 18px !important; }
.quantity-btn:active { transform: scale(0.95); }
.quantity-input {
    width: 36px !important;
    height: 32px !important;
    border-radius: 8px;
    border: 1px solid #ffe3e7 !important;
    margin: 0 6px;
    background: #fff;
    direction: ltr;
    font-family: inherit;
}

/* پاپ‌آپ انتخاب تعداد در موبایل */
.quantity-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6) !important;
    display: none !important;
    opacity: 0 !important;
    align-items: flex-end !important;
    justify-content: center !important;
    z-index: 2147483647 !important; /* بالاترین مقدار ممکن */
    transition: opacity .25s ease-out !important;
}
.quantity-popup-overlay.show { display: flex !important; opacity: 1 !important; }
.quantity-popup {
    width: 100% !important;
    background: #fff !important;
    border-top-left-radius: 20px !important;
    border-top-right-radius: 20px !important;
    padding: 16px 16px calc(env(safe-area-inset-bottom) + 16px) !important;
    box-shadow: 0 -12px 30px rgba(0,0,0,0.2) !important;
    max-width: 560px !important;
    transform: translateY(100%) !important;
    transition: transform .28s cubic-bezier(.25,.8,.25,1) !important;
}
.quantity-popup-overlay.show .quantity-popup { transform: translateY(0) !important; }
.quantity-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.quantity-popup::before {
    content: '' !important;
    display: block !important;
    width: 36px !important;
    height: 4px !important;
    background: #e9ecef !important;
    border-radius: 4px !important;
    margin: 0 auto 12px !important;
}
.quantity-popup-title { font-weight: 700; }
.quantity-popup-close {
    background: none !important;
    border: none !important;
    font-size: 22px !important;
    cursor: pointer !important;
}
.quantity-popup-actions {
    margin-top: 14px !important;
}
.quantity-popup-confirm {
    width: 100% !important;
    background: #ff6b35 !important;
    color: #fff !important;
    border: none !important;
    padding: 12px 16px !important;
    border-radius: 10px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
}

/* حذف اسپینرهای input:number */
input[type=number].quantity-input::-webkit-outer-spin-button,
input[type=number].quantity-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number].quantity-input { -moz-appearance: textfield; }

/* قفل اسکرول هنگام پاپ‌آپ */
body.qp-open { overflow: hidden; }

/* استایل‌های اضافی برای محصولات متغیر */
.variations_form {
    margin-bottom: 20px;
}

.variations_form .woocommerce-variation-price {
    margin: 10px 0;
    font-size: 18px;
    font-weight: bold;
    color: #dc3545;
}

.variations_form .woocommerce-variation-availability {
    margin: 10px 0;
}

/* بهبود ظاهر دکمه‌ها */
.custom-product-shortcode button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.custom-product-shortcode button:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* پنهان کردن دکمه افزودن به سبد و فیلد تعداد پیش‌فرض ووکامرس فقط داخل شورت‌کد ما */
.custom-product-shortcode .single_variation_wrap .quantity,
.custom-product-shortcode .single_variation_wrap button.single_add_to_cart_button {
    display: none !important;
}