/* Premium Promotional Coupon Styles */

/* Base Overlay Backdrop */
.promo-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(16, 19, 23, 0.5); /* dark translucent overlay */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 99998;
}
.promo-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Desktop Modal Popup */
.promo-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 560px;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.04);
    padding: 40px;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease, visibility 0.3s ease;
    text-align: center;
    box-sizing: border-box;
}
.promo-modal.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
}

/* Close Icon (Top Right) */
.promo-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    cursor: pointer;
    color: #8e8e93;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.promo-close-btn:hover {
    background-color: #f2f2f5;
    color: #1c1c1e;
}
.promo-close-btn svg {
    display: block;
}

/* Shared Modal Elements */
.promo-logo {
    height: 38px;
    margin-bottom: 24px;
    object-fit: contain;
}
.promo-title {
    font-size: 28px;
    font-weight: 800;
    color: #101317;
    margin-bottom: 12px;
    line-height: 1.25;
    font-family: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
}
.promo-description {
    font-size: 16px;
    color: #636366;
    line-height: 1.5;
    margin-bottom: 24px;
}

/* Coupon Card Styling */
.promo-coupon-card {
    background: linear-gradient(135deg, rgba(148, 5, 253, 0.04) 0%, rgba(1, 148, 252, 0.04) 100%);
    border: 2px dashed #9405FD;
    border-radius: 16px;
    padding: 16px 24px;
    font-size: 28px;
    font-weight: 800;
    color: #9405FD;
    letter-spacing: 4px;
    margin: 8px auto 28px auto;
    width: 100%;
    max-width: 320px;
    text-align: center;
    box-sizing: border-box;
    font-family: monospace, system-ui;
    position: relative;
    user-select: all;
}

/* Buttons */
.promo-primary-btn {
    background: linear-gradient(135deg, #9405FD 0%, #0194FC 100%);
    color: #ffffff !important;
    border: none;
    border-radius: 9999px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    max-width: 320px;
    box-shadow: 0 8px 20px rgba(148, 5, 253, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    margin: 0 auto 16px auto;
    display: block;
    text-decoration: none;
    text-align: center;
}
.promo-primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(148, 5, 253, 0.35);
    filter: brightness(1.05);
}
.promo-primary-btn:active {
    transform: translateY(0);
}
.promo-secondary-btn {
    background: none;
    border: none;
    color: #8e8e93;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease;
    display: inline-block;
    text-decoration: none;
    padding: 4px 8px;
}
.promo-secondary-btn:hover {
    color: #1c1c1e;
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 991.98px) {
    .promo-modal {
        max-width: 500px;
        padding: 32px;
    }
    .promo-title {
        font-size: 26px;
    }
}

/* Hide desktop modal on mobile */
@media (max-width: 767.98px) {
    .promo-modal {
        display: none !important;
    }
}

/* Mobile Bottom Sheet */
.promo-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: auto;
    max-height: 70vh;
    min-height: 55vh;
    background: #ffffff;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.12);
    padding: 16px 24px calc(24px + env(safe-area-inset-bottom)) 24px;
    z-index: 99999;
    transform: translateY(100%);
    visibility: hidden;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-sizing: border-box;
}
.promo-sheet.active {
    transform: translateY(0);
    visibility: visible;
}

.promo-sheet-handle {
    width: 40px;
    height: 5px;
    background: #e5e5ea;
    border-radius: 3px;
    margin-bottom: 24px;
    flex-shrink: 0;
}

/* Hide bottom sheet on desktop/tablet */
@media (min-width: 768px) {
    .promo-sheet {
        display: none !important;
    }
}

/* Premium Floating Coupon Pill (All Devices) */
.promo-pill-wrapper {
    position: fixed;
    left: 50%;
    transform: translate3d(-50%, 40px, 0);
    -webkit-transform: translate3d(-50%, 40px, 0);
    opacity: 0;
    visibility: hidden;
    z-index: 99997; /* Below overlays (99998/99999) */
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease, visibility 0.4s ease, -webkit-transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    bottom: 24px;
    width: auto;
    min-width: 280px;
    max-width: 340px;
}

.promo-pill-wrapper.active {
    transform: translate3d(-50%, 0, 0);
    -webkit-transform: translate3d(-50%, 0, 0);
    opacity: 1;
    visibility: visible;
}

/* Floating animation container */
.promo-pill-float-container {
    width: 100%;
}

.promo-pill-wrapper.active .promo-pill-float-container {
    animation: pillFloat 3s ease-in-out infinite;
}

.promo-floating-pill {
    pointer-events: auto;
    cursor: pointer;
    width: 100%;
    background: linear-gradient(135deg, #ffffff, #f7fbff);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    min-height: 72px;
    padding: 14px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    text-align: left;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

.promo-floating-pill:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.1), 0 6px 16px rgba(0, 0, 0, 0.06);
    border-color: rgba(123, 47, 247, 0.2);
}

.promo-floating-pill:active {
    transform: translateY(-2px) scale(0.98);
}

.promo-pill-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.promo-pill-title {
    font-family: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #101317;
    line-height: 1.25;
    white-space: nowrap;
}

.promo-pill-subtitle {
    font-family: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #636366;
    line-height: 1.2;
    white-space: nowrap;
}

.promo-pill-code {
    background: linear-gradient(90deg, #7B2FF7, #1677FF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.promo-pill-right {
    display: flex;
    align-items: center;
}

.promo-pill-tag {
    font-family: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
    font-size: 10px;
    font-weight: 500;
    color: #16A34A;
    background: #EAFBF3;
    padding: 3px 6px;
    border-radius: 999px;
    white-space: nowrap;
}

/* Mobile Adjustments */
@media (max-width: 767.98px) {
    .promo-pill-wrapper {
        bottom: calc(16px + env(safe-area-inset-bottom));
        width: calc(100% - 32px);
        max-width: 340px;
        min-width: 0;
    }
    
    .promo-floating-pill {
        padding: 12px 18px;
        min-height: 64px;
        border-radius: 20px;
        gap: 12px;
    }
    
    .promo-pill-left {
        gap: 2px;
    }
    
    .promo-pill-title {
        font-size: 15px;
    }
    
    .promo-pill-subtitle {
        font-size: 12px;
    }
    
    .promo-pill-tag {
        font-size: 9px;
        padding: 2px 4px;
    }
}

/* Keyframes for premium subtle floating animation */
@keyframes pillFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

/* Footer safety spacing to avoid overlap with the floating coupon pill */
.home-footer,
footer.footer,
.footer-section {
    transition: padding-bottom 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

body.coupon-pill-visible .home-footer,
body.coupon-pill-visible footer.footer,
body.coupon-pill-visible .footer-section {
    padding-bottom: 110px !important;
}

@media (max-width: 767.98px) {
    body.coupon-pill-visible .home-footer,
    body.coupon-pill-visible footer.footer,
    body.coupon-pill-visible .footer-section {
        padding-bottom: calc(100px + env(safe-area-inset-bottom)) !important;
    }
}


