/**
 * Marketing Features - CSS Styles
 * Team Vavory Shop
 */

/* ================================
   EXIT-INTENT POPUP
   ================================ */
.exit-popup {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.exit-popup__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

.exit-popup__content {
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #16162a 100%);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 20px;
    padding: 3rem 2rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s ease;
}

.exit-popup__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--color-text);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.exit-popup__close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.exit-popup__icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 1s infinite;
}

.exit-popup__content h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #ff44cc, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.exit-popup__content p {
    color: var(--color-muted);
    font-size: 1.125rem;
    margin-bottom: 2rem;
}

.exit-popup__content p strong {
    color: var(--color-accent);
    font-size: 1.5rem;
}

.exit-popup__form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.exit-popup__form input {
    padding: 1rem;
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    color: var(--color-text);
    font-size: 1rem;
    text-align: center;
}

.exit-popup__form input:focus {
    outline: none;
    border-color: var(--color-accent);
    background: rgba(139, 92, 246, 0.1);
}

.exit-popup__form button {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.exit-popup__note {
    margin-top: 1rem;
    font-size: 0.75rem !important;
    color: rgba(255, 255, 255, 0.5) !important;
}

.exit-popup__success {
    padding: 1rem 0;
}

.exit-popup__code {
    background: rgba(139, 92, 246, 0.1);
    border: 2px dashed var(--color-accent);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    font-size: 1.5rem !important;
}

.exit-popup__code strong {
    font-family: 'Courier New', monospace;
    color: var(--color-accent);
    font-size: 2rem;
    letter-spacing: 2px;
}

/* ================================
   FREE SHIPPING BAR
   ================================ */
.free-shipping-bar {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(34, 211, 238, 0.1));
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    padding: 0.75rem 0;
    position: sticky;
    top: var(--header-height, 60px);
    z-index: 90;
    backdrop-filter: blur(10px);
}

.free-shipping-bar__content {
    text-align: center;
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.free-shipping-bar__content strong {
    color: var(--color-accent);
    font-weight: 700;
}

.free-shipping-bar__progress {
    max-width: 600px;
    margin: 0 auto;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.free-shipping-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, #ff44cc, #8b5cf6, #22d3ee);
    border-radius: 3px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

/* ================================
   SCARCITY INDICATORS
   ================================ */
.scarcity-indicator {
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.scarcity-indicator--critical {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    display: inline-block;
    animation: pulse 2s infinite;
}

.scarcity-indicator--low {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    display: inline-block;
}

.scarcity-indicator--sold-out {
    color: #6b7280;
    background: rgba(107, 114, 128, 0.1);
    border: 1px solid rgba(107, 114, 128, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    display: inline-block;
}

/* ================================
   COUNTDOWN TIMER
   ================================ */
.countdown-timer {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.1));
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    margin: 1rem 0;
}

.countdown-timer__unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 50px;
}

.countdown-timer__value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fca5a5;
    font-family: 'Courier New', monospace;
}

.countdown-timer__label {
    font-size: 0.75rem;
    color: var(--color-muted);
    text-transform: uppercase;
    margin-top: 0.25rem;
}

.countdown-timer__separator {
    font-size: 1.5rem;
    color: var(--color-muted);
    margin: 0 0.25rem;
}

.countdown-ended {
    color: #6b7280;
    font-weight: 600;
}

/* ================================
   RECENTLY VIEWED
   ================================ */
.recently-viewed {
    margin: 3rem 0;
    padding: 2rem 0;
    border-top: 1px solid var(--color-border);
}

.recently-viewed__title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.recently-viewed__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.recently-viewed__item {
    text-decoration: none;
    color: var(--color-text);
    transition: transform 0.2s;
}

.recently-viewed__item:hover {
    transform: translateY(-4px);
}

.recently-viewed__item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
}

.recently-viewed__name {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recently-viewed__price {
    font-weight: 700;
    color: var(--color-accent);
}

/* ================================
   LIVE SALES NOTIFICATION
   ================================ */
.live-notification {
    position: fixed;
    bottom: -100px;
    left: 20px;
    background: linear-gradient(135deg, #1a1a2e, #16162a);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    max-width: 350px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    transition: bottom 0.3s ease;
}

.live-notification--show {
    bottom: 20px;
}

.live-notification__icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.live-notification__content {
    flex: 1;
}

.live-notification__text {
    font-size: 0.875rem;
    line-height: 1.4;
    margin-bottom: 0.25rem;
}

.live-notification__text strong {
    color: var(--color-accent);
}

.live-notification__time {
    font-size: 0.75rem;
    color: var(--color-muted);
}

/* ================================
   ANIMATIONS
   ================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* ================================
   RESPONSIVE
   ================================ */
@media (max-width: 768px) {
    .exit-popup__content {
        padding: 2rem 1.5rem;
    }
    
    .exit-popup__icon {
        font-size: 3rem;
    }
    
    .free-shipping-bar {
        padding: 0.5rem 1rem;
    }
    
    .free-shipping-bar__content {
        font-size: 0.8125rem;
    }
    
    .countdown-timer {
        gap: 0.25rem;
    }
    
    .countdown-timer__unit {
        min-width: 40px;
    }
    
    .countdown-timer__value {
        font-size: 1.25rem;
    }
    
    .live-notification {
        left: 10px;
        right: 10px;
        max-width: none;
        bottom: -100px;
    }
    
    .live-notification--show {
        bottom: 10px;
    }
    
    .recently-viewed__grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

@media (max-width: 480px) {
    .exit-popup__form {
        gap: 0.75rem;
    }
    
    .exit-popup__form input,
    .exit-popup__form button {
        padding: 0.875rem;
        font-size: 0.9375rem;
    }
    
    .countdown-timer__unit {
        min-width: 35px;
    }
    
    .countdown-timer__value {
        font-size: 1rem;
    }
    
    .countdown-timer__label {
        font-size: 0.625rem;
    }
}
