/**
 * OneStepOrder Marketing Features - Styles
 * Handles: Exit Intent Modals, Urgency Indicators, Product Comparison, Success Messages
 */

/* ==================== EXIT INTENT MODAL ==================== */

.exit-intent-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in-out;
}

.exit-intent-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

.exit-intent-content {
    position: relative;
    background: white;
    border-radius: 24px;
    padding: 48px 40px;
    max-width: 520px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: slideUp 0.4s ease-out;
}

.exit-intent-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.exit-intent-close:hover {
    background: #f5f5f5;
    color: #333;
    transform: rotate(90deg);
}

.exit-intent-icon {
    font-size: 72px;
    margin-bottom: 24px;
    animation: bounce 0.6s ease-in-out;
}

.exit-intent-title {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 16px;
    line-height: 1.2;
}

.exit-intent-message {
    font-size: 18px;
    color: #666;
    margin-bottom: 32px;
    line-height: 1.6;
}

.exit-intent-code {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 32px;
}

.exit-intent-code .code-label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.exit-intent-code .code-value {
    display: block;
    color: white;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 2px;
    font-family: 'Courier New', monospace;
}

.exit-intent-accept {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    margin-bottom: 12px;
}

.exit-intent-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.exit-intent-dismiss {
    display: block;
    width: 100%;
    background: transparent;
    color: #999;
    border: none;
    padding: 12px;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s;
}

.exit-intent-dismiss:hover {
    color: #666;
}

.exit-intent-success {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #10b981;
    color: white;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
    z-index: 1000000;
    animation: slideDown 0.3s ease-out;
}

/* ==================== URGENCY INDICATORS ==================== */

.urgency-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    margin: 8px 0;
    animation: fadeIn 0.3s ease-in-out;
}

.urgency-indicator.urgency-badge {
    display: inline-flex;
}

.urgency-indicator.urgency-banner {
    display: flex;
    width: 100%;
    justify-content: center;
    padding: 12px;
    margin-bottom: 16px;
}

.urgency-indicator.urgency-inline {
    display: inline-flex;
    margin-left: 8px;
}

/* Urgency types */
.urgency-limited_stock {
    background: linear-gradient(135deg, #fef3c7 0%, #fcd34d 100%);
    color: #92400e;
    border: 1px solid #fbbf24;
}

.urgency-viewer_count {
    background: linear-gradient(135deg, #fee2e2 0%, #fca5a5 100%);
    color: #991b1b;
    border: 1px solid #ef4444;
}

.urgency-recent_purchases {
    background: linear-gradient(135deg, #d1fae5 0%, #6ee7b7 100%);
    color: #065f46;
    border: 1px solid #10b981;
}

.urgency-limited_time {
    background: linear-gradient(135deg, #e0e7ff 0%, #a5b4fc 100%);
    color: #3730a3;
    border: 1px solid #6366f1;
}

.urgency-price_increase {
    background: linear-gradient(135deg, #ffe4e6 0%, #fda4af 100%);
    color: #9f1239;
    border: 1px solid #f43f5e;
}

.urgency-static {
    background: linear-gradient(135deg, #e0f2fe 0%, #7dd3fc 100%);
    color: #075985;
    border: 1px solid #0284c7;
}

.urgency-icon {
    font-size: 16px;
}

.urgency-text {
    font-size: 13px;
}

/* Pulse animation for high-priority urgency */
.urgency-indicator.urgency-limited_stock,
.urgency-indicator.urgency-viewer_count {
    animation: pulse 2s ease-in-out infinite;
}

/* ==================== PRODUCT COMPARISON ==================== */

.compare-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.compare-btn:hover {
    border-color: #6366f1;
    color: #6366f1;
    background: #f5f3ff;
}

.compare-btn.active {
    background: #6366f1;
    border-color: #6366f1;
    color: white;
}

.compare-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: white;
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    animation: slideUp 0.3s ease-out;
}

.compare-widget.hidden {
    display: none;
}

.compare-widget-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.compare-count {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.compare-view-btn {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.compare-view-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.compare-clear-btn {
    background: transparent;
    color: #9ca3af;
    border: none;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
}

.compare-clear-btn:hover {
    color: #6b7280;
}

/* ==================== COMPARISON MODAL ==================== */

.comparison-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in-out;
}

.comparison-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

.comparison-content {
    position: relative;
    background: white;
    border-radius: 24px;
    padding: 32px;
    max-width: 1200px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease-out;
}

.comparison-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.comparison-close:hover {
    background: #f5f5f5;
    color: #333;
    transform: rotate(90deg);
}

.comparison-content h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 24px;
    text-align: center;
}

.comparison-table {
    overflow-x: auto;
}

.comparison-table table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.comparison-table th {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    border: none;
}

.comparison-table th:first-child {
    border-top-left-radius: 12px;
}

.comparison-table th:last-child {
    border-top-right-radius: 12px;
}

.comparison-table td {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    color: #374151;
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

.comparison-table tr:nth-child(even) {
    background: #f9fafb;
}

.comparison-table td:first-child {
    font-weight: 600;
    color: #1f2937;
}

/* ==================== ANIMATIONS ==================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.85;
    }
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
    .exit-intent-content {
        padding: 32px 24px;
        max-width: 90%;
    }

    .exit-intent-title {
        font-size: 24px;
    }

    .exit-intent-message {
        font-size: 16px;
    }

    .compare-widget {
        bottom: 16px;
        right: 16px;
        left: 16px;
    }

    .compare-widget-content {
        flex-direction: column;
        gap: 12px;
    }

    .compare-view-btn,
    .compare-clear-btn {
        width: 100%;
    }

    .comparison-content {
        padding: 24px 16px;
        max-width: 95%;
    }

    .comparison-table {
        font-size: 12px;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 12px 8px;
    }
}

/* ==================== SMART RECOMMENDATIONS ==================== */

.recommendations-widget {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin: 24px 0;
}

.recommendations-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px 0;
}

.recommendations-header p {
    font-size: 14px;
    color: #666;
    margin: 0 0 20px 0;
}

.recommendations-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.recommendation-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.recommendation-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    border-color: #007bff;
}

.rec-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.recommendation-card h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 12px 0;
}

.rec-description {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin: 0 0 16px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rec-pricing {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.rec-discount {
    background: #28a745;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
}

.rec-price {
    font-size: 18px;
    font-weight: 700;
    color: #007bff;
}

.add-recommendation {
    width: 100%;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: #007bff;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-recommendation:hover {
    background: #0056b3;
    transform: scale(1.02);
}

/* ==================== TRUST BADGES ==================== */

.trust-badges-container {
    padding: 24px 0;
    margin: 24px 0;
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
}

.trust-badges-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
}

.trust-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.trust-badge:hover {
    opacity: 1;
}

.trust-badge img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.trust-badge span {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-align: center;
}

/* ==================== SOCIAL PROOF POPUP ==================== */

.social-proof-popup {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    animation: slideInLeft 0.4s ease-out;
    max-width: 360px;
    transition: opacity 0.3s ease;
}

.social-proof-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.social-proof-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.social-proof-message {
    flex: 1;
    font-size: 13px;
    line-height: 1.5;
}

.social-proof-message strong {
    color: #1a1a1a;
    font-weight: 600;
}

.social-proof-message .text-sm {
    color: #666;
    font-size: 12px;
}

.social-proof-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s ease;
}

.social-proof-close:hover {
    color: #333;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==================== TESTIMONIALS ==================== */

.testimonials-widget {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 16px;
    padding: 32px 24px;
    margin: 24px 0;
}

.testimonials-widget h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    text-align: center;
    margin: 0 0 24px 0;
}

.testimonials-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.testimonial-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.testimonial-rating {
    font-size: 16px;
    margin-bottom: 12px;
}

.testimonial-text {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    margin: 0 0 16px 0;
    font-style: italic;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.testimonial-author strong {
    color: #1a1a1a;
}

.verified-badge {
    background: #28a745;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* ==================== ONE-CLICK UPSELLS ==================== */

.upsell-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-in-out;
}

.upsell-modal {
    position: relative;
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease-out;
    overflow: hidden;
}

.upsell-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px 32px;
    position: relative;
}

.upsell-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.upsell-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upsell-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.upsell-body {
    padding: 32px;
}

.upsell-body h3 {
    font-size: 22px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 12px 0;
}

.upsell-body>p {
    font-size: 15px;
    color: #666;
    line-height: 1.6;
    margin: 0 0 24px 0;
}

.upsell-products {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.upsell-product {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    transition: border-color 0.3s ease;
}

.upsell-product:hover {
    border-color: #667eea;
}

.upsell-product h4 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 12px 0;
}

.upsell-pricing {
    display: flex;
    align-items: center;
    gap: 12px;
}

.upsell-pricing .original-price {
    font-size: 16px;
    color: #999;
    text-decoration: line-through;
}

.upsell-pricing .discount-price {
    font-size: 24px;
    font-weight: 700;
    color: #28a745;
}

.upsell-pricing .discount-badge {
    background: #28a745;
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.upsell-pricing .price {
    font-size: 24px;
    font-weight: 700;
    color: #007bff;
}

.upsell-footer {
    background: #f8f9fa;
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
}

.btn-accept-upsell {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-accept-upsell:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
}

.btn-accept-upsell:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-decline-upsell {
    background: transparent;
    border: none;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    padding: 8px;
    text-align: center;
    transition: color 0.2s ease;
}

.btn-decline-upsell:hover {
    color: #333;
    text-decoration: underline;
}

.upsell-success {
    text-align: center;
    padding: 40px 20px;
}

.upsell-success h3 {
    color: #28a745;
    font-size: 28px;
    margin-bottom: 12px;
}

.upsell-success p {
    font-size: 16px;
    color: #666;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
    .recommendations-list {
        grid-template-columns: 1fr;
    }

    .testimonials-list {
        grid-template-columns: 1fr;
    }

    .trust-badges-wrapper {
        gap: 20px;
    }

    .social-proof-popup {
        bottom: 10px;
        left: 10px;
        right: 10px;
        max-width: none;
    }

    .upsell-modal {
        width: 95%;
    }

    .upsell-header,
    .upsell-body,
    .upsell-footer {
        padding: 20px;
    }
}

/* ==================== PHASE 3: DYNAMIC PRICING & BUNDLE BUILDER ==================== */

/* Countdown Timer */
.countdown-timer {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
}

.countdown-segment {
    text-align: center;
    min-width: 60px;
}

.countdown-value {
    font-size: 32px;
    font-weight: 700;
    color: #dc3545;
    display: block;
    line-height: 1;
}

.countdown-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #6c757d;
    margin-top: 4px;
    display: block;
}

.countdown-separator {
    font-size: 24px;
    color: #dc3545;
    font-weight: 700;
}

/* Flash Sale Banner */
.flash-sales-banner {
    background: linear-gradient(135deg, #ff0000 0%, #ff6b00 100%);
    color: #fff;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(255, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.flash-sales-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 2s ease-in-out infinite;
}

.flash-sales-content {
    position: relative;
    z-index: 1;
}

.flash-icon {
    font-size: 48px;
    margin-bottom: 12px;
    animation: flash-pulse 1s infinite;
}

@keyframes flash-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.flash-sales-banner h3 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.flash-sales-banner p {
    font-size: 16px;
    margin: 0 0 16px 0;
    opacity: 0.95;
}

.flash-countdown {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 16px;
}

.flash-countdown-segment {
    background: rgba(255, 255, 255, 0.2);
    padding: 12px 16px;
    border-radius: 8px;
    text-align: center;
    min-width: 80px;
}

.flash-countdown-value {
    font-size: 36px;
    font-weight: 700;
    display: block;
    line-height: 1;
}

.flash-countdown-label {
    font-size: 12px;
    text-transform: uppercase;
    opacity: 0.9;
    margin-top: 4px;
}

.flash-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 2;
}

.flash-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Discount Badge */
.discount-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Bundle Builder Container */
.bundle-builder-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 32px;
    border-radius: 16px;
    margin-bottom: 32px;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
}

.bundle-header {
    text-align: center;
    color: #fff;
    margin-bottom: 24px;
}

.bundle-header h3 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 8px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.bundle-header p {
    font-size: 16px;
    opacity: 0.95;
    margin: 0;
}

.bundle-templates {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.bundle-template-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bundle-template-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.bundle-badge {
    position: absolute;
    top: -10px;
    right: 20px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.bundle-template-card h4 {
    font-size: 20px;
    font-weight: 700;
    margin: 8px 0 12px 0;
    color: #2d3748;
}

.bundle-template-card p {
    font-size: 14px;
    color: #718096;
    margin: 0 0 16px 0;
    line-height: 1.6;
}

.bundle-details {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #4a5568;
}

.start-bundle {
    width: 100%;
    padding: 12px;
    font-weight: 600;
    border-radius: 8px;
}

/* Bundle Builder Modal */
.bundle-builder-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bundle-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.bundle-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    max-width: 1000px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.bundle-modal-header {
    padding: 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bundle-modal-header h3 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: #2d3748;
}

.bundle-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #a0aec0;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    line-height: 1;
}

.bundle-close:hover {
    color: #2d3748;
}

.bundle-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.bundle-progress {
    background: #edf2f7;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #4a5568;
}

.bundle-progress strong {
    color: #667eea;
    font-weight: 700;
}

.bundle-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.bundle-product-card {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s ease;
}

.bundle-product-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.15);
}

.bundle-product-card img {
    width: 100%;
    height: 120px;
    object-fit: contain;
    margin-bottom: 12px;
    border-radius: 8px;
}

.bundle-product-card h5 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #2d3748;
}

.bundle-product-card .product-description {
    font-size: 13px;
    color: #718096;
    margin: 0 0 12px 0;
    line-height: 1.4;
    min-height: 40px;
}

.bundle-product-card .product-price {
    font-size: 18px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 12px;
}

.toggle-product {
    width: 100%;
    padding: 10px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.toggle-product.selected {
    background: #48bb78;
    border-color: #48bb78;
    color: #fff;
}

.bundle-modal-footer {
    padding: 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.bundle-pricing-summary {
    flex: 1;
}

.bundle-pricing-summary>div {
    margin-bottom: 8px;
}

.original-price {
    font-size: 14px;
    color: #a0aec0;
    text-decoration: line-through;
}

.discounted-price {
    font-size: 24px;
    font-weight: 700;
    color: #2d3748;
}

.savings {
    font-size: 18px;
    font-weight: 600;
    color: #48bb78;
}

.save-bundle {
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 10px;
    white-space: nowrap;
}

.save-bundle:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Bundle Success State */
.bundle-success {
    text-align: center;
    padding: 60px 40px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: #48bb78;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin: 0 auto 24px;
    animation: success-pop 0.5s ease-out;
}

@keyframes success-pop {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.bundle-success h3 {
    font-size: 28px;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 12px 0;
}

.bundle-success p {
    font-size: 16px;
    color: #718096;
    margin: 0 0 24px 0;
}

.savings-highlight {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: #fff;
    padding: 20px;
    border-radius: 12px;
    font-size: 24px;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(72, 187, 120, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .countdown-timer {
        gap: 8px;
    }

    .countdown-segment {
        min-width: 50px;
    }

    .countdown-value {
        font-size: 24px;
    }

    .flash-countdown {
        gap: 12px;
    }

    .flash-countdown-segment {
        min-width: 60px;
        padding: 10px 12px;
    }

    .flash-countdown-value {
        font-size: 28px;
    }

    .bundle-templates {
        grid-template-columns: 1fr;
    }

    .bundle-products-grid {
        grid-template-columns: 1fr;
    }

    .bundle-modal-footer {
        flex-direction: column;
    }

    .save-bundle {
        width: 100%;
    }
}

/* ==================== PHASE 4: LOYALTY & REWARDS ==================== */

.loyalty-widget {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 24px;
    color: white;
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.loyalty-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.loyalty-icon {
    font-size: 48px;
    line-height: 1;
}

.loyalty-info {
    flex: 1;
}

.loyalty-tier {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tier-name {
    text-transform: uppercase;
    letter-spacing: 1px;
}

.loyalty-points {
    font-size: 16px;
    opacity: 0.9;
}

.loyalty-points strong {
    font-size: 28px;
    font-weight: 700;
}

.loyalty-progress {
    margin-bottom: 20px;
}

.progress-bar {
    height: 12px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd700 0%, #ffed4e 100%);
    border-radius: 6px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.progress-text {
    font-size: 14px;
    opacity: 0.9;
    text-align: center;
}

.loyalty-actions {
    display: flex;
    gap: 12px;
}

.btn-loyalty-rewards,
.btn-redeem-points {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid white;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-loyalty-rewards:hover,
.btn-redeem-points:hover {
    background: white;
    color: #667eea;
    transform: translateY(-2px);
}

/* Loyalty Modal */
.loyalty-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    animation: fadeIn 0.3s ease;
}

.loyalty-modal {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.loyalty-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.loyalty-modal-header h3 {
    margin: 0;
    font-size: 24px;
}

.loyalty-modal .close-modal {
    background: transparent;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
}

.loyalty-modal-body {
    padding: 24px;
    max-height: calc(80vh - 100px);
    overflow-y: auto;
}

.reward-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.reward-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.reward-card.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.reward-icon {
    font-size: 40px;
}

.reward-info {
    flex: 1;
}

.reward-info h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #333;
}

.reward-info p {
    margin: 0 0 8px 0;
    color: #666;
    font-size: 14px;
}

.reward-cost {
    font-weight: 700;
    color: #667eea;
    font-size: 16px;
}

.reward-card .btn-redeem {
    padding: 10px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.reward-card .btn-redeem:hover {
    transform: translateY(-2px);
}

.reward-card .btn-redeem:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== PHASE 5: EMAIL AUTOMATION ==================== */

/* Email widget is mostly invisible - no UI needed */
/* Email preferences could be added later if needed */

.email-preferences-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
}

.email-preferences-content {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
}

.email-campaign-badge {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

/* ==================== PHASE 5: ANALYTICS DASHBOARD ==================== */

/* Analytics widget is invisible - tracking only */
/* Heatmap overlay for admin view (optional) */

.analytics-heatmap-overlay {
    display: none;
    /* Hidden by default - only shown in admin mode */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 9999;
}

.analytics-heatmap-overlay.active {
    display: block;
}

.heatmap-point {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 0, 0, 0.6) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* Analytics tracking indicator (optional debug mode) */
.analytics-tracking-indicator {
    position: fixed;
    bottom: 10px;
    right: 10px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 8px;
    font-size: 12px;
    z-index: 999999;
    display: none;
}

.analytics-tracking-indicator.active {
    display: block;
}

/* ==================== RESPONSIVE ADJUSTMENTS (PHASE 4 & 5) ==================== */

@media (max-width: 768px) {
    .loyalty-widget {
        padding: 16px;
    }

    .loyalty-icon {
        font-size: 36px;
    }

    .loyalty-tier {
        font-size: 16px;
    }

    .loyalty-points strong {
        font-size: 22px;
    }

    .loyalty-actions {
        flex-direction: column;
    }

    .btn-loyalty-rewards,
    .btn-redeem-points {
        width: 100%;
    }

    .reward-card {
        flex-direction: column;
        text-align: center;
    }

    .reward-card .btn-redeem {
        width: 100%;
    }
}