/* ===== 選擇優惠券 Modal ===== */

.coupon-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 1050;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease, background 0.25s ease;
}

.coupon-modal-overlay.active {
    display: flex;
}

.coupon-modal-overlay.is-visible {
    opacity: 1;
    background: rgba(0, 0, 0, 0.5);
}

.coupon-modal {
    background: #fff;
    border-radius: 8px;
    width: 540px;
    max-width: 92vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9) translateY(16px);
    transition: transform 0.25s ease;
}

.coupon-modal-overlay.is-visible .coupon-modal {
    transform: scale(1) translateY(0);
}

.coupon-modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 18px 20px;
    border-bottom: 1px solid #eee;
}

.coupon-modal-title {
    font-size: 1.05rem;
    font-weight: bold;
    color: #222;
}

.coupon-modal-close {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #555;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.coupon-modal-close:hover {
    color: #111;
}

.coupon-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.coupon-modal-item {
    display: block;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 14px 16px;
    cursor: pointer;
    transition: border-color 0.2s;
    margin: 0;
}

.coupon-modal-item input[type="radio"] {
    display: none;
}

.coupon-modal-item.selected {
    border-color: #c00;
    border-width: 2px;
}

.coupon-modal-item-inner {
    display: flex;
    align-items: stretch;
    gap: 0;
    position: relative;
    margin: -14px -16px;
    border-radius: 6px;
    overflow: hidden;
}

.coupon-modal-radio {
    flex-shrink: 0;
    width: 44px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 8px;
}

.coupon-modal-info {
    flex: 1;
    padding: 14px 16px;
}

.coupon-modal-radio-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #ccc;
    background: #fff;
    display: block;
    flex-shrink: 0;
    transition: border-color 0.2s;
}

.coupon-modal-item.selected .coupon-modal-radio-dot {
    border-color: #c00;
    background: radial-gradient(circle, #c00 45%, #fff 46%);
}

.coupon-modal-discount {
    font-size: 1.25rem;
    font-weight: bold;
    color: #c00;
    margin-bottom: 4px;
}

.coupon-modal-unit {
    font-size: 1rem;
    font-weight: normal;
}

.coupon-modal-name {
    font-size: 0.9rem;
    color: #333;
    line-height: 1.4;
    margin-bottom: 4px;
}

.coupon-modal-date {
    font-size: 0.8rem;
    color: #888;
}

.coupon-modal-badge {
    flex-shrink: 0;
    background: #f0c0c0;
    color: #c00;
    font-size: 0.78rem;
    padding: 2px 8px;
    border-radius: 3px;
    white-space: nowrap;
    align-self: center;
    margin-right: 12px;
}

.coupon-modal-footer {
    padding: 14px 20px;
    border-top: 1px solid #eee;
    text-align: center;
}

.coupon-modal-confirm {
    background: #c00;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 10px 60px;
    font-size: 1rem;
}

.coupon-modal-confirm:hover {
    background: #a00;
    color: #fff;
}

/* ===== 查無優惠活動 Modal ===== */
.error-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease, background 0.25s ease;
}

.error-modal-overlay.is-visible {
    opacity: 1;
    background: rgba(0, 0, 0, 0.5);
}

.error-modal-box {
    background: #fff;
    border-radius: 12px;
    max-width: 300px;
    width: 90%;
    padding: 32px 24px;
    text-align: center;
    position: relative;
    transform: scale(0.85) translateY(20px);
    transition: transform 0.25s ease;
    border-top: 6px solid #c00;
}

.error-modal-overlay.is-visible .error-modal-box {
    transform: scale(1) translateY(0);
}

.error-modal-close {
    position: absolute;
    top: 5px;
    right: 7px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #555;
}

.error-modal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #222;
    color: #fff;
    font-size: 1.6rem;
    font-weight: bold;
    margin-bottom: 16px;
}

.error-modal-msg {
    margin-bottom: 24px;
    font-size: 1rem;
}
