/* سواچ‌های مربعی خاکستری */
.maty-variations {
    display: grid;
    gap: 14px;
}
.maty-attr {
    display: grid;
    gap: 8px;
}
.maty-attr-label {
    font-weight: 600;
    font-size: 14px;
}
.maty-swatch-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.maty-swatch {
    background: #f2f2f2;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    transition: none;
    min-width: 44px;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #333 !important;
    text-decoration: none !important;
    flex-direction: column;
}
.maty-swatch.selected {
    background: #E5F7FB; /*#e9eefc;*/
    border-color: #1B9FBB; /*#5b8def*/
}

/* سواچ‌های غیرفعال (ناموجود) */
.maty-swatch.disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    background: #f8f8f8 !important;
    border-color: #e5e5e5 !important;
    position: relative;
    overflow: hidden;
}

.maty-swatch.disabled::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #ccc;
    transform: rotate(-15deg);
}

.maty-swatch-out-of-stock {
    display: none;
    font-size: 10px;
    color: #999;
    margin-top: 2px;
}

.maty-swatch.disabled .maty-swatch-out-of-stock {
    display: none;
}

.maty-swatch .maty-swatch-title {
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
    color: #333 !important;
}

/* ردیف دکمه + باکس تعداد: کنار هم در یک سطر */
.maty-add-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 8px;
    width: 100%;
}
.maty-add-wrap {
    flex: 1 1 auto;
    width: 100%;
}

/* دکمه افزودن / مشاهده سبد خرید */
.maty-add-btn {
    position: relative;
    width: 100%;
    background: #1B9FBB !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 10px;
    padding: 12px 16px;
    font-weight: 700;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    overflow: hidden;
    box-shadow: none !important;
    transition: none !important;
    text-decoration: none !important;
    cursor: pointer;
}
.maty-add-btn.is-in-cart {
    background: #1B9FBB !important;
}
.maty-add-btn.loading {
    background: #1B9FBB !important;
}
.maty-add-btn.loading .maty-add-label {
    opacity: 0.5 !important; /* محو شدن متن موقع لود */
}
.maty-add-btn.maty-disabled,
.maty-add-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    background: #1B9FBB !important;
}

/* تکان خوردن دکمه در انتخاب ناقص */
.maty-add-btn.shaking {
    animation: maty-shake .45s linear;
}
@keyframes maty-shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* لودر نواری بالای دکمه */
.maty-loader-bar {
    pointer-events: none;
    position: absolute;
    top: 0;
    left: -40%;
    width: 40%;
    height: 3px;
    background: rgba(255, 255, 255, .9);
    opacity: 0;
}
.maty-add-btn.loading .maty-loader-bar {
    opacity: 1;
    animation: maty-linear 1.1s infinite ease;
}
@keyframes maty-linear {
    0% { left: -40%; }
    50% { left: 30%; }
    100% { left: 100%; }
}

/* باکس تعداد – کنار دکمه، نه زیرش */
.maty-qty {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e1e1e1;
    border-radius: 10px;
    background: #f9f9f9;
    padding: 0 2px;
    height: 44px;
    min-width: 110px;
    position: relative;
}
.maty-qty.hidden {
    display: none;
}
.maty-qty button {
    width: 38px;
    height: 40px;
    font-size: 18px;
    border: 0;
    background: transparent;
    cursor: pointer;
    user-select: none;
    transition: none;
    color: #333 !important;
}
.maty-qty button:hover,
.maty-qty button:focus {
    background: transparent !important;
    box-shadow: none !important;
    color: #333 !important;
}
.maty-qty-val {
    width: 40px;
    text-align: center;
    font-weight: 700;
    position: relative;
    color: #333 !important;
}

/* حالت لودینگ برای باکس تعداد - فقط کم‌رنگ شدن */
.maty-qty.loading .maty-qty-val,
.maty-qty.loading button {
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

/* جلوگیری کامل از hover روی تمام دکمه‌ها */
.maty-add-btn:hover,
.maty-add-btn:focus,
.maty-add-btn:active {
    background: #1B9FBB !important;
    color: #fff !important;
    box-shadow: none !important;
    transform: none !important;
    text-decoration: none !important;
}

.maty-swatch:hover,
.maty-swatch:focus,
.maty-swatch:active {
    background: #f2f2f2 !important;
    border-color: #e1e1e1 !important;
    color: #333 !important;
    text-decoration: none !important;
    transform: none !important;
}

.maty-swatch.selected:hover,
.maty-swatch.selected:focus,
.maty-swatch.selected:active {
    background: #E5F7FB !important;
    border-color: #1B9FBB !important;
    color: #333 !important;
}

/* حالت hover برای سواچ‌های غیرفعال */
.maty-swatch.disabled:hover,
.maty-swatch.disabled:focus,
.maty-swatch.disabled:active {
    background: #f8f8f8 !important;
    border-color: #e5e5e5 !important;
    transform: none !important;
    cursor: not-allowed !important;
}

.maty-qty button:hover,
.maty-qty button:focus,
.maty-qty button:active {
    background: transparent !important;
    color: #333 !important;
    transform: none !important;
}