/* فونت و کلیات */
#ewm-minicart-modal {
    direction: rtl;
}

/* استایل‌های اصلی بدنه مدال و لایه تاریک (موارد جدید) */
.ewm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s, opacity 0.3s ease-in-out;
}

.ewm-modal.is-open {
    visibility: visible;
    opacity: 1;
}

.ewm-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    cursor: pointer;
}

.ewm-modal-content {
    position: absolute;
    top: 0;
    right: -450px; /* شروع از بیرون صفحه */
    width: 400px;
    max-width: 100%;
    height: 100vh;
    background: #fff;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 100000;
}

.ewm-modal.is-open .ewm-modal-content {
    right: 0;
}

.ewm-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #f1f1f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ewm-modal-header h3 {
    margin: 0;
    font-size: 16px;
}

.ewm-close-modal {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #888;
    transition: 0.2s;
}

.ewm-close-modal:hover {
    color: #e74c3c;
}

.ewm-modal-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

/* نوار پیشرفت ارسال رایگان */
.ewm-shipping-info {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 15px;
}

.ewm-shipping-info p {
    font-size: 13px;
    margin-bottom: 8px;
    color: #444;
}

.ewm-progress-bar {
    height: 8px;
    background: #eee;
    border-radius: 10px;
    overflow: hidden;
}

.ewm-progress-fill {
    height: 100%;
    background: #27ae60;
    transition: width 0.5s ease;
}

/* ردیف محصول */
.ewm-cart-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f1f1f1;
    position: relative;
}

.ewm-item-img img {
    border-radius: 5px;
    margin-left: 10px;
}

.ewm-item-info {
    flex: 1;
}

.ewm-item-title {
    display: block;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 5px;
}

.ewm-item-price {
    color: #e67e22;
    font-size: 13px;
}

/* دکمه حذف */
.ewm-remove-btn {
    background: none;
    border: none;
    color: #ff7675;
    font-size: 20px;
    cursor: pointer;
    transition: 0.2s;
}

.ewm-remove-btn:hover {
    color: #d63031;
}

/* فوتر و دکمه‌ها */
.ewm-cart-summary {
    padding: 20px;
    border-top: 1px solid #f1f1f1;
    background: #fafafa;
}

.ewm-total-row {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    padding-bottom: 20px;
    font-size: 16px;
}

.ewm-btn {
    display: block;
    text-align: center;
    padding: 12px;
    border-radius: 5px;
    text-decoration: none;
    margin-bottom: 10px;
    font-weight: bold;
    transition: 0.3s;
}

.ewm-btn-view-cart {
    background: #eee;
    color: #333;
}

.ewm-btn-view-cart:hover {
    background: #e0e0e0;
}

.ewm-btn-checkout {
    background: #2ecc71;
    color: #fff;
}

.ewm-btn-checkout:hover {
    background: #27ae60;
}

/* دکمه اختصاصی هدر */
.ewm-btn-header {
    background: #333;
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* دکمه اختصاصی فوتر (Sticky Floating) */
.ewm-btn-footer {
    position: relative;
    border: none;
    background: none;
}

.ewm-btn-footer .ewm-count {
    position: absolute;
    top: 0;
    right: 0;
    background: #e74c3c;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 11px;
}

/* افکت اسکلتون برای لودینگ */
.ewm-skeleton {
    height: 80px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    margin-bottom: 10px;
    border-radius: 8px;
}

.ewm-label-footer {
    color: white;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}