/* ==========================================================
   WC Multi File Upload — Checkout Styles
   FIXED: Mobile alignment — drop zone and button now properly
   centered and full-width inside the Mobimint webview.
   ========================================================== */

#wcmfu-upload-wrapper {
    margin: 0 0 16px;
    width: 100%;          /* ✅ FIX: ensure wrapper is full width */
    box-sizing: border-box;
}

/* ── Card shell (mobile webview only) ───────────────────── */
.mobile-checkout-body #wcmfu-upload-wrapper {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.07), 0 0 0 0.5px rgba(0,0,0,.07);
    margin: 0 0 12px;
    width: 100%;          /* ✅ FIX */
    box-sizing: border-box;
}

/* ── Heading / card title ────────────────────────────────── */
.wcmfu-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 12px;
    padding: 0;
    width: 100%;          /* ✅ FIX */
    box-sizing: border-box;
}

.mobile-checkout-body .wcmfu-heading {
    padding: 13px 16px;
    border-bottom: 0.5px solid #f0f0f4;
    background: #fafafa;
    margin: 0;
    font-size: 13px;
    width: 100%;
    box-sizing: border-box;
}

.wcmfu-heading .required {
    color: #e74c3c;
    margin-left: 3px;
}

.wcmfu-description {
    font-size: 13px;
    color: #777;
    margin: 0 0 12px;
    line-height: 1.5;
    width: 100%;
    box-sizing: border-box;
}

.mobile-checkout-body .wcmfu-description {
    padding: 8px 16px 0;
    margin: 0;
    font-size: 12.5px;
    width: 100%;
    box-sizing: border-box;
}

/* ── Drop zone wrapper ───────────────────────────────────── */
.wcmfu-drop-zone-wrap {
    padding: 0;
    width: 100%;          /* ✅ FIX */
    box-sizing: border-box;
    display: block;       /* ✅ FIX: was potentially inline */
}

.mobile-checkout-body .wcmfu-drop-zone-wrap {
    padding: 14px 16px 0;
    width: 100%;
    box-sizing: border-box;
    display: block;
}

/* ── Drop zone = <label> ─────────────────────────────────── */
.wcmfu-drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;   /* ✅ centres children horizontally */
    justify-content: center;
    gap: 10px;
    padding: 28px 16px;
    border: 1.5px dashed #c8c5f0;
    border-radius: 12px;
    background: #f0effe;
    cursor: pointer;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    transition: background .15s, border-color .15s;
    box-sizing: border-box;
    width: 100%;           /* ✅ FIX: was missing, caused right-drift */
    position: relative;
    margin: 0;             /* ✅ FIX: remove any accidental margin */
}

.wcmfu-drop-zone:active,
.wcmfu-drop-zone.wcmfu-drag-active {
    background: #e3e0fd;
    border-color: #7F77DD;
    border-style: solid;
}

.wcmfu-drop-zone.wcmfu-drop-zone--full {
    opacity: .45;
    pointer-events: none;
}

/* Desktop hover */
@media (hover: hover) {
    .wcmfu-drop-zone:hover {
        background: #e8e5fd;
        border-color: #7F77DD;
    }
}

/* Icon circle */
.wcmfu-drop-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(127,119,221,.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;        /* ✅ FIX: prevents icon from stretching */
}

.wcmfu-drop-icon svg {
    width: 24px;
    height: 24px;
    color: #7F77DD;
}

.wcmfu-drop-main {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
    text-align: center;    /* ✅ FIX */
    width: 100%;
}

.wcmfu-drop-sub {
    font-size: 12.5px;
    color: #888;
    margin: 0;
    line-height: 1.5;
    text-align: center;    /* ✅ FIX */
    width: 100%;
}

/* Browse button — pill */
.wcmfu-browse-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center; /* ✅ FIX */
    gap: 6px;
    padding: 11px 24px;
    background: #7F77DD;
    color: #fff;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: opacity .15s;
    line-height: 1;
    min-height: 44px;
    pointer-events: none;
    max-width: 280px;      /* ✅ FIX: don't stretch full width, keep pill shape */
    width: auto;
}

.wcmfu-drop-zone:active .wcmfu-browse-btn {
    opacity: .8;
}

.wcmfu-browse-btn svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.wcmfu-meta {
    font-size: 11px;
    color: #bbb;
    line-height: 1.4;
    text-align: center;    /* ✅ FIX */
    width: 100%;
}

.wcmfu-drag-hint {
    font-size: 12px;
    color: #7F77DD;
    font-weight: 600;
    opacity: 0;
    transition: opacity .15s;
    position: absolute;
    bottom: 10px;
    left: 0;               /* ✅ FIX: anchor correctly */
    right: 0;
    text-align: center;
}

.wcmfu-drag-active .wcmfu-drag-hint {
    opacity: 1;
}

/* Hidden real file input */
#wcmfu-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    pointer-events: none;
}

/* ── Progress bar ────────────────────────────────────────── */
.wcmfu-progress-wrap {
    height: 4px;
    background: #ece9fe;
    border-radius: 2px;
    margin: 10px 0 0;
    overflow: hidden;
    width: 100%;           /* ✅ FIX */
    box-sizing: border-box;
}

.mobile-checkout-body .wcmfu-progress-wrap {
    margin: 10px 16px 0;
    width: calc(100% - 32px); /* ✅ FIX: account for padding */
}

.wcmfu-progress-bar {
    height: 100%;
    background: #7F77DD;
    border-radius: 2px;
    transition: width .2s ease;
    width: 0%;
}

/* ── Error area ──────────────────────────────────────────── */
.wcmfu-error-area {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    background: #fce8e8;
    color: #c0392b;
    border: 0.5px solid #f5c6c6;
    line-height: 1.4;
    margin-top: 10px;
    width: 100%;
    box-sizing: border-box;
}

.mobile-checkout-body .wcmfu-error-area {
    margin: 8px 16px 0;
    width: calc(100% - 32px); /* ✅ FIX */
    box-sizing: border-box;
}

/* ── File list ───────────────────────────────────────────── */
.wcmfu-file-list {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
    width: 100%;
    box-sizing: border-box;
}

.mobile-checkout-body .wcmfu-file-list {
    margin: 10px 0 0;
    width: 100%;
    box-sizing: border-box;
}

.wcmfu-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-top: 0.5px solid #f0f0f4;
    animation: wcmfu-in .2s ease;
    width: 100%;
    box-sizing: border-box;
}

.mobile-checkout-body .wcmfu-file-item {
    padding: 12px 16px;
    width: 100%;
    box-sizing: border-box;
}

.wcmfu-file-item:first-child {
    margin-top: 4px;
}

@keyframes wcmfu-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: none; }
}

.wcmfu-file-item.wcmfu-item-removing {
    opacity: 0;
    transform: translateX(12px);
    transition: opacity .22s ease, transform .22s ease;
}

/* ── File icon / thumbnail ───────────────────────────────── */
.wcmfu-file-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .03em;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #7F77DD;
    color: #fff;
    overflow: hidden;
}

.wcmfu-file-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wcmfu-ext-pdf  { background: #e74c3c; }
.wcmfu-ext-doc,
.wcmfu-ext-docx { background: #2980b9; }
.wcmfu-ext-xls,
.wcmfu-ext-xlsx { background: #27ae60; }
.wcmfu-ext-zip  { background: #8e44ad; }
.wcmfu-ext-txt  { background: #95a5a6; }
.wcmfu-ext-mp4,
.wcmfu-ext-mp3  { background: #e67e22; }
.wcmfu-ext-jpg,
.wcmfu-ext-jpeg,
.wcmfu-ext-png,
.wcmfu-ext-gif,
.wcmfu-ext-webp { background: #f39c12; }

/* ── File name + size ────────────────────────────────────── */
.wcmfu-file-name {
    display: block;
    font-size: 13.5px;
    font-weight: 500;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;               /* ✅ FIX: take remaining space */
    min-width: 0;
}

.wcmfu-file-size {
    display: block;
    font-size: 11.5px;
    color: #aaa;
    margin-top: 2px;
}

/* ── Remove button ───────────────────────────────────────── */
.wcmfu-remove-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: #f5f5f8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    color: #bbb;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
    transition: background .12s, color .12s;
    margin-left: auto;     /* ✅ FIX: push to right */
}

.wcmfu-remove-btn svg {
    width: 14px;
    height: 14px;
}

.wcmfu-remove-btn:active,
.wcmfu-remove-btn:hover {
    background: #fce8e8;
    color: #e74c3c;
}

/* ── Footer bar (counter + add more) ────────────────────── */
.wcmfu-counter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #aaa;
    margin-top: 8px;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

.mobile-checkout-body .wcmfu-counter {
    padding: 10px 16px 14px;
    border-top: 0.5px solid #f0f0f4;
    background: #fafafa;
    margin-top: 0;
    width: 100%;
    box-sizing: border-box;
}

.wcmfu-counter-num {
    font-weight: 600;
    color: #7F77DD;
}

.wcmfu-add-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    font-weight: 600;
    color: #7F77DD;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px 0;
    -webkit-tap-highlight-color: transparent;
}

.wcmfu-add-more-btn svg {
    width: 13px;
    height: 13px;
}

/* ── Uploading spinner ───────────────────────────────────── */
.wcmfu-spin {
    display: inline-block;
    animation: wcmfu-spin .7s linear infinite;
}

@keyframes wcmfu-spin {
    to { transform: rotate(360deg); }
}



/* ── WCMFU upload widget — force center on mobile webview ── */
.mobile-checkout-body #wcmfu-upload-wrapper,
.mobile-checkout-body #wcmfu-upload-wrapper * {
    max-width: 100% !important;
    box-sizing: border-box !important;
    float: none !important;
}

.mobile-checkout-body #wcmfu-upload-wrapper {
    width: 100% !important;
    margin: 0 0 12px !important;
    padding: 0 !important;
    display: block !important;
}

.mobile-checkout-body .wcmfu-drop-zone-wrap {
    width: 100% !important;
    padding: 12px !important;
    display: block !important;
}

.mobile-checkout-body .wcmfu-drop-zone {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    margin: 0 !important;
    padding: 20px 12px !important;
}

.mobile-checkout-body .wcmfu-drop-icon,
.mobile-checkout-body .wcmfu-drop-main,
.mobile-checkout-body .wcmfu-drop-sub,
.mobile-checkout-body .wcmfu-browse-btn,
.mobile-checkout-body .wcmfu-meta {
    align-self: center !important;
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.mobile-checkout-body .wcmfu-browse-btn {
    width: auto !important;
    max-width: 80% !important;
    min-width: 160px !important;
    pointer-events: none !important;
}


@media (max-width: 768px) {
    #wcmfu-upload-wrapper {
        width: 98%;
            margin: 8px !important;

    }
}

/* ══════════════════════════════════════════════════════════
   CLOUD STORAGE — inline source pills
   ══════════════════════════════════════════════════════════ */

#wcmfu-cloud-section {
    padding: 12px 16px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.wcmfu-cloud-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 22px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    min-height: 40px;
    -webkit-tap-highlight-color: transparent;
    transition: background .15s, transform .1s;
}

.wcmfu-cloud-btn:active {
    transform: scale(.97);
}

.wcmfu-cloud-btn--dropbox {
    border: 1.5px solid #0061FF;
    background: #fff;
    color: #0061FF;
}

.wcmfu-cloud-btn--dropbox:hover {
    background: #e8f0ff;
}

.wcmfu-cloud-btn--gdrive {
    border: 1.5px solid #e0e0e0;
    background: #fff;
    color: #333;
}

.wcmfu-cloud-btn--gdrive:hover {
    background: #f7f7f7;
}

/* ══════════════════════════════════════════════════════════
   ACTION SHEET BACKDROP
   ══════════════════════════════════════════════════════════ */

.wcmfu-cloud-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, .45);
    display: flex;               /* flex when shown */
    align-items: flex-end;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    /* Entry animation */
    opacity: 0;
    transition: opacity .25s ease;
}

.wcmfu-cloud-backdrop.wcmfu-cloud-open {
    opacity: 1;
}

/* ══════════════════════════════════════════════════════════
   ACTION SHEET — MOBILE (slides up from bottom)
   ══════════════════════════════════════════════════════════ */

.wcmfu-cloud-sheet {
    width: 100%;
    max-width: 480px;
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
    transform: translateY(100%);
    transition: transform .28s cubic-bezier(.32, 1, .32, 1);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, .12);
    overflow: hidden;
}

.wcmfu-cloud-open .wcmfu-cloud-sheet {
    transform: translateY(0);
}

/* Sheet option rows */
.wcmfu-sheet-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
    transition: background .12s;
}

.wcmfu-sheet-option:active,
.wcmfu-sheet-option:hover {
    background: #f7f7f9;
}

.wcmfu-sheet-option strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
}

.wcmfu-sheet-option small,
.wcmfu-sheet-option span small {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 1px;
    font-weight: 400;
}

/* ══════════════════════════════════════════════════════════
   DESKTOP — sheet becomes a centered modal
   ══════════════════════════════════════════════════════════ */

@media (min-width: 600px) {
    .wcmfu-cloud-backdrop {
        align-items: center;
    }

    .wcmfu-cloud-sheet {
        border-radius: 20px;
        max-width: 440px;
        transform: scale(.94) translateY(12px);
        transition: transform .24s cubic-bezier(.32, 1, .32, 1),
                    opacity .2s ease;
        opacity: 0;
        box-shadow: 0 20px 60px rgba(0, 0, 0, .22), 0 0 0 .5px rgba(0, 0, 0, .06);
    }

    .wcmfu-cloud-open .wcmfu-cloud-sheet {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* ══════════════════════════════════════════════════════════
   MOBIMINT WEBVIEW — full-width overrides
   ══════════════════════════════════════════════════════════ */

.mobile-checkout-body #wcmfu-cloud-section {
    padding: 10px 12px 4px;
}

.mobile-checkout-body .wcmfu-cloud-btn {
    font-size: 12px;
    padding: 8px 14px;
}