/* ==========================================================================
   TIKDIWASTORE — CUTE LIQUID GLASS MODALS, ALERTS & ORDER FLOW UI
   ========================================================================== */

/* พื้นหลัง Overlay เบลอละมุนแบบ Liquid Glass + ล็อกไม่ให้หน้าเว็บด้านหลังเลื่อน (body:has(.liquid-overlay.open)) */
body:has(.liquid-overlay.open),
body.modal-open {
    overflow: hidden !important;
}

.liquid-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(35, 18, 28, 0.36);
    backdrop-filter: blur(8px) saturate(140%);
    -webkit-backdrop-filter: blur(8px) saturate(140%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    overscroll-behavior: contain;
    will-change: opacity;
    transition: opacity 0.14s ease-out, visibility 0.14s ease-out;
}

.liquid-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ตัวกล่อง Cute Liquid Glass Modal (แยกชัดเจน: บน Desktop กว้าง 2 คอลัมน์ไม่ต้องเลื่อนยาว / บน Mobile เรียงแนวตั้งพอดีจอ) */
.liquid-modal {
    width: 100%;
    max-width: 470px;
    max-height: 92vh;
    overflow-y: auto;
    border-radius: 28px;
    background: linear-gradient(
        160deg,
        rgba(255, 255, 255, 0.96) 0%,
        rgba(255, 246, 250, 0.95) 50%,
        rgba(255, 255, 255, 0.98) 100%
    );
    border: 1.5px solid rgba(255, 255, 255, 0.92);
    box-shadow:
        0 20px 48px -10px rgba(37, 105, 255, 0.24),
        0 0 0 1px rgba(142, 197, 255, 0.5),
        inset 0 2px 4px rgba(255, 255, 255, 0.95);
    padding: 18px 22px;
    position: relative;
    will-change: transform, opacity;
    transform: scale(0.95) translateY(8px);
    transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1);
    scrollbar-width: thin;
}

.liquid-modal.wide-desktop {
    max-width: 890px;
    padding: 16px 22px;
}

.modal-two-col {
    display: grid;
    grid-template-columns: 1.06fr 1fr;
    gap: 18px;
    align-items: start;
}

.modal-col-left,
.modal-col-right {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.liquid-overlay.open .liquid-modal {
    transform: scale(1) translateY(0);
}

/* แสงสะท้อนหยดน้ำด้านบนกล่อง */
.liquid-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent);
    border-radius: 99px;
    pointer-events: none;
}

.modal-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.modal-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(142, 197, 255, 0.6);
    background: rgba(255, 255, 255, 0.75);
    color: var(--text-main);
    font-size: 1.15rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close-btn:hover {
    background: var(--pink-soft);
    color: var(--pink-primary);
    transform: rotate(90deg);
}

.modal-header-title {
    font-size: 1.22rem;
    font-weight: 800;
    color: var(--text-main);
}

/* ==================== 3-STEP PROGRESS BAR ==================== */
.step-progress-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    margin: 0 12px 20px;
}

.step-progress-line {
    position: absolute;
    top: 15px;
    left: 24px;
    right: 24px;
    height: 2.5px;
    background: #EADCE2;
    z-index: 1;
}

.step-node {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #EADCE2;
    color: #7B6B74;
    font-weight: 700;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #FFFFFF;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.25s;
}

.step-node.active .step-circle,
.step-node.done .step-circle {
    background: var(--pink-primary);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(37, 105, 255, 0.35);
}

.step-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
}

.step-node.active .step-label {
    color: var(--pink-primary);
    font-weight: 700;
}

/* ==================== SELECTED PRODUCT BANNER IN MODAL ==================== */
.selected-sticker-box {
    background: linear-gradient(135deg, rgba(252, 228, 236, 0.85) 0%, rgba(255, 240, 245, 0.9) 100%);
    border: 1px solid rgba(142, 197, 255, 0.75);
    border-radius: 18px;
    padding: 11px 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}

.selected-sticker-img {
    width: 62px;
    height: 62px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 14px;
    padding: 5px;
    flex-shrink: 0;
}

.selected-sticker-name {
    font-size: 1.08rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 2px;
}

.selected-sticker-price {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-main);
}

/* ==================== STICKER PREVIEW GALLERY IN MODAL ==================== */
.sticker-preview-drawer {
    background: rgba(255, 255, 255, 0.78);
    border: 1.5px solid rgba(142, 197, 255, 0.65);
    border-radius: 18px;
    padding: 10px 12px;
    margin-bottom: 0;
}

.sticker-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--pink-primary);
    margin-bottom: 8px;
}

.sticker-preview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: max-content;
    align-content: start;
    align-items: start;
    gap: 8px;
    max-height: 255px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 4px 6px 4px 3px;
    scrollbar-width: thin;
}

.sticker-preview-cell {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    min-height: 70px;
    background: #FFFFFF;
    border: 1px solid #F3E8EE;
    border-radius: 14px;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    box-sizing: border-box;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sticker-preview-grid.theme-mode {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: max-content;
    max-height: 410px;
    gap: 10px;
}

.sticker-preview-cell.theme-cell {
    width: 100%;
    height: auto;
    aspect-ratio: 9 / 16;
    min-height: 210px;
    padding: 4px;
    border-radius: 16px;
    overflow: hidden;
}

.sticker-preview-cell.theme-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    display: block;
}

.sticker-preview-cell:hover,
.sticker-preview-cell.playing {
    transform: scale(1.03);
    border-color: var(--pink-primary);
    box-shadow: 0 4px 12px rgba(37, 105, 255, 0.16);
    z-index: 2;
}

.sticker-preview-cell img {
    width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.sticker-preview-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(37, 105, 255, 0.85);
    color: #FFFFFF;
    font-size: 0.58rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==================== STICKER MAGNIFIER POPUP OVERLAY ==================== */
.sticker-magnifier-overlay {
    position: fixed;
    inset: 0;
    z-index: 2500;
    background: rgba(24, 12, 20, 0.45);
    backdrop-filter: blur(10px) saturate(160%);
    -webkit-backdrop-filter: blur(10px) saturate(160%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease;
    cursor: pointer;
}

.sticker-magnifier-overlay.open {
    opacity: 1;
    visibility: visible;
}

.sticker-magnifier-card {
    position: relative;
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.96), rgba(255, 243, 248, 0.94));
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 2px solid rgba(255, 255, 255, 0.95);
    box-shadow:
        0 28px 65px rgba(37, 105, 255, 0.32),
        0 0 0 1px rgba(142, 197, 255, 0.6),
        inset 0 2px 4px rgba(255, 255, 255, 0.95);
    border-radius: 32px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    max-width: 380px;
    width: 100%;
    transform: scale(0.75) translateY(15px);
    transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: default;
}

.sticker-magnifier-overlay.open .sticker-magnifier-card {
    transform: scale(1) translateY(0);
}

.sticker-magnifier-img-wrap {
    width: 260px;
    height: 260px;
    max-width: 72vw;
    max-height: 72vw;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.sticker-magnifier-img-wrap.theme-big {
    width: 310px;
    height: 530px;
    max-width: 82vw;
    max-height: 74vh;
}

.sticker-magnifier-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 12px 24px rgba(35, 25, 32, 0.14));
}

.sticker-magnifier-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(142, 197, 255, 0.7);
    background: #FFFFFF;
    color: var(--pink-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.sticker-magnifier-close:hover {
    background: var(--pink-soft);
    transform: rotate(90deg);
}

/* ==================== BUY MODE SWITCHER (ซื้อให้ตัวเอง / ส่งของขวัญ) ==================== */
.buy-mode-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #F4ECEF;
    padding: 4px;
    border-radius: var(--radius-pill);
    margin-bottom: 10px;
}

.buy-mode-btn {
    padding: 8px 12px;
    border-radius: var(--radius-pill);
    border: none;
    background: transparent;
    color: var(--text-main);
    font-family: inherit;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.22s;
}

.buy-mode-btn.active {
    background: var(--pink-primary);
    color: #FFFFFF;
    box-shadow: 0 4px 14px rgba(37, 105, 255, 0.28);
}

/* ==================== RECIPIENT 3-CHANNEL CARD ==================== */
.glass-section-card {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid #F0E4E9;
    border-radius: 18px;
    padding: 12px 14px;
    margin-bottom: 10px;
}

.glass-section-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
}

.recipient-method-pills {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 9px;
}

.rec-method-pill {
    padding: 7px 6px;
    border-radius: 12px;
    border: 1.5px solid #EFE4E9;
    background: #FAF6F8;
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.2s;
}

.rec-method-pill.active {
    border-color: var(--pink-primary);
    background: var(--pink-pastel);
    color: var(--pink-primary);
}

.recipient-input-row {
    display: flex;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.recipient-text-input {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1.5px solid #E5D8DE;
    background: #FFFFFF;
    font-family: inherit;
    font-size: 0.94rem;
}

.recipient-text-input:focus {
    outline: none;
    border-color: var(--pink-primary);
}

.btn-verify-rec {
    flex-shrink: 0;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1.5px solid var(--pink-primary);
    background: #FFFFFF;
    color: var(--pink-primary);
    font-family: inherit;
    font-weight: 700;
    font-size: 0.86rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.btn-verify-rec:hover {
    background: var(--pink-soft);
}

.qr-upload-dropzone {
    border: 2px dashed var(--pink-border);
    background: var(--pink-pastel);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.qr-upload-dropzone:hover {
    background: var(--pink-soft);
    border-color: var(--pink-primary);
}

/* การ์ดแสดงผู้รับที่ตรวจผ่านแล้ว (สีเขียวอ่อนเหมือนในรูปตัวอย่าง) */
.verified-recipient-banner {
    margin-top: 12px;
    background: #E8F5E9;
    border: 1.5px solid #A5D6A7;
    border-radius: 16px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: popBounce 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.verified-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: #C8E6C9;
    border: 2px solid #FFFFFF;
    flex-shrink: 0;
}

.verified-name {
    font-weight: 700;
    font-size: 0.96rem;
    color: #1B5E20;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ==================== PAYMENT METHOD & QR BOX ==================== */
.payment-option-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 2px solid var(--pink-primary);
    background: #FFF9FB;
    cursor: pointer;
}

.qr-payment-box {
    text-align: center;
    background: #FFFFFF;
    border: 1.5px solid var(--pink-border);
    border-radius: 22px;
    padding: 18px;
    margin-bottom: 14px;
}

.qr-code-frame {
    width: 220px;
    height: 220px;
    margin: 10px auto;
    padding: 10px;
    border-radius: 18px;
    border: 2px solid var(--pink-soft);
    background: #FFFFFF;
    box-shadow: 0 8px 24px rgba(37, 105, 255, 0.1);
}

.qr-code-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.satang-highlight-pill {
    display: inline-block;
    background: var(--pink-soft);
    color: var(--pink-primary);
    padding: 6px 16px;
    border-radius: var(--radius-pill);
    font-weight: 800;
    font-size: 1.35rem;
    margin: 6px 0;
}

/* ==================== SUCCESS TIMELINE ("ส่งติ๊กเรียบร้อย!") ==================== */
.success-hero-center {
    text-align: center;
    padding: 10px 0 16px;
}

.success-headline {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--pink-primary);
    margin-top: 8px;
}

.timeline-pink-box {
    background: var(--pink-pastel);
    border: 1px solid var(--pink-border);
    border-radius: 20px;
    padding: 18px 20px;
    margin: 14px 0;
}

.timeline-step-row {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    padding-bottom: 18px;
}

.timeline-step-row:last-child {
    padding-bottom: 0;
}

.timeline-step-row:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 13px;
    top: 28px;
    bottom: 0;
    width: 2.5px;
    background: var(--pink-primary);
}

.timeline-check-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--pink-primary);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    flex-shrink: 0;
    z-index: 2;
}

.timeline-check-circle.pending {
    background: #E0D4DA;
    color: #7B6B74;
}

/* ==================== CUTE LIQUID GLASS TOAST & ALERT ==================== */
.liquid-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 360px;
    width: calc(100% - 40px);
    pointer-events: none;
}

.liquid-toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 240, 246, 0.9));
    backdrop-filter: blur(22px) saturate(190%);
    -webkit-backdrop-filter: blur(22px) saturate(190%);
    border: 1.5px solid rgba(255, 255, 255, 0.9);
    box-shadow:
        0 14px 34px rgba(37, 105, 255, 0.22),
        inset 0 1px 3px rgba(255, 255, 255, 0.95);
    animation: popBounce 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.liquid-toast-icon {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    background: var(--pink-soft);
    color: var(--pink-primary);
}

.liquid-toast.success .liquid-toast-icon {
    background: #DCFCE7;
    color: #15803D;
}

.liquid-toast.error .liquid-toast-icon {
    background: #FFE4E6;
    color: #E11D48;
}

@keyframes popBounce {
    0% { opacity: 0; transform: scale(0.82) translateY(12px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}
