/* Animated QR scan widget — hero, footer, floating */

.qr-scan {
    --qr-gold: #f59e0b;
    --qr-crimson: #8b1a2b;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: inherit;
}

.qr-scan__frame {
    position: relative;
    padding: 0.55rem;
    border-radius: 1rem;
    background: linear-gradient(145deg, rgba(245, 158, 11, 0.25), rgba(139, 26, 43, 0.35));
    border: 1px solid rgba(245, 158, 11, 0.45);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    animation: qr-glow-pulse 3s ease-in-out infinite;
}

.qr-scan__frame::before,
.qr-scan__frame::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid var(--qr-gold);
    pointer-events: none;
}

.qr-scan__frame::before {
    top: 6px;
    left: 6px;
    border-right: none;
    border-bottom: none;
    border-radius: 4px 0 0 0;
}

.qr-scan__frame::after {
    bottom: 6px;
    right: 6px;
    border-left: none;
    border-top: none;
    border-radius: 0 0 4px 0;
}

.qr-scan__corners span:nth-child(1),
.qr-scan__corners span:nth-child(2) {
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid var(--qr-gold);
    pointer-events: none;
}

.qr-scan__corners span:nth-child(1) {
    top: 6px;
    right: 6px;
    border-left: none;
    border-bottom: none;
    border-radius: 0 4px 0 0;
}

.qr-scan__corners span:nth-child(2) {
    bottom: 6px;
    left: 6px;
    border-right: none;
    border-top: none;
    border-radius: 0 0 0 4px;
}

.qr-scan__img-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 0.55rem;
    background: #fff;
    line-height: 0;
}

.qr-scan__img {
    display: block;
    width: 100%;
    height: auto;
}

.qr-scan__scanline {
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--qr-gold), transparent);
    box-shadow: 0 0 12px var(--qr-gold);
    animation: qr-scanline 2.8s ease-in-out infinite;
    opacity: 0.85;
    pointer-events: none;
}

.qr-scan__label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--qr-gold);
}

.qr-scan__label i {
    animation: qr-ping 2s ease-in-out infinite;
}

.qr-scan__hint {
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.55);
    text-align: center;
    max-width: 9rem;
    line-height: 1.35;
}

/* Variants */
.qr-scan--hero {
    position: absolute;
    right: clamp(0.75rem, 3vw, 1.5rem);
    bottom: clamp(4.5rem, 12vw, 5.5rem);
    z-index: 25;
}

.qr-scan--hero .qr-scan__frame {
    width: clamp(72px, 14vw, 96px);
}

.qr-scan--footer .qr-scan__frame {
    width: 108px;
}

.qr-scan--floating {
    position: fixed;
    bottom: 6.5rem;
    left: 1rem;
    z-index: 90;
    opacity: 0.92;
    transition: transform 0.3s, opacity 0.3s;
}

.qr-scan--floating:hover {
    opacity: 1;
    transform: translateY(-3px);
}

.qr-scan--floating .qr-scan__frame {
    width: 72px;
}

.qr-scan--floating .qr-scan__hint {
    display: none;
}

@media (max-width: 767px) {
    /* One QR on mobile — keep hero, hide floating duplicate */
    .qr-scan--floating {
        display: none !important;
    }

    .qr-scan--hero {
        top: auto;
        bottom: 4.5rem;
        right: 0.65rem;
    }

    .qr-scan--hero .qr-scan__hint {
        display: none;
    }

    .qr-scan--hero .qr-scan__frame {
        width: clamp(64px, 18vw, 80px);
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .qr-scan--floating {
        bottom: 5.5rem;
        left: 0.65rem;
    }
}

@media (min-width: 1024px) {
    .qr-scan--floating {
        display: none;
    }
}

@keyframes qr-glow-pulse {
    0%, 100% { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 0 0 rgba(245, 158, 11, 0); }
    50% { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 0 18px rgba(245, 158, 11, 0.35); }
}

@keyframes qr-scanline {
    0% { top: 8%; opacity: 0; }
    15% { opacity: 0.9; }
    85% { opacity: 0.9; }
    100% { top: 92%; opacity: 0; }
}

@keyframes qr-ping {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}
