/**
 * Gift Popup styles (from gift-popup-module plugin).
 */

/* Icon/counter/trigger layout moved to critical CSS (inc/utilities/critical-css.php) */

.gift-popup-trigger.hidden {
    display: none !important;
}

/* Modal window (dropdown) */
.gift-popup-modal {
    position: absolute;
    top: 100%;
    right: -80px;
    margin-top: 0;
    z-index: 99999;
    display: none;
}

.gift-popup-modal.active {
    display: block;
}

/* Content of popup */
.gift-popup-content {
    position: relative;
    background: transparent;
    border-radius: 0;
    width: 600px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    padding: 15px;
    padding-top: 25px;
    box-shadow: none;
    border: none;
}

/* Triangle upwards */
.gift-popup-content::before {
    content: '';
    position: absolute;
    top: 17px;
    right: 95px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #000;
    filter: drop-shadow(0 -2px 4px rgba(168, 14, 255, 0.5));
    z-index: 1;
}

/* Close button */
.gift-popup-close {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 28px;
    height: 28px;
    background: #fff;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #333;
    z-index: 10002;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.gift-popup-close:hover {
    background: #f5f5f5;
    border-color: #7113ff;
    color: #7113ff;
}

.gift-popup-close svg {
    width: 14px;
    height: 14px;
}

/* Elements of gifts */
.gift-popup-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 5px;
    margin-right: 5px;
    background: #000;
    border-radius: 12px;
    box-shadow: 0 0px 10px rgba(168, 14, 255, 1);
}

/* Gift card */
.gift-item-card {
    background-color: #1b1d21;
    border: 1px solid #2a2d33;
    border-radius: 12px;
    padding: 15px 20px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.gift-item-card:hover {
    border-color: #7113ff;
}

/* Logo */
.gift-item-logo {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
    background: #f9f9f9;
    border: 2px solid #f0f0f0;
}

.gift-item-logo img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    border-radius: 5px;
    object-position: center;
}

/* Content */
.gift-item-content {
    flex-grow: 1;
    font-size: 14px;
    line-height: 1.6;
    color: #fff;
    font-weight: 700;
    text-align: left;
    min-width: 0;
}

/* Button */
.gift-item-button {
    flex-shrink: 0;
    display: inline-block;
    padding: 10px 24px;
    background: linear-gradient(91deg, #458423 -3.33%, #69a651 110.01%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(97, 197, 13, 0.3);
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
}

/* Mobile / compact view */
@media screen and (max-width: 992px) {
    .gift-popup-items {
        padding: 15px 10px 5px 5px;
        box-shadow: unset;
    }

    .gift-item-card {
        padding: 5px;
        border-color: #7113ff;
    }

    /* .gift-popup-trigger, .gift-icon, .gift-counter layout in critical CSS */

    .gift-popup-modal {
        position: fixed !important;
        top: 60px !important;
        left: 0 !important;
        width: calc(100vw - 15px) !important;
        padding: 0 !important;
        margin: 0 !important;
        right: auto !important;
    }

    .gift-popup-content {
        width: 100% !important;
        max-width: none !important;
        padding: 5px !important;
        margin-top: 10px;
        box-sizing: border-box !important;
    }

    .gift-popup-content::before {
        display: block !important;
        right: 160px !important;
        top: 5px;
        box-shadow: unset !important;
        filter: unset !important;
    }

    .gift-item-content {
        font-size: 0.75rem;
        line-height: 1.25;
    }

    .gift-item-button {
        padding: 10px 15px;
        font-size: 14px;
    }
}

@media screen and (max-width: 400px) {
    .gift-item-button {
        padding: 10px 8px;
        font-size: 14px;
        max-width: 33.33333333333333%;
        white-space: normal;
    }
    .gift-item-card {
        gap: 5px;
    }
}

/* Prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .gift-popup-trigger,
    .gift-icon,
    .gift-pulse,
    .gift-item-card,
    .gift-popup-close {
        animation: none;
        transition: none;
    }
}

@media screen and (max-width: 992px) {
    .gift-item-logo {
        width: 50px;
        height: 50px;
    }
}