.avscode-gc-box {
    margin: 0 0 var(--avscode-gc-box-margin, 16px);
    padding: var(--avscode-gc-box-padding, 14px);
    border: 1px solid var(--avscode-gc-box-border, #eadbd0);
    border-radius: var(--avscode-gc-box-radius, 10px);
    background: var(--avscode-gc-box-bg, #faf7f3);
    color: var(--avscode-gc-box-text, #2b2b2b);
    box-shadow: none;
    box-sizing: border-box;
}

.avscode-gc-box *,
.avscode-gc-box *::before,
.avscode-gc-box *::after {
    box-sizing: border-box;
}

.avscode-gc-box h3 {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.3;
    color: var(--avscode-gc-box-text, #2b2b2b);
    text-transform: none;
    letter-spacing: .01em;
}

.avscode-gc-box[data-avscode-gc-show-title="no"] h3 {
    display: none;
}

.avscode-gc-apply-form,
.avscode-gc-remove-form {
    display: flex;
    gap: var(--avscode-gc-form-gap, 8px);
    align-items: stretch;
    width: 100%;
}

.avscode-gc-box[data-avscode-gc-layout="stacked"] .avscode-gc-apply-form,
.avscode-gc-box[data-avscode-gc-layout="stacked"] .avscode-gc-remove-form {
    flex-direction: column;
}

.avscode-gc-apply-form input[type="text"] {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 40px;
    height: 40px;
    border-radius: var(--avscode-gc-input-radius, 3px);
    padding: 8px 12px;
    border: 1px solid var(--avscode-gc-box-border, #eadbd0);
    background: var(--avscode-gc-input-bg, #ffffff);
    color: var(--avscode-gc-input-text, #222222);
    box-shadow: none;
}

.avscode-gc-apply-form input[type="text"]::placeholder {
    color: var(--avscode-gc-box-muted, #7a6b62);
    opacity: .85;
}

.avscode-gc-box .avscode-gc-button.button,
.avscode-gc-apply-form .avscode-gc-button.button,
.avscode-gc-remove-form .avscode-gc-button.button,
.avscode-gc-box button.avscode-gc-button {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto;
    min-height: var(--avscode-gc-button-height, 40px) !important;
    height: var(--avscode-gc-button-height, 40px) !important;
    max-height: var(--avscode-gc-button-height, 40px) !important;
    border-radius: var(--avscode-gc-button-radius, 3px) !important;
    padding: 0 18px !important;
    font-family: inherit !important;
    font-size: var(--avscode-gc-button-font-size, 12px) !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    letter-spacing: .04em !important;
    text-transform: uppercase !important;
    white-space: nowrap;
    background: var(--avscode-gc-button-bg, #87452c) !important;
    color: var(--avscode-gc-button-text, #ffffff) !important;
    border: 1px solid var(--avscode-gc-button-bg, #87452c) !important;
    box-shadow: none !important;
    text-decoration: none !important;
    cursor: pointer;
}

.avscode-gc-box[data-avscode-gc-layout="stacked"] .avscode-gc-button.button {
    width: 100% !important;
}

.avscode-gc-apply-form .avscode-gc-button:hover,
.avscode-gc-remove-form .avscode-gc-button:hover,
.avscode-gc-box button.avscode-gc-button:hover {
    filter: brightness(.96);
}

.avscode-gc-applied {
    display: grid;
    gap: 6px;
    margin: 0 0 12px;
    color: var(--avscode-gc-box-muted, #7a6b62);
}

.avscode-gc-applied code,
.avscode-gc-applied strong {
    color: var(--avscode-gc-box-text, #2b2b2b);
    word-break: break-word;
}

.avscode-gc-applied code {
    display: inline-flex;
    border-radius: 999px;
    padding: 4px 8px;
    background: rgba(255,255,255,.72);
}

.avscode-gc-order-info {
    margin: 24px 0;
}

/* Cart/checkout sidebar: keep the panel compact and inside the summary column. */
.cart_totals .avscode-gc-box,
.woocommerce-checkout-review-order .avscode-gc-box,
#order_review .avscode-gc-box,
.avscode-gc-box-checkout,
.avscode-gc-box-checkout-fallback {
    margin: 0 0 var(--avscode-gc-box-margin, 16px);
    width: 100%;
    max-width: 100%;
}

.cart_totals .avscode-gc-apply-form,
.woocommerce-checkout-review-order .avscode-gc-apply-form,
#order_review .avscode-gc-apply-form,
.avscode-gc-box-checkout .avscode-gc-apply-form,
.avscode-gc-box-checkout-fallback .avscode-gc-apply-form {
    flex-wrap: nowrap;
}

.avscode-gc-box--fallback-compact {
    max-width: 440px;
    margin-left: auto;
}

@media (max-width: 640px) {
    .avscode-gc-apply-form,
    .avscode-gc-remove-form,
    .cart_totals .avscode-gc-apply-form,
    .woocommerce-checkout-review-order .avscode-gc-apply-form,
    #order_review .avscode-gc-apply-form {
        flex-direction: column;
    }

    .avscode-gc-apply-form .button,
    .avscode-gc-remove-form .button {
        width: 100%;
        text-align: center;
    }
}

.avscode-gc-balance-checker,
.avscode-gc-account {
    margin: 24px 0;
}

.avscode-gc-balance-checker {
    padding: 22px;
    border: 1px solid rgba(15, 23, 42, .10);
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 14px 35px rgba(15, 23, 42, .06);
}

.avscode-gc-balance-checker h3,
.avscode-gc-account h2 {
    margin-top: 0;
    letter-spacing: -.02em;
}

.avscode-gc-balance-form {
    display: flex;
    gap: 10px;
    align-items: stretch;
    margin-top: 14px;
}

.avscode-gc-balance-form input[type="text"] {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 46px;
    border-radius: 999px;
    padding-left: 16px;
}

.avscode-gc-balance-form .button {
    min-height: 46px;
    border-radius: 999px;
    padding-left: 20px;
    padding-right: 20px;
    font-weight: 700;
}

.avscode-gc-balance-result {
    margin-top: 16px;
    padding: 16px 18px;
    border-radius: 18px;
}

.avscode-gc-balance-result.is-success {
    background: #f8fafc;
    border: 1px solid #dbeafe;
}

.avscode-gc-balance-result.is-error {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #9f1239;
}

.avscode-gc-balance-result ul {
    margin: 10px 0 0 18px;
}

.avscode-gc-account-table-wrap {
    overflow-x: auto;
    margin: 18px 0 24px;
}

.avscode-gc-account-table code {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f1f5f9;
}

.avscode-gc-order-info {
    padding: 22px;
    border-radius: 22px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, .10);
}

.avscode-gc-order-info ul {
    margin-bottom: 0;
}

@media (max-width: 640px) {
    .avscode-gc-balance-form {
        flex-direction: column;
    }

    .avscode-gc-balance-form .button {
        width: 100%;
    }
}
