/**
 * File attribute widget — self-contained, theme-portable styling.
 *
 * Everything is scoped under .file-upload so it renders consistently on any
 * storefront theme, with no external dependency beyond the Font Awesome
 * bundle every theme already loads. JS (file-attribute.js) drives the
 * dropzone/preview toggling and the upload itself.
 */

.file-upload {
    position: relative;
}

.file-upload input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/*
 * .file-upload__dropzone/.file-upload__preview both set an explicit
 * `display: flex` below, which — being an author rule — otherwise beats the
 * browser's default `[hidden] { display: none }` (origin wins over
 * specificity in the cascade). Restate it here so JS toggling the `hidden`
 * attribute actually hides them.
 */
.file-upload__dropzone[hidden],
.file-upload__preview[hidden] {
    display: none;
}

.file-upload__dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    padding: 28px 20px;
    margin: 0;
    border: 1px dashed #d9e0ea;
    border-radius: 11px;
    background-color: #fff;
    cursor: pointer;
    font-weight: normal;
    transition: border-color .15s ease, background-color .15s ease;
}

.file-upload__dropzone:hover,
.file-upload__dropzone.is-dragover {
    border-color: #888888;
    background-color: rgba(37, 99, 235, .05);
}

.file-upload input[type="file"]:focus + .file-upload__dropzone {
    outline: none;
    border-color: #888888;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

.file-upload__icon {
    font-size: 24px;
    color: #888888;
}

.file-upload__cta {
    font-size: 14px;
    color: #0f172a;
}

.file-upload__cta strong {
    color: #888888;
    text-decoration: underline;
}

.file-upload__hint {
    font-size: 12px;
    color: #9aa6b6;
}

.file-upload__preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #d9e0ea;
    border-radius: 11px;
    background-color: #fff;
}

.file-upload__preview.file-upload--success {
    border-color: #888888;
    background-color: rgba(37, 99, 235, .05);
}

.file-upload__preview.file-upload--error {
    border-color: #e2574c;
    background-color: rgba(226, 87, 76, .06);
}

.file-upload__file-icon {
    font-size: 20px;
    color: #888888;
    flex-shrink: 0;
}

.file-upload__preview.file-upload--error .file-upload__file-icon {
    color: #e2574c;
}

.file-upload__thumb {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #d9e0ea;
}

.file-upload__file-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.file-upload__file-name {
    font-size: 14px;
    font-weight: bold;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

a.file-upload__file-name:hover {
    color: #888888;
    text-decoration: underline;
}

.file-upload__file-status {
    font-size: 12px;
    color: #9aa6b6;
}

.file-upload__preview.file-upload--error .file-upload__file-status {
    color: #e2574c;
}

.file-upload__remove {
    flex-shrink: 0;
    border: none;
    background: none;
    color: #9aa6b6;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    padding: 4px 8px;
}

.file-upload__remove:hover {
    color: #e2574c;
}
