﻿/** * Copyright (c) 2026 DNA Genics, S.L. All rights reserved.
 * 
 * Promotion banner styling.
 * Reusable sticky discount banner displayed at the bottom of the viewport.
 */

/* ================================
   Promotion Banner - Reusable Styles
   ================================ */

/* Body padding compensation when banner is visible */
body.has-promotion-banner {
    padding-bottom: 52px;
}

/* Main banner container */
.promotion-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1041; /* Above demo banner (1040) but below modals (1050+) */
    /* Professional teal gradient with fallback colors */
    background: linear-gradient(135deg, #3D8B8B 0%, #2D6B6B 100%);
    background: linear-gradient(135deg, var(--dnagenics-teal, #3D8B8B) 0%, var(--dnagenics-teal-dark, #2D6B6B) 100%);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    animation: promotionSlideUp 0.4s ease-out;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Slide up entrance animation */
@keyframes promotionSlideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Slide down exit animation */
@keyframes promotionSlideDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

.promotion-banner.dismissing {
    animation: promotionSlideDown 0.3s ease-in forwards;
}

/* Auto-hide state - slides down like dismiss but can return */
.promotion-banner.auto-hidden {
    animation: promotionSlideDown 0.3s ease-in forwards;
    pointer-events: none;
}

/* Re-show animation when scrolling back to top */
.promotion-banner.auto-hidden.showing {
    animation: promotionSlideUp 0.4s ease-out forwards;
    pointer-events: auto;
}

/* Banner inner container */
.promotion-banner__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 48px 12px 16px;
    min-height: 48px;
    gap: 8px;
}

/* Icon styling */
.promotion-banner__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    flex-shrink: 0;
}

.promotion-banner__icon i {
    color: #fff;
    font-size: 14px;
}

/* Content wrapper */
.promotion-banner__content {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 12px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

/* Discount amount with subtle pulse */
.promotion-banner__discount {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    animation: subtlePulse 2s ease-in-out infinite;
}

@keyframes subtlePulse {
    0%, 100% {
        background: rgba(255, 255, 255, 0.2);
    }
    50% {
        background: rgba(255, 255, 255, 0.35);
    }
}

/* Coupon code button */
.promotion-banner__coupon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    color: var(--dnagenics-teal-dark);
    padding: 4px 12px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.promotion-banner__coupon:hover {
    background: var(--dng-teal-light, #5DAEAE);
    color: #fff;
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.promotion-banner__coupon:active {
    transform: scale(0.98);
}

.promotion-banner__coupon i {
    font-size: 11px;
    opacity: 0.7;
}

.promotion-banner__coupon.copied {
    background: var(--dng-amber-light, #F5C85D);
    color: var(--dng-charcoal, #2D3436);
}

.promotion-banner__coupon.copied i::before {
    content: "\f00c"; /* FontAwesome check icon */
}

/* Separator dot */
.promotion-banner__separator {
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
}

/* Expiry text */
.promotion-banner__expiry {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 400;
}

/* Dismiss button */
.promotion-banner__dismiss {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.promotion-banner__dismiss:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.promotion-banner__dismiss:active {
    transform: translateY(-50%) scale(0.95);
}

.promotion-banner__dismiss i {
    font-size: 12px;
}

/* Mobile responsive adjustments */
@media (max-width: 575.98px) {
    body.has-promotion-banner {
        padding-bottom: 64px;
    }

    .promotion-banner__inner {
        padding: 10px 44px 10px 12px;
        min-height: 56px;
    }

    .promotion-banner__icon {
        display: none;
    }

    .promotion-banner__content {
        font-size: 13px;
        gap: 4px 8px;
    }

    .promotion-banner__discount {
        font-size: 13px;
        padding: 3px 8px;
    }

    .promotion-banner__coupon {
        font-size: 12px;
        padding: 3px 10px;
    }

    .promotion-banner__expiry {
        font-size: 11px;
        width: 100%;
        text-align: center;
    }

    .promotion-banner__separator {
        display: none;
    }

    .promotion-banner__dismiss {
        right: 8px;
        width: 32px;
        height: 32px;
    }
}

/* Print styles - hide banner when printing */
@media print {
    .promotion-banner {
        display: none !important;
    }

    body.has-promotion-banner {
        padding-bottom: 0 !important;
    }
}

