:root {
    --maofw-ink: #111827;
    --maofw-muted: #6b7280;
    --maofw-line: #e5e7eb;
    --maofw-soft: #f8fafc;
    --maofw-brand: #2563eb;
    --maofw-brand-dark: #1d4ed8;
    --maofw-success: #059669;
    --maofw-success-soft: #ecfdf5;
    --maofw-success-line: #34d399;
    --maofw-danger: #dc2626;
    --maofw-danger-soft: #fef2f2;
    --maofw-danger-line: #f87171;
    --maofw-warning: #d97706;
    --maofw-warning-soft: #fffbeb;
    --maofw-warning-line: #f59e0b;
    --maofw-shadow: 0 14px 35px rgba(15, 23, 42, .08);
}

.maofw-offer-box {
    border: 1px solid var(--maofw-line);
    border-radius: 18px;
    margin: 18px 0;
    background: linear-gradient(180deg, #fff, var(--maofw-soft));
    box-shadow: var(--maofw-shadow);
    color: var(--maofw-ink);
    overflow: hidden;
}

.maofw-offer-box__head {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 18px 20px;
    cursor: pointer;
    list-style: none;
    transition: background .18s ease, box-shadow .18s ease;
}

.maofw-offer-box__head::-webkit-details-marker {
    display: none;
}

.maofw-offer-box__head:hover,
.maofw-offer-box[open] .maofw-offer-box__head {
    background: #fff;
}

.maofw-offer-box__intro {
    display: block;
    min-width: 0;
}

.maofw-offer-box__title {
    display: block;
    margin: 0 0 4px;
    font-size: 1.18rem;
    font-weight: 800;
    color: #0f2742;
}

.maofw-offer-box__copy {
    display: block;
    color: var(--maofw-ink);
    line-height: 1.45;
}

.maofw-offer-box__toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 999px;
    background: #eff6ff;
    color: var(--maofw-brand);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .02em;
    padding: 8px 11px;
    text-transform: uppercase;
    white-space: nowrap;
}

.maofw-offer-box__toggle::after {
    content: '';
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-1px);
    transition: transform .18s ease;
}

.maofw-offer-box[open] .maofw-offer-box__toggle::after {
    transform: rotate(225deg) translateY(-1px);
}

.maofw-offer-box[open] .maofw-offer-box__toggle {
    color: #1e40af;
}

.maofw-offer-box[open] .maofw-offer-box__toggle {
    font-size: 0;
}

.maofw-offer-box[open] .maofw-offer-box__toggle::before {
    content: 'Close';
    font-size: 12px;
}

.maofw-offer-box__body {
    border-top: 1px solid var(--maofw-line);
    padding: 24px 20px 28px;
    background: rgba(248, 250, 252, .76);
}

.maofw-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: #eff6ff;
    color: var(--maofw-brand);
    flex: 0 0 auto;
}

.maofw-icon svg {
    width: 24px;
    height: 24px;
}

.maofw-offer-form label {
    display: block;
    font-weight: 700;
    margin-bottom: 5px;
}

.maofw-offer-form input,
.maofw-offer-form textarea {
    width: 100%;
    max-width: 420px;
    border-radius: 10px;
}

.maofw-offer-form textarea {
    min-height: 110px;
}

.maofw-button.button,
.maofw-button {
    background: var(--maofw-brand) !important;
    border-color: var(--maofw-brand) !important;
    color: #fff !important;
    border-radius: 999px !important;
    font-weight: 700 !important;
    padding: .65rem 1.1rem !important;
    line-height: 1 !important;
    text-decoration: none !important;
}

.maofw-button:hover {
    background: var(--maofw-brand-dark) !important;
}

.maofw-notice {
    border-radius: 12px;
    padding: 12px 14px;
}

.maofw-notice--info {
    background: #eff6ff;
    color: #1e3a8a;
}

.maofw-muted {
    color: var(--maofw-muted);
}

/* Prominent offer result notices. Supports standard WooCommerce and common theme wrappers. */
.woocommerce-notices-wrapper .woocommerce-message,
.woocommerce .woocommerce-message,
.message-wrapper .woocommerce-message,
.woocommerce-message.message-wrapper {
    position: relative;
    border: 2px solid var(--maofw-success-line) !important;
    border-left-width: 8px !important;
    border-radius: 16px !important;
    background: var(--maofw-success-soft) !important;
    color: #064e3b !important;
    box-shadow: 0 4px 14px rgba(5, 150, 105, .08) !important;
    font-weight: 700;
    padding: 18px 22px 18px 54px !important;
    margin: 14px auto 18px !important;
    max-width: 1120px;
}

.woocommerce-notices-wrapper .woocommerce-error,
.woocommerce .woocommerce-error,
.message-wrapper .woocommerce-error,
.woocommerce-error.message-wrapper {
    position: relative;
    border: 2px solid var(--maofw-danger-line) !important;
    border-left-width: 8px !important;
    border-radius: 16px !important;
    background: var(--maofw-danger-soft) !important;
    color: #7f1d1d !important;
    box-shadow: 0 4px 14px rgba(220, 38, 38, .08) !important;
    font-weight: 700;
    padding: 18px 22px 18px 54px !important;
    margin: 14px auto 18px !important;
    max-width: 1120px;
}

.woocommerce-notices-wrapper .woocommerce-info,
.woocommerce .woocommerce-info,
.message-wrapper .woocommerce-info,
.woocommerce-info.message-wrapper {
    position: relative;
    border: 2px solid var(--maofw-warning-line) !important;
    border-left-width: 8px !important;
    border-radius: 16px !important;
    background: var(--maofw-warning-soft) !important;
    color: #78350f !important;
    box-shadow: 0 4px 14px rgba(217, 119, 6, .08) !important;
    font-weight: 700;
    padding: 18px 22px 18px 54px !important;
    margin: 14px auto 18px !important;
    max-width: 1120px;
}

.woocommerce-notices-wrapper .woocommerce-message::before,
.woocommerce .woocommerce-message::before,
.message-wrapper .woocommerce-message::before,
.woocommerce-message.message-wrapper::before,
.woocommerce-notices-wrapper .woocommerce-error::before,
.woocommerce .woocommerce-error::before,
.message-wrapper .woocommerce-error::before,
.woocommerce-error.message-wrapper::before,
.woocommerce-notices-wrapper .woocommerce-info::before,
.woocommerce .woocommerce-info::before,
.message-wrapper .woocommerce-info::before,
.woocommerce-info.message-wrapper::before {
    position: absolute !important;
    left: 18px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 24px !important;
    height: 24px !important;
    border-radius: 999px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 15px !important;
    line-height: 1 !important;
    font-weight: 900 !important;
}

.woocommerce-notices-wrapper .woocommerce-message::before,
.woocommerce .woocommerce-message::before,
.message-wrapper .woocommerce-message::before,
.woocommerce-message.message-wrapper::before {
    content: '✓' !important;
    background: var(--maofw-success) !important;
    color: #fff !important;
}

.woocommerce-notices-wrapper .woocommerce-error::before,
.woocommerce .woocommerce-error::before,
.message-wrapper .woocommerce-error::before,
.woocommerce-error.message-wrapper::before {
    content: '!' !important;
    background: var(--maofw-danger) !important;
    color: #fff !important;
}

.woocommerce-notices-wrapper .woocommerce-info::before,
.woocommerce .woocommerce-info::before,
.message-wrapper .woocommerce-info::before,
.woocommerce-info.message-wrapper::before {
    content: '…' !important;
    background: var(--maofw-warning) !important;
    color: #fff !important;
}

.maofw-accepted-notice {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 700;
}

.maofw-accepted-notice__copy {
    color: var(--maofw-text);
}

.woocommerce-message:has(.maofw-accepted-notice),
.woocommerce-notices-wrapper .woocommerce-message:has(.maofw-accepted-notice),
.message-wrapper .woocommerce-message:has(.maofw-accepted-notice) {
    padding-top: 14px !important;
    padding-bottom: 14px !important;
}

.maofw-notice-action-button.button,
.maofw-notice-action-button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    background: var(--maofw-success) !important;
    border: 1px solid var(--maofw-success) !important;
    color: #fff !important;
    border-radius: 10px !important;
    font-weight: 850 !important;
    font-size: 13px !important;
    letter-spacing: .02em;
    padding: 9px 14px !important;
    text-decoration: none !important;
    line-height: 1.1 !important;
    box-shadow: 0 5px 12px rgba(5, 150, 105, .16) !important;
}

.maofw-notice-action-button:hover {
    filter: brightness(.94);
}

.maofw-cart-discount {
    display: inline-flex !important;
    align-items: baseline;
    gap: 4px 7px;
    flex-wrap: wrap;
    white-space: nowrap;
}

.maofw-cart-discount--unit {
    display: inline-grid !important;
    grid-template-columns: 1fr;
    justify-items: start;
    align-items: start;
    gap: 2px;
    line-height: 1.15;
}

.maofw-cart-discount--subtotal {
    justify-content: flex-end;
}

.maofw-cart-discount__was,
.maofw-cart-discount del {
    position: relative;
    color: var(--maofw-muted) !important;
    opacity: .82;
    display: inline-block !important;
    text-decoration-line: line-through !important;
    text-decoration-style: solid !important;
    text-decoration-thickness: 1.5px !important;
    text-decoration-color: currentColor !important;
    background-image: linear-gradient(currentColor, currentColor) !important;
    background-position: 0 52% !important;
    background-repeat: repeat-x !important;
    background-size: 100% 1.5px !important;
}

.maofw-cart-discount__was *,
.maofw-cart-discount del * {
    text-decoration-line: line-through !important;
    text-decoration-thickness: 1.5px !important;
    text-decoration-color: currentColor !important;
}

.maofw-cart-discount__now,
.maofw-cart-discount ins {
    color: #e85d75 !important;
    display: inline-block !important;
    font-weight: 850 !important;
    text-decoration: none !important;
    background: transparent !important;
}

.maofw-cart-discount--unit .maofw-cart-discount__now,
.maofw-cart-discount--unit ins {
    font-size: 13px;
}

.maofw-cart-discount--unit-meta {
    margin-top: 2px;
    font-size: 12px;
}

.maofw-cart-discount--unit-meta .maofw-cart-discount__now,
.maofw-cart-discount--unit-meta ins {
    color: var(--maofw-success) !important;
    font-size: 12px;
}

.maofw-account h2 {
    margin-bottom: 8px;
}

.maofw-offer-list {
    display: grid;
    gap: 14px;
}

.maofw-account-card {
    border: 1px solid var(--maofw-line);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--maofw-shadow);
    padding: 18px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.maofw-account-card h3 {
    margin: 0 0 5px;
}

.maofw-account-card p {
    margin: 0 0 5px;
}

.maofw-account-card__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.maofw-status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .02em;
}

.maofw-status-pill--product {
    background: #ecfdf5;
    color: #047857;
}

.post-type-product .column-maofw_offer_enabled {
    width: 92px;
    text-align: left;
}

.maofw-status-maofw-approved .maofw-status-pill,
.maofw-status-maofw-auto-accepted .maofw-status-pill {
    background: #ecfdf5;
    color: #047857;
}

.maofw-status-maofw-pending .maofw-status-pill {
    background: #fffbeb;
    color: #92400e;
}

.maofw-status-maofw-declined .maofw-status-pill,
.maofw-status-maofw-auto-declined .maofw-status-pill {
    background: #f3f4f6;
    color: #374151;
}

.maofw-empty {
    background: var(--maofw-soft);
    padding: 18px;
    border: 1px dashed var(--maofw-line);
    border-radius: 14px;
}

.maofw-admin-wrap .maofw-admin-card,
.maofw-admin-card {
    background: #fff;
    border: 1px solid var(--maofw-line);
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
    max-width: 960px;
}

.post-type-maofw_offer .column-product {
    width: 22%;
}

.post-type-maofw_offer .column-customer {
    width: 22%;
}

.post-type-maofw_offer .column-status {
    width: 14%;
}

.post-type-maofw_offer .column-actions {
    width: 18%;
}

/* Product panel only: retain native controls and Customizer bridge. */
.maofw-offer-box.maofw-offer-box {
 --maofw-ink:#10140F; --maofw-muted:#596156; --maofw-line:#E1E5DC;
 --maofw-soft:#F4F5EF; --maofw-brand:var(--sg26-lime, #A8DE00);
 --maofw-brand-dark:#10140F; --maofw-on-brand:#10140F; --maofw-accent-soft:#F4F5EF;
 border-radius:10px; background:#fff; box-shadow:none; font-family:inherit;
}
.maofw-offer-box.maofw-offer-box .maofw-offer-box__head { grid-template-columns:32px minmax(0,1fr) auto; gap:12px; padding:16px; border:0; background:#fff; box-shadow:none; }
.maofw-offer-box.maofw-offer-box .maofw-offer-box__head:focus:not(:focus-visible) { outline:none; }
.maofw-offer-box.maofw-offer-box .maofw-offer-box__head:focus-visible { outline:2px solid var(--maofw-brand); outline-offset:-4px; box-shadow:inset 0 0 0 1px var(--maofw-ink); }
.maofw-offer-box.maofw-offer-box .maofw-offer-box__title { font-size:16px; font-weight:700; line-height:1.35; color:var(--maofw-ink); margin-bottom:4px; }
.maofw-offer-box.maofw-offer-box .maofw-offer-box__copy { color:var(--maofw-muted); font-size:13px; line-height:1.5; }
.maofw-offer-box.maofw-offer-box .maofw-icon { width:32px; height:32px; border-radius:8px; background:var(--maofw-accent-soft); color:var(--maofw-ink); }
.maofw-offer-box.maofw-offer-box .maofw-icon svg { display:block; width:24px; height:24px; }
.maofw-offer-box.maofw-offer-box .maofw-offer-box__toggle { color:var(--maofw-ink); background:var(--maofw-accent-soft); border-radius:6px; width:auto; padding:8px 10px; }
.maofw-offer-box.maofw-offer-box .maofw-offer-box__head:hover .maofw-offer-box__toggle { background:var(--maofw-brand); color:var(--maofw-ink); }
.maofw-offer-box.maofw-offer-box .maofw-offer-box__body { padding:18px 16px; background:#fff; border-top:1px solid var(--maofw-line); }
.maofw-offer-box.maofw-offer-box .maofw-offer-form { margin:0; }
.maofw-offer-box.maofw-offer-box .maofw-offer-form p { margin:0 0 16px; }
.maofw-offer-box.maofw-offer-box .maofw-offer-form label { font-family:inherit; font-size:13px; font-weight:650; line-height:1.5; letter-spacing:0; margin:0 0 6px; }
.maofw-offer-box.maofw-offer-box .maofw-offer-form .optional { font-weight:400; color:var(--maofw-muted); }
.maofw-offer-box.maofw-offer-box .maofw-offer-form input:not([type=hidden]),
.maofw-offer-box.maofw-offer-box .maofw-offer-form textarea { box-sizing:border-box; width:100%; max-width:100%; min-width:0; margin:0; padding:10px 12px; min-height:44px; border-radius:10px; font-family:inherit; font-size:16px; line-height:1.5; box-shadow:none; }
.maofw-offer-box.maofw-offer-box .maofw-offer-form textarea { min-height:96px; resize:vertical; }
.maofw-offer-box.maofw-offer-box .maofw-offer-form input:focus-visible,
.maofw-offer-box.maofw-offer-box .maofw-offer-form textarea:focus-visible,
.maofw-offer-box.maofw-offer-box .maofw-button:focus-visible { outline:2px solid var(--maofw-ink); outline-offset:2px; box-shadow:0 0 0 4px var(--maofw-brand); }
.maofw-offer-box.maofw-offer-box .maofw-button { background:var(--maofw-brand)!important; border-color:var(--maofw-brand)!important; color:#10140F!important; border-radius:10px!important; margin:0!important; padding:12px 16px!important; font-family:inherit; font-size:14px; font-weight:700; line-height:1.3!important; min-height:44px; box-shadow:none!important; }
.maofw-offer-box.maofw-offer-box .maofw-button:hover { background:var(--maofw-accent-soft)!important; border-color:var(--maofw-ink)!important; color:var(--maofw-ink)!important; }
.maofw-offer-box.maofw-offer-box .maofw-notice--info { background:var(--maofw-soft); color:var(--maofw-ink); border:1px solid var(--maofw-line); border-radius:10px; }
@media(max-width:480px) {
 .maofw-offer-box.maofw-offer-box .maofw-offer-box__head { grid-template-columns:32px minmax(0,1fr); padding:14px; gap:10px; }
 .maofw-offer-box.maofw-offer-box .maofw-offer-box__toggle { grid-column:2; justify-self:start; width:auto; }
 .maofw-offer-box.maofw-offer-box .maofw-offer-box__body { padding:16px 14px; }
}

@media (max-width: 640px) {
    .maofw-offer-box__head {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .maofw-offer-box__toggle {
        grid-column: 1 / -1;
        justify-content: center;
        width: 100%;
    }

    .maofw-account-card {
        display: block;
    }

    .maofw-account-card__actions {
        justify-content: flex-start;
        margin-top: 12px;
    }
}
