/* Attary Alibaba Price Search — frontend styles (RTL), v2 */
.aas-search-box {
    max-width: 860px;
    margin: 24px auto;
    padding: 0 12px;
    direction: rtl;
    text-align: right;
    font-family: inherit;
}

.aas-search-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.aas-search-input {
    flex: 1 1 320px;
    width: 100%;
    padding: 14px 18px;
    font-size: 16px;
    border: 2px solid #d8dee6;
    border-radius: 10px;
    background: #fff;
    color: #222;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
}

.aas-search-input:focus {
    border-color: #2e9e5b;
    box-shadow: 0 0 0 3px rgba(46, 158, 91, .15);
}

.aas-instock-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #444;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.aas-instock-label input {
    width: 16px;
    height: 16px;
    accent-color: #2e9e5b;
    cursor: pointer;
}

.aas-status {
    min-height: 20px;
    font-size: 13px;
    color: #777;
    margin-bottom: 6px;
}

.aas-table-wrap {
    overflow-x: auto;
    border: 1px solid #e3e8ee;
    border-radius: 10px;
    background: #fff;
}

.aas-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.aas-table thead th {
    background: #f4f7fa;
    color: #333;
    font-weight: 600;
    text-align: right;
    padding: 12px 14px;
    border-bottom: 2px solid #e3e8ee;
    white-space: nowrap;
}

.aas-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid #eef2f6;
    vertical-align: middle;
}

.aas-table tbody tr:last-child td {
    border-bottom: none;
}

.aas-table tbody tr:hover {
    background: #f9fbfd;
}

.aas-col-name {
    max-width: 420px;
}

.aas-cat {
    display: inline-block;
    margin-right: 8px;
    padding: 2px 10px;
    font-size: 11.5px;
    color: #556;
    background: #eef1f5;
    border-radius: 999px;
    white-space: nowrap;
}

.aas-sku {
    display: block;
    font-size: 11.5px;
    color: #999;
    margin-top: 3px;
}

.aas-col-price {
    white-space: nowrap;
    color: #1a7a3d;
    font-weight: 700;
}

.aas-col-stock {
    white-space: nowrap;
}

.aas-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
}

.aas-in-stock {
    background: #e6f6ec;
    color: #1a7a3d;
    border: 1px solid #bfe6cd;
}

.aas-out-stock {
    background: #fdeaea;
    color: #b02a2a;
    border: 1px solid #f2c6c6;
}

.aas-col-buy {
    white-space: nowrap;
}

.aas-buy-btn {
    padding: 8px 18px;
    font-size: 13.5px;
    font-weight: 600;
    color: #fff;
    background: #2e9e5b;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background .2s;
}

.aas-buy-btn:hover {
    background: #268a4e;
}

.aas-buy-btn:disabled {
    opacity: .6;
    cursor: wait;
}

.aas-buy-btn.aas-added {
    background: #1a7a3d;
}

.aas-unavailable {
    color: #bbb;
}

.aas-empty {
    padding: 28px 16px;
    text-align: center;
    color: #777;
    font-size: 15px;
    background: #fff;
    border: 1px dashed #d8dee6;
    border-radius: 10px;
}

.aas-more-btn {
    display: block;
    margin: 14px auto 0;
    padding: 10px 28px;
    font-size: 14px;
    color: #2e9e5b;
    background: #fff;
    border: 2px solid #2e9e5b;
    border-radius: 999px;
    cursor: pointer;
    transition: background .2s, color .2s;
}

.aas-more-btn:hover {
    background: #2e9e5b;
    color: #fff;
}

/* Toast notice */
.aas-notice {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    max-width: 320px;
    padding: 14px 20px;
    font-size: 14px;
    color: #1a3d28;
    background: #e6f6ec;
    border: 1px solid #bfe6cd;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .12);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .25s, transform .25s;
    pointer-events: none;
}

.aas-notice-show {
    opacity: 1;
    transform: translateY(0);
}

.aas-notice-error {
    color: #7a1a1a;
    background: #fdeaea;
    border-color: #f2c6c6;
}

@media (max-width: 600px) {
    .aas-table {
        font-size: 13.5px;
    }
    .aas-cat,
    .aas-sku {
        display: none;
    }
    .aas-buy-btn {
        padding: 6px 12px;
        font-size: 12.5px;
    }
}

/* ---- v4: multi-source rows + qty combo ---- */
.aas-row-moj .aas-col-name,
.aas-row-moj .aas-col-price { color: #5b3a1e; }
.aas-row-moj .aas-badge.aas-in-stock { background: #f3e9dd; color: #5b3a1e; }
.aas-qty {
    width: 52px;
    padding: 4px 6px;
    margin-left: 8px;
    border: 1px solid #d5dbe0;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
}
.aas-price-suffix { color: #888; font-size: 12px; margin-right: 4px; }


/* ---- v4.2: responsive, no horizontal scroll ---- */
.aas-table-wrap { overflow-x: hidden; }
.aas-table { table-layout: fixed; width: 100%; }
.aas-table th, .aas-table td {
    word-break: break-word;
    overflow-wrap: anywhere;
    padding: 8px 6px;
    font-size: 13px;
}
.aas-table .aas-col-name { width: auto; }
.aas-col-price { white-space: nowrap; }
.aas-col-stock { width: 70px; text-align: center; }
.aas-col-buy { width: 150px; text-align: center; }
.aas-buy-btn { white-space: nowrap; }
.aas-qty { width: 46px; margin-left: 4px; }

@media (max-width: 782px) {
    .aas-table th, .aas-table td { font-size: 12px; padding: 6px 4px; }
    .aas-col-stock { width: 56px; }
    .aas-col-buy { width: 112px; }
    .aas-buy-btn {
        display: block;
        width: 100%;
        margin-top: 4px;
        padding: 6px 4px;
        font-size: 12px;
        text-align: center;
    }
    .aas-qty {
        display: block;
        width: 100%;
        margin: 0 0 2px;
        box-sizing: border-box;
        text-align: center;
    }
}

/* ---- v4.2.1 FINAL: kill horizontal scroll everywhere (overrides all base rules) ---- */
.aas-search-box .aas-table-wrap {
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    max-width: 100% !important;
}
.aas-search-box .aas-table {
    table-layout: fixed !important;
    width: 100% !important;
    max-width: 100% !important;
}
.aas-search-box .aas-table * {
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
}
.aas-search-box .aas-table thead th,
.aas-search-box .aas-table tbody td {
    padding: 10px 8px !important;
    box-sizing: border-box !important;
}
.aas-search-box .aas-col-name {
    width: auto !important;
    max-width: none !important;
}
.aas-search-box .aas-col-price {
    width: 110px !important;
    white-space: normal !important;
}
.aas-search-box .aas-col-stock {
    width: 64px !important;
}
.aas-search-box .aas-col-buy {
    width: 150px !important;
}
.aas-search-box .aas-buy-btn {
    white-space: normal !important;
    text-align: center;
}
.aas-search-box .aas-cat {
    white-space: normal !important;
    display: inline-block;
    margin: 4px 0 0;
}
.aas-search-box .aas-sku {
    display: block;
}

/* mobile: stack columns per-row, zero overflow */
@media (max-width: 640px) {
    .aas-search-box .aas-col-stock {
        width: 52px !important;
    }
    .aas-search-box .aas-col-buy {
        width: 96px !important;
    }
    .aas-search-box .aas-qty {
        width: 100% !important;
        margin: 0 0 4px !important;
        display: block;
        box-sizing: border-box;
    }
    .aas-search-box .aas-buy-btn {
        width: 100% !important;
        display: block !important;
        box-sizing: border-box;
        margin: 0 !important;
        padding: 7px 4px !important;
        font-size: 12px !important;
    }
    .aas-search-box .aas-table thead th,
    .aas-search-box .aas-table tbody td {
        padding: 8px 5px !important;
        font-size: 12px !important;
    }
}


/* ---- v4.3: name layout (two lines), dark category badge, green buy ---- */
.aas-search-box .aas-col-name {
    line-height: 1.7;
}
/* category = second line, dark gray highlight with white text */
.aas-search-box .aas-cat {
    display: inline-block !important;
    margin: 6px 0 0 !important;
    padding: 3px 12px !important;
    font-size: 12px !important;
    font-weight: 600;
    color: #fff !important;
    background: #4a4f57 !important;
    border-radius: 6px !important;
    white-space: normal !important;
    line-height: 1.6;
}
.aas-search-box .aas-sku { display: none !important; }

/* buy button: green, bold white text, same width as qty input */
.aas-search-box .aas-buy-btn {
    background: #1a7a3d !important;
    color: #fff !important;
    font-weight: 700 !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer;
}
.aas-search-box .aas-buy-btn:hover {
    background: #14632f !important;
}
.aas-search-box .aas-buy-btn.aas-added {
    background: #0e4f24 !important;
}

/* qty input: taller, aligned with button */
.aas-search-box .aas-qty {
    height: 36px;
    border: 1px solid #d5dbe0 !important;
    border-radius: 6px !important;
    padding: 0 8px !important;
    font-size: 14px;
    -moz-appearance: textfield;
}
.aas-search-box .aas-qty::-webkit-outer-spin-button,
.aas-search-box .aas-qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
