/* ------------------------------------------------------------------
   Coupon system & admin managed visitor popup
   ------------------------------------------------------------------ */

/* --- Checkout coupon box ------------------------------------------ */

.coupon-box {
    margin: 1rem 0;
    padding: 1rem 0;
    border-top: 1px dashed rgba(128, 128, 128, .35);
    border-bottom: 1px dashed rgba(128, 128, 128, .35);
}

.coupon-label {
    display: block;
    margin-bottom: .5rem;
    font-size: .875rem;
    font-weight: 600;
}

.coupon-input-group {
    display: flex;
    gap: .5rem;
}

.coupon-input {
    flex: 1 1 auto;
    min-width: 0;
    text-transform: uppercase;
}

.coupon-apply-btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.coupon-message {
    margin-top: .5rem;
    font-size: .8125rem;
    min-height: 1rem;
}

.coupon-message.is-error {
    color: #dc3545;
}

.coupon-message.is-success {
    color: #198754;
}

.coupon-applied {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.coupon-applied-code {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    padding: .375rem .75rem;
    border-radius: 6px;
    background: rgba(25, 135, 84, .12);
    color: #198754;
    font-weight: 700;
    font-size: .875rem;
    letter-spacing: .5px;
}

.coupon-remove-btn {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    opacity: .6;
    font-size: .8125rem;
    text-decoration: underline;
    cursor: pointer;
}

.coupon-remove-btn:hover {
    opacity: 1;
}

/* --- My coupons (account panel) ----------------------------------- */

.my-coupons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.coupon-card {
    display: flex;
    overflow: hidden;
    border: 1px solid rgba(128, 128, 128, .25);
    border-radius: 10px;
}

.coupon-card.is-inactive {
    opacity: .55;
}

.coupon-card-left {
    display: flex;
    flex: 0 0 110px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem .5rem;
    border-right: 2px dashed rgba(128, 128, 128, .35);
    background: rgba(25, 135, 84, .1);
    text-align: center;
}

.coupon-card-discount {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
    color: #198754;
}

.coupon-card-off {
    font-size: .6875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: .7;
}

.coupon-card-right {
    flex: 1 1 auto;
    min-width: 0;
    padding: .875rem 1rem;
}

.coupon-card-head {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.coupon-card-code {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 1px;
    word-break: break-all;
}

.coupon-copy-btn {
    display: inline-flex;
    padding: .25rem;
    border: 0;
    border-radius: 4px;
    background: none;
    color: inherit;
    opacity: .6;
    cursor: pointer;
}

.coupon-copy-btn:hover,
.coupon-copy-btn.is-copied {
    opacity: 1;
    color: #198754;
}

.coupon-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .375rem;
    margin-top: .25rem;
    font-size: .8125rem;
    opacity: .7;
}

.coupon-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-top: .75rem;
}

.coupon-card-state {
    padding: .1875rem .5rem;
    border-radius: 4px;
    background: rgba(128, 128, 128, .15);
    font-size: .6875rem;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.coupon-card-state.coupon-state-active {
    background: rgba(25, 135, 84, .15);
    color: #198754;
}

.coupon-card-state.coupon-state-expired,
.coupon-card-state.coupon-state-used_up {
    background: rgba(255, 193, 7, .18);
    color: #997404;
}

.coupon-card-use {
    font-size: .8125rem;
    font-weight: 600;
    text-decoration: none;
}

.coupon-card-use:hover {
    text-decoration: underline;
}

@media (max-width: 575.98px) {
    .my-coupons-grid {
        grid-template-columns: 1fr;
    }

    .coupon-input-group {
        flex-direction: column;
    }
}
