/* ==========================================================
   GLOBAL OPTIONS
========================================================== */

.smt-discounts-global-options {
    background: #fafafb;
    border: 1px solid #e5e6ea;
    padding: 18px 20px;
    border-radius: 12px;
    margin-bottom: 22px;
}

/* ==========================================================
   TABLE
========================================================== */

@media (max-width: 770px) {
    .smt-discounts-table {
        display: block;
        overflow-x: auto;
    }
}

.smt-discounts-table th {
    font-weight: 600;
    font-size: 13.5px;
    padding: 12px 10px;
    background: #f8f9fb;
}

.smt-discounts-table td {
    padding: 12px 10px;
    vertical-align: middle;
}

.smt-discounts-table tr:hover td {
    background: #f3f6ff;
}

.smt-discounts-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

/* ==========================================================
   STATUS
========================================================== */

.smt-status {
    font-weight: 600;
    font-size: 13px;
}

.smt-status.smt-on {
    color: #1e9f4d;
}

.smt-status.smt-off {
    color: #a0a0aa;
}

/* ==========================================================
   FORM INPUTS
========================================================== */

#smt-discounts-form input[type="text"],
#smt-discounts-form input[type="number"],
#smt-discounts-form input[type="date"],
#smt-discounts-form input[type="time"],
#smt-discounts-form select,
#smt-promo-form input[type="text"],
#smt-promo-form input[type="number"],
#smt-promo-form input[type="date"],
#smt-promo-form select {
    width: 100%;
    border-radius: 10px;
    border: 1px solid #d4d6dd;
    background: #f9f9fb;
    padding: 10px 12px;
    font-size: 14px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

#smt-discounts-form input:focus,
#smt-discounts-form select:focus,
#smt-promo-form input:focus,
#smt-promo-form select:focus {
    border-color: #4e8cff;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(78,140,255,0.15);
}

#smt-discounts-form label,
#smt-promo-form label {
    display: block;
    font-weight: 500;
    margin: 14px 0 6px;
	min-width: 40px;
}


/* ==========================================================
   ROWS / GROUPS
========================================================== */

.smt-row {
    display: flex;
    gap: 16px;
}

.smt-input-priority {
    max-width: 100px;
    flex-shrink: 0;
}


/* ==========================================================
   BADGE PREVIEW
========================================================== */

.smt-badge-preview-wrap {
    margin-top: 10px;
}

.smt-badge-preview {
    display: inline-block;
    margin-left: 10px;
    padding: 4px 10px;
	border: 1px solid #ddd;
    border-radius: 8px;
    background: transparent;
    color: #111;
    font-size: 13px;
}


/* ==========================================================
   RULE ROWS
========================================================== */

/* -------- RULE ROW -------- */
.smt-discount-rule-row {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 14px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* -------- MAIN LINE (TYPE / OPERATOR / INPUT / DELETE) -------- */
.smt-rule-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.smt-rule-main select {
    min-width: 130px;
}

.smt-rule-main .smt-rule-autocomplete {
    flex: 1;
    min-width: 200px;
}

.smt-discounts-remove-rule {
    margin-bottom: 12px !important;
}

/* -------- TAGS AREA -------- */
.smt-rule-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    max-width: 100%;
}

/* Fixed size tags */
.smt-rule-tags .smt-tag {
    width: 125px;
    height: 44px;
    background: #f1f1f1;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    line-height: 1.2;
    position: relative;
    overflow: hidden;
    display: flex !important;
    align-items: center;
}

span.smt-tag b {
    color: red !important;
}

/* text clamp */
.smt-rule-tags .smt-tag {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* remove tag */
.smt-rule-tags .smt-tag b {
    position: absolute;
    top: 2px;
    right: 4px;
    cursor: pointer;
    font-weight: bold;
    color: #666;
}

/* -------- LOGIC OPERATOR (BOTTOM CENTER) -------- */
.smt-rule-logic {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 12px;
}

.smt-rule-logic select {
    min-width: 70px;
}

.smt-rule-logic select {
    width: 25% !important;
}

/* wrapper price input */
.smt-rule-main {
    position: relative;
}

/* price input */
.smt-rule-main input.smt-rule-autocomplete[type="number"] {
    padding-right: 36px;
}

/* currency badge */
.smt-rule-main input.smt-rule-autocomplete[type="number"]::after {
    content: attr(data-currency);
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #666;
    pointer-events: none;
}

.smt-price-wrap {
    position: relative;
    display: inline-block;
    width: 180px;
}

.smt-price-wrap input {
    width: 100%;
    padding-right: 36px;
}

.smt-price-currency {
    position: absolute;
    right: 20px;
    top: 25%;
    font-size: 12px;
    color: #666;
    pointer-events: none;
}

/* ==========================================================
   USER LEVELS ADMIN
========================================================== */

.smt-ul-admin-block {
    padding: 4px 0;
}

.smt-ul-admin-body {
    margin-top: 16px;
}

.smt-ul-admin-label {
    display: block;
    font-weight: 500;
    font-size: 13.5px;
    margin-bottom: 6px;
    margin-top: 14px;
}

.smt-ul-admin-hint {
    font-size: 12.5px;
    color: #667085;
    margin-top: 12px;
}

.smt-ul-period-input {
    width: 120px;
    border-radius: 8px;
    border: 1px solid #d4d6dd;
    padding: 8px 10px;
    font-size: 14px;
    margin-bottom: 16px;
}

.smt-ul-levels-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr 92px;
    gap: 10px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 0 4px 6px;
    border-bottom: 1px solid #e9edf5;
    margin-bottom: 8px;
}

.smt-ul-level-row-admin {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr 92px;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}

.smt-ul-level-row-admin input,
.smt-ul-level-row-admin select {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #d4d6dd;
    padding: 8px 10px;
    font-size: 14px;
    background: #f9f9fb;
}

.smt-wrap #smt-ul-add-level {
    display: block;
    margin-bottom: 15px;
}

/* ==========================================================
   PROMO BADGE SETTINGS
========================================================== */

.smt-promo-badge-settings {
    padding: 4px 0 16px;
}

.smt-promo-badge-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 16px;
}

.smt-promo-badge-row > div {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.smt-promo-badge-row label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.smt-promo-badge-row input[type="text"] {
    border-radius: 8px;
    border: 1px solid #d4d6dd;
    padding: 8px 10px;
    font-size: 14px;
    width: 160px;
    background: #f9f9fb;
}

.smt-promo-badge-preview {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
}

/* ==========================================================
   PROMO MODAL - WIDE
========================================================== */

.smt-modal-inner--wide {
    width: 720px;
}

/* ==========================================================
   PROMO SECTION HEADER
========================================================== */

.smt-promo-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 20px 0 10px;
}

.smt-promo-section-header label {
    font-weight: 600;
    font-size: 14px;
    margin: 0;
}

/* ==========================================================
   PROMO CONDITION / REWARD ROWS
========================================================== */

.smt-promo-condition-row,
.smt-promo-reward-row {
    border: 1px solid #dde1ea;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    background: #fafbfd;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.smt-promo-row-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.smt-promo-row-header select {
    border-radius: 8px;
    border: 1px solid #d4d6dd;
    padding: 7px 10px;
    font-size: 13px;
    background: #fff;
}

.smt-promo-row-header label {
    font-size: 13px;
    color: #374151;
    font-weight: 500;
    margin: 0;
}

.smt-promo-row-header input[type="number"] {
    border-radius: 8px;
    border: 1px solid #d4d6dd;
    padding: 7px 10px;
    font-size: 13px;
    background: #fff;
}

.smt-promo-remove-row {
    margin-left: auto;
}

.smt-promo-autocomplete {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #d4d6dd;
    padding: 8px 10px;
    font-size: 13px;
    background: #fff;
}

.smt-promo-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ==========================================================
   MY ACCOUNT - USER LEVEL DISPLAY (admin references only)
========================================================== */

/* Frontend styles are in discounts-frontend.css */

.smt-ul-badge {
    display: inline-block;
    background: linear-gradient(135deg, #4e6ef5, #7aa9ff);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    padding: 5px 14px;
    border-radius: 999px;
}

/* ==========================================================
   FRONTEND: PROMO BLOCKS
========================================================== */

.smt-promo-notices,
.smt-promo-product-info {
    margin-bottom: 20px;
}

.smt-promo-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: #fafbfd;
    font-size: 14px;
}

.smt-promo-block.smt-promo-active {
    border-color: #4e8cff;
    background: #f0f5ff;
}

.smt-promo-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 15px;
}

.smt-promo-conditions-row,
.smt-promo-rewards-row {
    display: flex;
    gap: 6px;
    font-size: 13px;
}

.smt-promo-label {
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}

.smt-promo-desc { color: #6b7280; }

.smt-promo-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.smt-promo-add-reward {
    background: #4e8cff !important;
    color: #fff !important;
    border-color: #4e8cff !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
}

.smt-promo-add-reward.smt-promo-added {
    background: #2e7d32 !important;
    border-color: #2e7d32 !important;
}

.smt-promo-reward-added {
    font-size: 13px;
    color: #2e7d32;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.smt-badge.smt-promo-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.smt-promo-discount-pct {
    min-width: 90px;
}
