/**
 * Coupon Badges Styles
 * 
 * @package DN_Checkout_Ultimate
 * @since 1.8.7
 */

/* Wrapper */
.dn-coupon-badges-wrapper {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}

.dn-coupon-badges-label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.dn-coupon-badges-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Individual Badge */
.dn-coupon-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.dn-coupon-badge-bg {
    width: auto;
    height: 28px;
    display: block;
}

.dn-coupon-badge-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #f75c02;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tooltip - JS controlled via .dn-coupon-tooltip */
.dn-coupon-tooltip {
    position: absolute;
    z-index: 10000;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 16px;
    background: #fff;
    color: #333;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.6;
    white-space: normal;
    min-width: 220px;
    max-width: 300px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* Tooltip arrow - pointing up */
.dn-coupon-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-bottom-color: #fff;
}

/* Show tooltip on hover */
.dn-coupon-badge:hover .dn-coupon-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Tooltip content styling */
.dn-coupon-tooltip strong {
    color: #f75c02;
    font-weight: 700;
}

.dn-coupon-tooltip .tooltip-remaining {
    color: #666;
    font-size: 12px;
}

.dn-coupon-tooltip .tooltip-desc {
    margin-top: 4px;
    color: #333;
    line-height: 1.2;
}

.dn-coupon-tooltip .tooltip-expiry {
    margin-top: 4px;
    color: #888;
    font-size: 12px;
}

/* Toast Notification */
.dn-coupon-toast {
    position: fixed;
    top: 120px;
    right: 20px;
    z-index: 100000;
    padding: 14px 20px;
    background: #fff;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    border-radius: 3px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
    border-left: 3px solid #105151;
    animation: dn-toast-slide-in 0.3s ease;
}

.dn-coupon-toast.dn-toast-hiding {
    animation: dn-toast-slide-out 0.3s ease forwards;
}

@keyframes dn-toast-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes dn-toast-slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ========================================
   MORE BUTTON & DROPDOWN
   ======================================== */

/* Wrapper for more button */
.dn-coupon-more-wrapper {
    position: relative;
    display: inline-block;
}

/* More button style */
.dn-coupon-more-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.dn-coupon-more-btn:hover {
    background: #ebebeb;
    border-color: #ccc;
    color: #333;
}

/* Dropdown container */
.dn-coupon-more-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 5px;
    background: #fff;
    border-radius: 3px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

/* Dropdown arrow */
.dn-coupon-more-dropdown::before {
    content: '';
    position: absolute;
    bottom: 100%;
    right: 20px;
    border: 8px solid transparent;
    border-bottom-color: #fff;
}

/* Show dropdown on hover */
.dn-coupon-more-wrapper:hover .dn-coupon-more-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Badge inside dropdown */
.dn-coupon-badge-dropdown {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tooltip for dropdown items - show to the left */
.dn-coupon-tooltip-dropdown {
    left: auto;
    right: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
}

.dn-coupon-tooltip-dropdown::after {
    left: auto;
    right: -16px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-left-color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .dn-coupon-badges-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }

    .dn-coupon-tooltip {
        left: 0;
        transform: none;
        min-width: 200px;
    }

    .dn-coupon-tooltip::after {
        left: 30px;
        transform: none;
    }

    /* Dropdown responsive */
    .dn-coupon-more-dropdown {
        right: auto;
        left: 0;
    }

    .dn-coupon-more-dropdown::before {
        right: auto;
        left: 20px;
    }

    .dn-coupon-tooltip-dropdown {
        left: calc(100% + 10px);
        right: auto;
    }

    .dn-coupon-tooltip-dropdown::after {
        left: -16px;
        right: auto;
        border-left-color: transparent;
        border-right-color: #fff;
    }
}