/**
 * mod_discount_code
 * Stylesheet — UIkit / Gantry handles primary presentation; these rules
 * handle module-specific layout only.
 *
 * @package     mod_discount_code
 * @copyright   Copyright (C) 2026 Storm Web Design Ltd. All rights reserved.
 * @license     GNU General Public License version 2 or later
 */

/* =========================================================
   Code area
   ========================================================= */

#mod-discount-code-557 {
    text-align: center;
    color: #2a88bd;
}

.mod-discount-code__code-area {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
    justify-content: center;
}

.mod-discount-code__code {
    display: inline-block;
    font-family: monospace;
    font-size: 1.4em;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 6px 14px;
    border: 2px dashed currentColor;
    border-radius: 4px;
    user-select: all;
    cursor: pointer;
    transition:
        border-style 0.15s ease,
        opacity 0.15s ease;
}

.mod-discount-code__code:hover {
    border-style: solid;
}

.mod-discount-code__code--copied {
    border-style: solid;
    opacity: 0.75;
    letter-spacing: 0.04em;
}

/* =========================================================
   Copy button
   ========================================================= */

.mod-discount-code__copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 18px;
    border: 2px solid currentColor;
    border-radius: 4px;
    background: transparent;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition:
        background 0.2s ease,
        color 0.2s ease;
    color: inherit;
    margin: 0 auto;
}

.mod-discount-code__copy-btn:hover,
.mod-discount-code__copy-btn:focus {
}

.mod-discount-code__copy-btn:active {
    background: rgba(0, 0, 0, 0.15);
}

.mod-discount-code__copy-btn--copied {
    opacity: 0.85;
}

/* =========================================================
   Reminder
   ========================================================= */

.mod-discount-code__reminder {
    margin-top: 10px;
    font-size: 0.9em;
    opacity: 0.85;
}

.mod-discount-code__reminder p:last-child {
    margin-bottom: 0;
}

/* =========================================================
   Card header colour overrides
   UIkit / Gantry card-header doesn't include alert colours
   ========================================================= */

.uk-card-header.uk-alert-primary,
.jl-card-header.jl-alert-primary {
    background-color: #dae8fc;
    color: #1e87f0;
}

.uk-card-header.uk-alert-success,
.jl-card-header.jl-alert-success {
    background-color: #edfbf6;
    color: #32d296;
}

.uk-card-header.uk-alert-warning,
.jl-card-header.jl-alert-warning {
    background-color: #fef5ee;
    color: #faa05a;
}

.uk-card-header.uk-alert-danger,
.jl-card-header.jl-alert-danger {
    background-color: #fef4f6;
    color: #f0506e;
}

/* =========================================================
   Dismiss (card variant)
   ========================================================= */

.mod-discount-code--card .mod-discount-code__dismiss {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: inherit;
    opacity: 0.7;
    line-height: 1;
}

.mod-discount-code--card .mod-discount-code__dismiss:hover,
.mod-discount-code--card .mod-discount-code__dismiss:focus {
    opacity: 1;
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* =========================================================
   Popup / Modal — Micromodal
   ========================================================= */

/* Hidden by default; Micromodal adds .is-open to show */
.mod-discount-code--popup {
    display: none;
}

.mod-discount-code--popup.is-open {
    display: block;
}

/* Full-screen overlay */
.mod-discount-code__overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Dialog box */
.mod-discount-code__dialog {
    position: relative;
    box-sizing: border-box;
    background: #ffffff;
    border-radius: 6px;
    padding: 30px;
    width: 560px;
    max-width: calc(100vw - 30px);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.mod-discount-code__dialog .mod-discount-code__title {
    margin: 0 0 16px;
    padding-right: 30px; /* clear the close button */
}

/* Close button */
.mod-discount-code__popup-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    line-height: 1;
    padding: 4px 6px;
    opacity: 0.6;
    color: inherit;
}

.mod-discount-code__popup-close:hover,
.mod-discount-code__popup-close:focus {
    opacity: 1;
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* =========================================================
   Hidden state (dismissed banner/card)
   ========================================================= */

.mod-discount-code--dismissed {
    display: none !important;
}
