/**
 * assets/css/preorder.css
 * 
 * Styling cho tính năng Pre-order / Đặt trước sản phẩm.
 * Bao gồm: Modal popup, Badge icon, Banner notice.
 * 
 * Tuân theo Design System La Chérie:
 * - Font: Plus Jakarta Sans / Inter
 * - Tone: Warm amber cho Pre-order notices
 * - Glassmorphism cho modal
 * 
 * @package Charm_Store_Child
 * @since   2.0.0
 * @date    2026-04-04
 */

/* ==========================================
   1. PREORDER BADGE (Icon ⏳ cạnh tên SP)
   ========================================== */

.charm-preorder-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: #92400e;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #fbbf24;
    border-radius: 20px;
    white-space: nowrap;
    vertical-align: middle;
}

/* Availability text trên trang SP */
.charm-preorder-availability {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #b45309 !important;
    background: #fffbeb;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid #fde68a;
    font-size: 13px;
    font-weight: 500;
}

/* ==========================================
   2. PREORDER BANNER (Đầu Cart / Checkout)
   ========================================== */

.charm-preorder-banner {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fbbf24;
    border-left: 4px solid #f59e0b;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1);
    animation: charmBannerFadeIn 0.4s ease-out;
}

.charm-preorder-banner-icon {
    font-size: 28px;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 2px;
}

.charm-preorder-banner-text strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 4px;
}

.charm-preorder-banner-text p {
    font-size: 13px;
    color: #b45309;
    margin: 0;
    line-height: 1.5;
}

@keyframes charmBannerFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   3. INLINE NOTICE (cạnh item trong cart)
   ========================================== */

.charm-preorder-notice-inline {
    font-size: 12px;
    color: #b45309;
    background: #fffbeb;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #fde68a;
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ==========================================
   4. MODAL POPUP
   ========================================== */

.charm-preorder-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none; /* JS controls this */
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Backdrop */
.charm-preorder-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.charm-preorder-modal--active .charm-preorder-modal-backdrop {
    opacity: 1;
}

/* Content Card */
.charm-preorder-modal-content {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    padding: 36px 32px 28px;
    max-width: 420px;
    width: 100%;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(245, 158, 11, 0.2);
    text-align: center;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.35s ease;
}

.charm-preorder-modal--active .charm-preorder-modal-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Icon */
.charm-preorder-modal-icon {
    font-size: 48px;
    margin-bottom: 12px;
    animation: charmModalIconBounce 0.5s ease-out 0.3s;
    animation-fill-mode: both;
}

@keyframes charmModalIconBounce {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    60% {
        transform: scale(1.1);
        opacity: 1;
    }
    100% {
        transform: scale(1);
    }
}

/* Title */
.charm-preorder-modal-title {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 12px;
}

/* Body */
.charm-preorder-modal-body {
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 24px;
}

.charm-preorder-modal-body strong {
    color: #b45309;
    font-weight: 700;
}

/* Actions */
.charm-preorder-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.charm-preorder-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 48px;
}

.charm-preorder-btn--confirm {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.charm-preorder-btn--confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.45);
}

.charm-preorder-btn--confirm:active {
    transform: translateY(0);
}

.charm-preorder-btn--cancel {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.charm-preorder-btn--cancel:hover {
    background: #e2e8f0;
    color: #475569;
}

/* ==========================================
   5. RESPONSIVE MOBILE
   ========================================== */

@media (max-width: 768px) {
    .charm-preorder-modal-content {
        padding: 28px 20px 24px;
        border-radius: 20px;
        margin: 0 16px;
    }

    .charm-preorder-modal-title {
        font-size: 18px;
    }

    .charm-preorder-modal-body {
        font-size: 13px;
    }

    .charm-preorder-btn {
        min-height: 44px;
        font-size: 14px;
    }

    .charm-preorder-banner {
        padding: 12px 14px;
        gap: 10px;
    }

    .charm-preorder-banner-icon {
        font-size: 22px;
    }

    .charm-preorder-banner-text strong {
        font-size: 13px;
    }

    .charm-preorder-banner-text p {
        font-size: 12px;
    }
}
