/* ASIS Compatibility - Reset existing coupon styles */
.room-card dl.auto-aquired-coupon.auto-aquired-coupon--with-modal.auto-aquired-coupon--with-modal,
.plan-card dl.auto-aquired-coupon.auto-aquired-coupon--with-modal.auto-aquired-coupon--with-modal {
    padding: 0;
    border-left: none;
    background-color: transparent;
}

.dated-10-pup .cpwrp.cpwrp dl.auto-aquired-coupon.auto-aquired-coupon--with-modal dd,
.cpwrp.cpwrp .rtprts__coupon dl.auto-aquired-coupon.auto-aquired-coupon--with-modal dd {
    padding: 0;
}

.prcSummary .rtprts__coupon dl.auto-aquired-coupon.auto-aquired-coupon--with-modal,
dl.auto-aquired-coupon.auto-aquired-coupon--with-modal {
    margin-top: 4px;
    padding: 0;
    border-left: none;
    background-color: transparent;
}

.prcSummary .rtprts__coupon dl.auto-aquired-coupon.auto-aquired-coupon--with-modal dd,
dl.auto-aquired-coupon.auto-aquired-coupon--with-modal dd {
    padding: 0;
}

dl.auto-aquired-coupon.auto-aquired-coupon--with-modal + .prcPerPerson,
dl.auto-aquired-coupon.auto-aquired-coupon--with-modal + .point-info {
    margin-top: 4px;
}

/* Coupon Button */
.coupon-detail-btn {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 2px 4px;
    border: 1px solid #F59600;
    border-radius: 2px;
    background: #FFF8E5;
    cursor: pointer;
    line-height: 1;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.coupon-detail-btn:hover {
    background: linear-gradient(rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05)), #FFF8E5;
    border-color: #DC8700;
}

.coupon-detail-btn:active {
    background: linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1)), #FFF8E5;
    border-color: #C37900;
}

.coupon-detail-btn .coupon-button-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    align-items: flex-start;
    gap: 2px;
}

.coupon-detail-btn .coupon-button-content__discount-info {
    display: flex;
    align-items: center;
    gap: 2px;
}

.coupon-detail-btn .coupon-button-content__details {
    display: flex;
    align-items: center;
}

.coupon-detail-btn .discount-amount {
    font-size: 12px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    color: #333;
    font-style: normal;
}

.coupon-detail-btn .coupon-info-text {
    font-size: 10px;
    font-weight: 400;
    line-height: 14px;
    text-align: center;
    color: #333;
    font-style: normal;
}

.coupon-detail-btn .coupon-info-text .coupon-info-count {
    font-weight: 700;
    color: #333;
}

.coupon-detail-btn__arrow-icon {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 10px;
    height: 10px;
}

.coupon-detail-btn__arrow-icon img {
    width: 100%;
    height: 100%;
}

.coupon-detail-btn__coupon-icon {
    position: relative;
    top: -1px;
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
}

.coupon-detail-btn__coupon-icon img {
    width: 12px;
    height: 12px;
}

/* Modal Overlay */
.coupon-modal-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.6);
    overflow: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

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

/* Modal */
.coupon-modal {
    display: flex;
    flex-direction: column;
    max-width: 480px;
    width: 100%;
    min-height: 250px;
    max-height: calc(100vh - 208px);
    border-radius: 8px;
    background: #FFF;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    box-sizing: border-box;
}

/* Header */
.coupon-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid #CCCCCC;
}

.coupon-modal__title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 26px;
    color: #333;
}

.coupon-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.coupon-modal__close:hover {
    background: rgba(0, 0, 0, 0.05);
}

.coupon-modal__close:active {
    background: rgba(0, 0, 0, 0.1);
}

.coupon-modal__close-icon {
    display: block;
    width: 24px;
    height: 24px;
}

/* Content */
.coupon-modal__content {
    flex: 1;
    min-height: 0;
    padding: 16px 24px 24px 24px;
    overflow-y: auto;
}

/* Total Discount */
.coupon-modal__total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    margin-bottom: 16px;
}

.coupon-modal__total-label {
    font-size: 16px;
    font-weight: 700;
    line-height: 24px;
    color: #333;
}

.coupon-modal__total-value {
    font-size: 20px;
    font-weight: 700;
    line-height: 28px;
    color: #CE2B18;
}

/* Coupon List */
.coupon-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.coupon-list__item {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    align-self: stretch;
    min-height: 66px;
    padding: 8px 12px;
    border: 1px solid #CCC;
    border-radius: 8px;
    background: #FFF;
    gap: 12px;
    box-sizing: border-box;
}

.coupon-list__item-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.coupon-item__deadline-label {
    align-self: flex-start;
    padding: 2px 4px;
    background: #FFF8E5;
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
    color: #CE2B18;
}

.coupon-list__item-info {
    display: flex;
    align-items: center;
}

.coupon-list__item-left {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    align-self: stretch;
}

.coupon-list__item-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.coupon-list__item-text-wrapper {
    display: inline;
    flex: 1;
}

.coupon-list__item-name {
    display: inline;
    font-size: 14px;
    font-weight: 400;
    line-height: 22px;
    color: #333;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.coupon-list__item-discount {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    font-size: 16px;
    font-weight: 700;
    line-height: 24px;
    color: #CE2B18;
    white-space: nowrap;
}

.coupon-modal .coupon-list__item .coupon-item__card-only {
    display: inline;
    margin-right: 4px;
    font-size: 14px;
    font-weight: 600;
    line-height: 22px;
    color: #333;
    white-space: nowrap;
}

/* MapModal - Display-only buttons */
#mapModal .coupon-detail-btn__arrow-icon {
    display: none;
}

#mapModal .coupon-detail-btn {
    cursor: default;
    pointer-events: none;
}

/* Responsive (SP) */
@media (max-width: 720px) {
    /* Transparent backdrop */
    .coupon-modal-overlay {
        align-items: flex-start;
        padding: 0;
        background-color: transparent;
    }

    /* Fullscreen modal */
    .coupon-modal {
        position: fixed;
        top: 0;
        left: 0;
        max-width: 100%;
        width: 100%;
        max-height: 100vh;
        height: 100vh;
        max-height: 100dvh;
        height: 100dvh;
        margin: 0;
        padding: 0;
        border-radius: 0;
        gap: 0;
        overflow: hidden;
        box-sizing: border-box;
        overscroll-behavior-x: none;
        touch-action: pan-y;
    }

    .coupon-modal__header {
        flex-direction: row-reverse;
        flex-shrink: 0;
        justify-content: flex-end;
        margin-bottom: 0;
        padding: 16px 8px;
        border-bottom: none;
        box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.12);
        gap: 8px;
    }

    .coupon-modal__content {
        flex: 1;
        min-height: 0;
        margin: 0;
        padding: 16px 16px 16px 16px;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .coupon-list__item {
        padding: 8px 12px;
        gap: 12px;
        box-sizing: border-box;
    }

    /* Spacing below coupon button */
    .dated-10-pup-new .prcSummary-left-panel dl.auto-aquired-coupon + .point-info {
        margin-top: 4px;
    }
}
