/*
 * Wimakeit_OrderAttributes — checkout styles.
 *
 * Inherits the Wimakeit checkout look (wm-co-section / wm-co-field) and
 * fixes the file-input rendering, which by default drops the native
 * "Choisir un fichier / Aucun fichier choisi" UI inside a styled
 * <input>-shaped box. We hide the native control and let its <label>
 * act as a real button, then display the selected file as a chip-style
 * row underneath.
 */

.wm-order-attributes {
    margin-top: 1rem;
}

.wm-order-attribute--file .wm-oa-file-input {
    /* Hidden but still focusable for keyboard users. */
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.wm-order-attribute--file .wm-oa-file-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    border: 1px dashed #c9c9c9;
    border-radius: 8px;
    background: #fafafa;
    color: #333;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
    user-select: none;
}

.wm-order-attribute--file .wm-oa-file-button:hover,
.wm-order-attribute--file .wm-oa-file-input:focus + .wm-oa-file-button {
    border-color: var(--theme-primary, #e30613);
    background: #fff;
    color: var(--theme-primary, #e30613);
}

.wm-order-attribute--file .wm-oa-file-button svg {
    width: 1rem;
    height: 1rem;
}

.wm-order-attribute--file .wm-oa-file-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.6rem;
    padding: 0.5rem 0.75rem;
    background: rgba(16, 185, 129, 0.08);
    border-radius: 6px;
    font-size: 0.85rem;
    color: #166534;
}

.wm-order-attribute--file .wm-oa-file-meta svg {
    width: 1rem;
    height: 1rem;
    color: #16a34a;
    flex-shrink: 0;
}

.wm-order-attribute--file .wm-oa-file-meta .wm-oa-file-name {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wm-order-attribute--file .wm-oa-file-remove {
    background: none;
    border: none;
    padding: 0;
    color: var(--theme-primary, #e30613);
    font-size: 0.75rem;
    cursor: pointer;
    text-decoration: underline;
    flex-shrink: 0;
}

.wm-order-attribute .wm-oa-help {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.4;
}
