/**
 * EPO Drag & Drop Upload — Frontend CSS
 * epo-ddu.css  v2.3.7
 */

/* ── Drop Zone ─────────────────────────────────────────── */

.epo-ddu-zone {
    border: 2px dashed color-mix(in srgb, #ff9e52 70%, #000);
    border-radius: 8px;
    background: #ff9e52;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.epo-ddu-zone:hover,
.epo-ddu-zone.epo-ddu-over {
    border-color: #292350;
    background: color-mix(in srgb, #ff9e52 85%, #fff);
}

.epo-ddu-zone.epo-ddu-over {
    border-style: solid;
}

.epo-ddu-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #292350;
    pointer-events: none;
}

.epo-ddu-hint svg {
    width: 40px;
    height: 40px;
}

.epo-ddu-hint-text {
    font-size: 14px;
    line-height: 1.4;
}

.epo-ddu-file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* ── File List ─────────────────────────────────────────── */

.epo-ddu-files {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    width: 100%;
    clear: both;
}

/* Min files warning */
.epo-ddu-min-msg {
    color: #e53935;
    font-size: 13px;
    margin: 6px 0 0;
    padding: 0;
}

/* Disabled Add to Cart while uploading */
.epo-ddu-uploading-disabled {
    opacity: 0.5 !important;
    cursor: wait !important;
    pointer-events: none !important;
}

.epo-ddu-file-entry {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    margin: 4px 0;
    background: #292350;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.4;
    position: relative;
}

.epo-ddu-file-entry.epo-ddu-uploading {
    background: linear-gradient(to right, #ff9e52 0%, #292350 0%);
}

.epo-ddu-file-entry.epo-ddu-done {
    background: color-mix(in srgb, #ff9e52 10%, #292350);
}

.epo-ddu-file-entry.epo-ddu-error {
    background: color-mix(in srgb, #292350 60%, #ffcdd2);
}

.epo-ddu-fname {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
    color: #ffffff;
}

.epo-ddu-fsize {
    color: #ffffff;
    opacity: .7;
    font-size: 12px;
    white-space: nowrap;
}

.epo-ddu-status {
    color: #ffffff;
    opacity: .7;
    font-size: 12px;
    white-space: nowrap;
    min-width: 30px;
    text-align: right;
}

.epo-ddu-done .epo-ddu-status {
    color: #ff9e52;
    opacity: 1;
}

.epo-ddu-error .epo-ddu-status {
    color: #e53935;
    opacity: 1;
}

.epo-ddu-del {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    color: #ffffff;
    opacity: .5;
    padding: 0 2px;
    transition: color 0.15s, opacity 0.15s;
    flex-shrink: 0;
}

.epo-ddu-del:hover {
    color: #e53935;
    opacity: 1;
}

/* ── Wrap ──────────────────────────────────────────────── */

.epo-ddu-wrap {
    width: 100%;
}

/* Force the field container to full width within EPO's grid */
.tmcp-field-wrap:has(.epo-ddu-wrap) {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
}

/* EPO wraps addon fields in .tc-col containers — make them full width */
.tc-extra-product-options-wrapper .epo-ddu-wrap,
.tc-extra-product-options-wrapper .epo-ddu-wrap .epo-ddu-zone {
    width: 100%;
    box-sizing: border-box;
}

/* Ensure the parent li and any EPO inner containers stretch */
li.tmcp-field-wrap:has(.epo-ddu-wrap) {
    display: block !important;
    width: 100% !important;
}

/* EPO sometimes uses tc-element-inner-wrap with flex — override */
.tc-element-inner-wrap:has(.epo-ddu-wrap) {
    display: block !important;
}

/* Hide the native file input label wrapper that EPO might inject */
.epo-ddu-wrap > label.tc-col.tm-epo-field-label {
    display: none;
}
