/**
 * Drag & Drop Multiple File Upload for WooCommerce – PRO
 * Frontend Styles
 *
 * @package DND_File_Upload_WC_Pro
 * @version 2.0.2
 *
 * Brand palette:
 *   --dndmfu-primary    #D4AF37  (gold)
 *   --dndmfu-secondary  #FDFBF7  (cream)
 */

:root {
    --dndmfu-primary: #D4AF37;
    --dndmfu-primary-dark: #b8962c;
    --dndmfu-secondary: #FDFBF7;
    --dndmfu-border: #e3d9b8;
}

/* ── Wrapper ──────────────────────────────────────────────────────────── */
.wc-dnd-file-upload {
    margin: 16px 0;
    font-family: inherit;
}

/* ── Drop zone ────────────────────────────────────────────────────────── */
.dndmfu-dropzone {
    border: 2px dashed var(--dndmfu-primary);
    border-radius: 8px;
    background: var(--dndmfu-secondary);
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.dndmfu-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

/* Drag-over + hover: highlight in gold */
.dndmfu-dropzone.dndmfu-over,
.dndmfu-dropzone:hover {
    border-color: var(--dndmfu-primary-dark);
    background: #faf4e6;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.dndmfu-icon {
    font-size: 2.6rem;
    display: block;
    line-height: 1;
    margin-bottom: 4px;
    color: var(--dndmfu-primary);
}

.dndmfu-icon-img {
    max-width: 48px;
    max-height: 48px;
    margin-bottom: 4px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.dndmfu-drag-text {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--dndmfu-primary-dark);
}

/* ── File list (inside the dropzone) ──────────────────────────────────── */
.dndmfu-file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    width: 100%;
}

/* When files exist, hide the drag prompt and show only the files */
.wc-dnd-file-upload.dndmfu-has-files .dndmfu-prompt {
    display: none;
}
.wc-dnd-file-upload.dndmfu-has-files .dndmfu-file-list {
    margin: 0;
}

/* Each uploaded file = a thumbnail tile */
.dndmfu-file-item {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 6px;
    overflow: visible;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dndmfu-file-item.dndmfu-uploading {
    width: 100%;
    height: auto;
    background: transparent;
    padding: 6px 0;
}

.dndmfu-thumb-wrap {
    position: relative;
    width: 90px;
    height: 90px;
}

/* Feature 2 – thumbnail */
.dndmfu-thumb {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid var(--dndmfu-primary);
    display: block;
}

/* Non-image generic badge */
.dndmfu-thumb-file {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef1f6;
    color: #5a6b8c;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* ── Progress bar (during upload) ─────────────────────────────────────── */
.dndmfu-progress {
    display: block;
    width: 100%;
    height: 6px;
    background: #e8e8e8;
    border-radius: 3px;
    overflow: hidden;
}

.dndmfu-bar {
    display: block;
    height: 100%;
    background: var(--dndmfu-primary);
    border-radius: 3px;
    transition: width 0.15s ease;
}

/* ── Remove button = ✕ overlaid on thumbnail ──────────────────────────── */
.dndmfu-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    padding: 0;
    line-height: 20px;
    text-align: center;
    font-size: 16px;
    border: none;
    border-radius: 50%;
    background: #e04040;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    transition: background 0.15s;
}

.dndmfu-remove:hover {
    background: #c0392b;
}

/* ── Error message ────────────────────────────────────────────────────── */
.dndmfu-error {
    color: #c0392b;
    font-size: 0.875rem;
    margin: 6px 0 0;
    padding: 6px 10px;
    background: #fdf2f2;
    border-left: 3px solid #c0392b;
    border-radius: 2px;
}

/* ── Label above upload area ──────────────────────────────────────────── */
.wc-dnd-file-upload > label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
}

/* ── Checkout page wrapper ────────────────────────────────────────────── */
.woocommerce-checkout .wc-dnd-file-upload {
    padding: 10px 0;
    border-top: 1px solid #f0f0f0;
}

/* ── Mobile responsive ────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .dndmfu-file-item,
    .dndmfu-thumb-wrap,
    .dndmfu-thumb {
        width: 80px;
        height: 80px;
    }
}

/* ── Hide stray native file input that some themes render alongside ─────── */
/* The styled uploader replaces it; the raw input + its helper text are noise */
.wc-dnd-file-upload input[type="file"]:not(.wc-drag-n-drop-file) {
    display: none !important;
}
