/* ===================================
   CHECKOUT ENHANCEMENTS - PHASE 1 & 2
   High-Conversion Beauty Checkout
   Created: January 17, 2026
   =================================== */

/* ===================================
   PHASE 1: COLOR SYSTEM OVERHAUL
   =================================== */

:root {
    /* Luxury + Conversion Color System */
    --primary-luxury: #3A2F2A;      /* Deep Mocha */
    --secondary-beauty: #E6B7B7;     /* Soft Blush */
    --accent-gold: #C89B5E;          /* Warm Gold - CTAs */
    --success-green: #2E7D32;        /* Savings */
    --background-cream: #FBF8F5;     /* Off-white */
    --urgent-red: #D32F2F;           /* Scarcity */
    --celebration-bg: linear-gradient(135deg, #FFF8E1 0%, #FFE0B2 100%);
    
    /* Shadows for depth */
    --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-strong: 0 8px 24px rgba(0, 0, 0, 0.16);
    --shadow-gold: 0 4px 12px rgba(200, 155, 94, 0.3);
}

/* ===================================
   PHASE 1.1: OFFER CELEBRATION CARD
   =================================== */

.offer-celebration {
    position: relative;
    background: var(--celebration-bg);
    border: 2px solid var(--accent-gold);
    border-radius: 16px;
    padding: 24px;
    margin: 24px 0;
    text-align: center;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
    animation: celebrationPulse 2s ease-in-out infinite;
}

@keyframes celebrationPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.offer-celebration::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(200, 155, 94, 0.1) 0%, transparent 70%);
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.offer-celebration-content {
    position: relative;
    z-index: 1;
}

.offer-celebration-icon {
    font-size: 48px;
    margin-bottom: 12px;
    animation: bounce 1s ease-in-out infinite;
}

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

.offer-celebration-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-luxury);
    margin-bottom: 8px;
}

.offer-celebration-subtitle {
    font-size: 16px;
    color: #666;
    margin-bottom: 16px;
}

.savings-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--success-green), #1B5E20);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 20px;
    font-weight: 700;
    box-shadow: var(--shadow-gold);
    animation: badgePop 0.5s ease-out;
}

@keyframes badgePop {
    0% { transform: scale(0); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.savings-amount {
    font-size: 32px;
    font-weight: 800;
    color: var(--success-green);
    margin: 16px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Confetti Animation */
.confetti-burst {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--accent-gold);
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100%) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(400%) rotate(720deg);
        opacity: 0;
    }
}

/* ===================================
   PHASE 1.2: EMOTIONAL PRICE SUMMARY
   =================================== */

.price-summary-enhanced {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-medium);
    margin: 24px 0;
}

.price-summary-enhanced h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-luxury);
    margin-bottom: 20px;
    text-align: center;
}

.summary-row-enhanced {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    font-size: 16px;
}

.summary-row-enhanced.subtotal {
    color: #666;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
}

.summary-row-enhanced.savings {
    color: var(--success-green);
    font-weight: 700;
    font-size: 18px;
    padding: 16px 0;
    border-bottom: 2px solid #f0f0f0;
    animation: highlightSavings 2s ease-in-out infinite;
}

@keyframes highlightSavings {
    0%, 100% { background-color: transparent; }
    50% { background-color: rgba(46, 125, 50, 0.05); }
}

.summary-row-enhanced.savings .amount {
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-row-enhanced.savings .icon {
    font-size: 20px;
}

.summary-row-enhanced.total {
    padding-top: 16px;
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-luxury);
}

.summary-row-enhanced.total .amount {
    color: var(--accent-gold);
    display: flex;
    align-items: center;
    gap: 8px;
}

.celebration-message {
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
    border-left: 4px solid var(--success-green);
    border-radius: 8px;
    padding: 16px;
    margin-top: 20px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: var(--success-green);
    animation: slideInUp 0.5s ease-out;
}

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

/* ===================================
   PHASE 1.3: ENHANCED CTA BUTTONS
   =================================== */

.btn-book-enhanced {
    background: linear-gradient(135deg, var(--accent-gold), #a67c52);
    color: white;
    border: none;
    padding: 18px 48px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-gold);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.btn-book-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-book-enhanced:hover::before {
    left: 100%;
}

.btn-book-enhanced:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(200, 155, 94, 0.5);
}

.btn-book-enhanced:active {
    transform: translateY(-2px);
}

.btn-book-enhanced .btn-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.btn-book-enhanced .price-in-btn {
    font-size: 22px;
    font-weight: 800;
}

/* ===================================
   PHASE 1.4: STICKY MOBILE CTA BAR
   =================================== */

.sticky-checkout-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: linear-gradient(135deg, var(--accent-gold), #a67c52);
    padding: 16px 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideInFromBottom 0.5s ease-out;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.sticky-checkout-bar.hidden {
    transform: translateY(120%);
}

@keyframes slideInFromBottom {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.sticky-checkout-bar .price-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sticky-checkout-bar .price-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sticky-checkout-bar .price {
    font-size: 28px;
    font-weight: 800;
    color: white;
    line-height: 1;
}

.sticky-checkout-bar .btn-book-sticky {
    background: white;
    color: var(--accent-gold);
    padding: 14px 32px;
    border-radius: 8px;
    border: none;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sticky-checkout-bar .btn-book-sticky:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sticky-checkout-bar .btn-book-sticky:active {
    transform: scale(0.98);
}

/* Hide on desktop, show on mobile/tablet */
@media (min-width: 769px) {
    .sticky-checkout-bar {
        display: none;
    }
}

/* ===================================
   PHASE 2: COUNTDOWN TIMER (URGENCY)
   =================================== */

.offer-urgency {
    background: linear-gradient(135deg, #FFEBEE, #FFCDD2);
    border: 2px solid var(--urgent-red);
    border-radius: 12px;
    padding: 16px 24px;
    margin: 20px 0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: var(--shadow-soft);
    animation: urgencyPulse 1.5s ease-in-out infinite;
}

@keyframes urgencyPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0); }
    50% { box-shadow: 0 0 0 8px rgba(211, 47, 47, 0.2); }
}

.offer-urgency .timer-icon {
    font-size: 24px;
    animation: tick 1s ease-in-out infinite;
}

@keyframes tick {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.offer-urgency .timer-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--urgent-red);
}

.offer-urgency .countdown {
    font-size: 20px;
    font-weight: 800;
    color: var(--urgent-red);
    font-family: 'Courier New', monospace;
    background: white;
    padding: 4px 12px;
    border-radius: 6px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ===================================
   PHASE 2: ANIMATED SAVINGS COUNTER
   =================================== */

.savings-counter {
    font-size: 32px;
    font-weight: 800;
    color: var(--success-green);
    transition: all 0.3s ease;
}

.savings-counter.counting {
    animation: countAnimation 1s ease-out;
}

@keyframes countAnimation {
    0% {
        transform: scale(1.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===================================
   PHASE 2.3: AUTO-APPLY BEST OFFER
   =================================== */

.auto-apply-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
    color: var(--success-green);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.auto-apply-badge .sparkle {
    font-size: 16px;
    animation: sparkle 1.5s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.manual-code-toggle {
    margin-top: 16px;
    text-align: center;
}

.manual-code-toggle button {
    background: none;
    border: none;
    color: var(--accent-gold);
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.manual-code-toggle button:hover {
    color: var(--primary-luxury);
}

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

@media (max-width: 768px) {
    .offer-celebration {
        padding: 20px 16px;
    }
    
    .offer-celebration-title {
        font-size: 20px;
    }
    
    .savings-badge {
        font-size: 18px;
        padding: 10px 20px;
    }
    
    .savings-amount {
        font-size: 28px;
    }
    
    .btn-book-enhanced {
        width: 100%;
        padding: 16px 24px;
        font-size: 16px;
    }
    
    .summary-row-enhanced.total {
        font-size: 20px;
    }
    
    .price-summary-enhanced {
        padding: 20px 16px;
    }
    
    /* Add bottom padding to content when sticky bar is visible */
    body.sticky-bar-visible .wishlist-container,
    body.sticky-bar-visible .offers-container {
        padding-bottom: 100px;
    }
}

@media (max-width: 480px) {
    .sticky-checkout-bar {
        padding: 12px 16px;
    }
    
    .sticky-checkout-bar .price {
        font-size: 24px;
    }
    
    .sticky-checkout-bar .btn-book-sticky {
        padding: 12px 24px;
        font-size: 14px;
    }
    
    .offer-urgency {
        flex-direction: column;
        gap: 8px;
    }
    
    .countdown {
        font-size: 18px !important;
    }
}

/* ===================================
   ACCESSIBILITY
   =================================== */

.btn-book-enhanced:focus,
.sticky-checkout-bar .btn-book-sticky:focus {
    outline: 3px solid var(--accent-gold);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===================================
   PRINT STYLES
   =================================== */

@media print {
    .sticky-checkout-bar,
    .confetti-burst,
    .offer-urgency {
        display: none !important;
    }
}
