/* WooCommerce Custom Product Fields — Frontend (Flatsome compatible) */

.wcpf-wrapper {
    margin: 24px 0;
    padding: 22px 24px;
    border: 1px solid var(--color-border, #e5e5e5);
    border-radius: 4px;
    background: var(--color-bg-light, #fafafa);
}

.wcpf-field {
    margin-bottom: 22px;
}
.wcpf-field:last-child { margin-bottom: 0; }

/* Label */
.wcpf-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--color-text-dark, #222);
    margin-bottom: 8px;
}
.wcpf-label .required {
    color: var(--color-primary, #e8192c);
    margin-left: 2px;
}

/* Text input — inherits Flatsome's .input-text */
.wcpf-text {
    width: 100%;
}

/* Select */
.wcpf-select {
    display: block;
    width: 100%;
    height: 44px;
    padding: 0 36px 0 12px;
    border: 1px solid var(--color-border, #e1e1e1);
    border-radius: 3px;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    font-size: 14px;
    color: var(--color-text, #444);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.wcpf-select:focus {
    outline: none;
    border-color: var(--color-primary, #0073aa);
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.12);
}

/* Image upload area */
.wcpf-upload {
    position: relative;
}

.wcpf-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 2px dashed var(--color-border, #d0d0d0) !important;
    border-radius: 4px !important;
    background: #fff !important;
    color: var(--color-text, #555) !important;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    user-select: none;
}
.wcpf-upload-btn:hover {
    border-color: var(--color-primary, #0073aa) !important;
    color: var(--color-primary, #0073aa) !important;
    background: rgba(0, 115, 170, 0.04) !important;
}

/* Preview */
.wcpf-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--color-border, #e1e1e1);
    border-radius: 4px;
}
.wcpf-preview-img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid #eee;
    display: block;
}
.wcpf-remove {
    padding: 5px 12px;
    background: #fff5f5;
    border: 1px solid #fcc;
    border-radius: 3px;
    color: #c00;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.wcpf-remove:hover { background: #ffe0e0; }

/* Progress */
.wcpf-progress { margin-top: 8px; }
.wcpf-bar {
    height: 4px;
    background: #eee;
    border-radius: 2px;
    overflow: hidden;
}
.wcpf-fill {
    height: 100%;
    background: var(--color-primary, #0073aa);
    width: 0%;
    transition: width 0.25s ease;
    border-radius: 2px;
}

/* Hint text */
.wcpf-hint {
    font-size: 11px;
    color: #aaa;
    margin: 6px 0 0;
}

/* Flatsome dark sections */
.dark .wcpf-wrapper     { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.12); }
.dark .wcpf-label       { color: #eee; }
.dark .wcpf-select      { background-color: rgba(255,255,255,.06); color: #eee; border-color: rgba(255,255,255,.15); }
.dark .wcpf-upload-btn  { background: rgba(255,255,255,.06) !important; border-color: rgba(255,255,255,.2) !important; color: #ddd !important; }
.dark .wcpf-preview     { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); }

/* Validation error highlight */
.woocommerce-error ~ form .wcpf-wrapper { border-color: #a00; }
