/* ============================================
   استایل دکمه مهمان محصول ووکامرس
   ============================================ */

/* دکمه مهمان */
.wc-guest-button {
    background-color: #2ecc71 !important;
    color: #fff !important;
    border: none !important;
    padding: 12px 24px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    border-radius: 4px !important;
    text-align: center !important;
    display: inline-block !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.wc-guest-button:hover {
    background-color: #27ae60 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(46, 204, 113, 0.3);
}

.wc-guest-button:active {
    transform: translateY(0);
}

.wc-guest-button:disabled {
    background-color: #95a5a6 !important;
    cursor: not-allowed !important;
    transform: none !important;
    opacity: 0.7;
}

/* پیام‌های موفقیت و خطا */
.wc-guest-message {
    padding: 12px 16px;
    margin-top: 15px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.6;
    animation: slideDown 0.3s ease;
}

.wc-guest-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.wc-guest-message.success::before {
    content: "✓ ";
    font-weight: bold;
    font-size: 16px;
}

.wc-guest-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.wc-guest-message.error::before {
    content: "✕ ";
    font-weight: bold;
    font-size: 16px;
}

/* پیام استفاده قبلی */
.wc-guest-used-message {
    margin-top: 15px;
    padding: 12px 16px;
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    border-radius: 4px;
}

.wc-guest-used-message p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
}

.wc-guest-used-message::before {
    content: "ℹ ";
    font-weight: bold;
    font-size: 16px;
    margin-left: 5px;
}

/* تنظیمات متاباکس در پنل ادمین */
.wc-guest-product-settings {
    padding: 10px 0;
}

.wc-guest-product-settings label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    cursor: pointer;
}

.wc-guest-product-settings input[type="checkbox"] {
    margin: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.wc-guest-product-settings .description {
    margin-top: 8px;
    font-style: italic;
    color: #666;
    font-size: 13px;
    line-height: 1.5;
}

/* انیمیشن برای پیام‌ها */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* حالت موبایل */
@media (max-width: 768px) {
    .wc-guest-button {
        font-size: 15px !important;
        padding: 14px 20px !important;
    }
    
    .wc-guest-message,
    .wc-guest-used-message {
        font-size: 13px;
        padding: 10px 14px;
    }
}

/* سازگاری با تم‌های مختلف */
.single-product .wc-guest-button {
    margin-bottom: 0 !important;
}

/* لودینگ */
.wc-guest-button.loading {
    position: relative;
    pointer-events: none;
}

.wc-guest-button.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

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

/* RTL Support */
[dir="rtl"] .wc-guest-message.success::before,
[dir="rtl"] .wc-guest-message.error::before,
[dir="rtl"] .wc-guest-used-message::before {
    margin-left: 0;
    margin-right: 5px;
}