/* Frontend styles for ITN Side Cart */


/* والد برای position */
.xoo-wsch-basket {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* شمارنده سبد خرید */
.xoo-wsch-items-count {
	position: absolute;
	top: -6px;
	right: -6px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	background-color: #e53935;
	color: #ffffff;
	border-radius: 50%;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	text-align: center;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10;
	line-height: 0 !important;
}

/* اگر آیکن SVG هست */
.itn-cart-icon {
    position: relative;
    cursor: pointer;
    display: inline-flex;
}


.itn-qty-plus.disabled,
.itn-qty-plus:disabled,
.itn-qty-minus.disabled,
.itn-qty-minus:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.itn-sc-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: none;
    transition: opacity 0.3s ease;
}

.itn-sidecart {
    position: fixed;
    right: 0;
    top: 0;
    width: 350px;
    height: 100dvh;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: -8px 0 25px rgba(0,0,0,0.15);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 9999;
    overflow: hidden;
}

.itn-sidecart.open { transform: translateX(0); }

.itn-sc-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.itn-sc-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.itn-sc-basket-icon::before {
    content: '\f174'; /* WooCommerce cart icon */
    font-family: 'Dashicons';
    font-size: 24px;
    color: #007cba;
}

.itn-sc-title {
    font-weight: 600;
    color: #333;
    font-size: 18px;
}

.itn-sc-close.itn-close {
	background-color: bisque;
	color: red;
	display: flex;
	align-items: center;
	justify-content: center;
    font-size: 20px!important;
}

.itn-sc-close.itn-close:hover {
	background-color: bisque;
	color: red;
}

.itn-sc-count {
	background: #ff0000;
	color: #fff;
	/* padding: 2px 8px; */
	border-radius: 50%;
	font-size: 16px;
	font-weight: bold;
	/* min-width: 20px; */
	/* text-align: center; */
	position: absolute;
	top: 8px;
	right: 12px;
	width: 27px;
	height: 27px;
	display: flex;
	justify-content: center;
	align-content: center;
	align-items: center;
}

.itn-sc-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.itn-sc-close:hover {
    background: #f0f0f0;
    color: #333;
}

.itn-sc-main {
    padding: 1rem;
    overflow-y: auto;
    height: calc(100% - 200px);
    position: relative;
}

.itn-sc-main.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: -60px;                 /* تغییر اصلی: به جای 0، مقدار 60px */
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}
.itn-sc-main.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 11!important;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


.itn-sc-empty {
	text-align: center;
	color: #666;
	padding: 2rem;
	font-style: normal;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-content: center;
	align-items: center;
}

.itn-sc-products {
    display: flex;
    flex-direction: row!important;
    gap: 1rem;
}

.itn-sc-footer {
	padding: 1.5rem;
	border-top: 1px solid #e9ecef;
	background: #fff;
	margin-top: -15%;
	z-index: 10000;
	position: sticky!important;
}

.itn-sc-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
}

.itn-sc-buttons {
    display: flex;
    gap: 0.5rem;
}

.itn-sc-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.itn-sc-btn-view {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #dee2e6;
}

.itn-sc-btn-view:hover {
    background: #e9ecef;
}

.itn-sc-btn-checkout {
    background: #007cba;
    color: #fff;
}

.itn-sc-btn-checkout:hover {
    background: #005a87;
}

/* Mini Cart Button */
.itn-mini-cart {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
    font-size: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f5f5f5;
    transition: all 0.3s ease;
}



.itn-cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff0000;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 50%;
    padding: 0 2px;
}

.itn-cart-text {
    margin-left: 5px;
    font-size: 14px;
}

.itn-qty-plus,.itn-qty-remove,.itn-qty-minus {
	width: 40px !important;
}

.itn-qty-plus,.itn-qty-minus,.itn-qty-plus.disabled {
	font-size: 18px!important;
}


/* MINI-CART ITEM STYLE - SIMPLE & MODERN */
.itn-sc-product {
	display: flex;
	align-items: center;
	flex-direction: column !important;
	gap: 6px;
	background: #fff;
	border-radius: 10px;
	padding: 10px;
	box-shadow: 0 2px 6px rgba(0,0,0,0.08);
	transition: all 0.2s ease;
	font-family: inherit;
	flex-wrap: wrap!important;
}


.itn-sc-product:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.itn-sc-img img {
    width: 60px !important;
    height: 60px !important;
    border-radius: 8px;
    object-fit: cover;
}

.itn-sc-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: right;
}

.itn-sc-pname {
    font-weight: 700;
    width: 100%!important;
    font-size: 16px!important;
    color: #333;
    text-decoration: none;
}

.itn-sc-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

/* تعداد */
.itn-sc-qty {
    display: flex;
    align-items: center;
    border-radius: 6px;
    height: 40px;
    border-radius: 8px;
    background-color: rgb(242 245 250/1);
    width: 148px;
}

.itn-sc-product-row {
	display: flex;
	flex-direction: row;
	justify-content: space-between;
	width: 100%!important;
	align-content: center;
	align-items: center;

    gap: 12px!important;
}

.itn-sc-qty button {
	border: none !important;
	width: 24px;
	/* height: 19px; */
	cursor: pointer;
	font-weight: bold;
	display: flex;
	justify-content: center;
	align-content: center;
	align-items: center;
	padding: 0px;
	background-color: transparent !important;
	color: rgb(140, 136, 136) !important;
	padding: 0px 16px !important;
}

.itn-qty-remove {
    width: unset!important;
    padding: 0px!important;
}

.itn-qty-input {
    width: 40px;
    height: 32px;
    font-size: 14px;
    text-align: center;
    border: none!important;
    border-radius: 4px;
    background: white!important;
}

/* قیمت */
.itn-sc-price {
    font-weight: 600;
    font-size: 14px;
    color: #007cba;
    display: flex;
    flex-direction: column!important;
    gap: 0px;
    position: relative;
}

.itn-sc-price-row {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 0px;
	justify-content: left;
}
.itn-sc-btn.itn-sc-btn-checkout {
	font-size: 14px!important;
	font-weight: bold!important;
}
.itn-sc-regular-price {
    text-decoration: line-through;
    color: #000;
    font-size: 14px;
}
.itn-sc-regular-price.has-discount bdi{
     text-decoration: line-through;
    color: #888181;
    font-size: 10px!important;
}

.itn-sc-regular-price.has-discount{
     text-decoration: line-through;
    color: #888181;
    font-size: 10px!important;
}

.itn-sc-sale-price {
    color: #e54e4e;
    font-weight: 600;
    font-size: 14px;
    text-align: end!important;
}

.itn-sc-discount-percentage {
	background-color: #e54e4e;
	color: white;
	font-size: 10px;
	padding: 0px 4px;
	border-radius: 24px 24px 24px 0px !important;
	margin-right: 6px;
	font-weight: 600;
	width: 28px;
	align-items: center;
	display: flex;
	justify-content: center;
}

.itn-sc-remove-icon {
	display: flex;
	justify-content: center;
	align-content: center;
	align-items: center;
}

/* حذف محصول */
.itn-sc-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background-color: transparent!important;
    border-radius: 0px;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}



.itn-sc-remove-icon svg {
    width: 16px;
    height: 16px;
    fill: #e54e4e;
}





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

.itn-qty-input {
    -moz-appearance: textfield;
}


.xoo-wsc-products.xoo-wsc-pattern-row {
	gap: 12px;
	display: flex;
	flex-direction: column;
	margin-bottom: 60px;
}

@media (max-width: 768px) {
    .itn-sidecart {
        width: 100% !important;
    }
    
   
}


/* استایل toast حذف محصول - با آیکون تیک سبز */
.itn-delete-toast {
    position: fixed;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s;
    max-width: 420px;
    width: 100%;
    background-color: #ffffff;
    color: #333333;
    border: 1px solid #d1fae5;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 16px;
    display: flex;
    align-items: center;
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box; /* مهم برای محاسبه درست عرض */
}

.itn-delete-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* آیکون تیک سبز */
.itn-delete-toast .toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background-color: #d1fae5;
    color: #10b981;
    border-radius: 50%;
}

/* متن toast */
.itn-delete-toast .toast-message {
    margin-right: 16px;
    flex-grow: 1;
    font-weight: 500;
}

/* دکمه بستن */
.itn-delete-toast .toast-close {
    margin-left: auto;
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #9ca3af;
    transition: all 0.2s;
}

.itn-delete-toast .toast-close:hover {
    background-color: #f3f4f6;
    color: #1f2937;
}

/* دسکتاپ: پایین-راست با حداکثر عرض 420px */
@media (min-width: 768px) {
    .itn-delete-toast {
        bottom: 30px;
        right: 30px;
        width: auto; /* اجازه می‌ده max-width کار کنه */
    }
}

/* موبایل: بالا-وسط با عرض 90% */
@media (max-width: 767px) {
    .itn-delete-toast {
        top: 20px;
        left: 50%;
        width: 90%;                    /* عرض دقیق 90% */
        max-width: none;               /* حذف محدودیت max-width در موبایل */
        transform: translateY(20px) translateX(-50%);
    }
    .itn-delete-toast.show {
        transform: translateY(0) translateX(-50%);
    }
}