/* =============================================================================
   Custom Product Form — Frontend Styles
   All classes are prefixed with .qm-cp- to avoid conflicts.
   ============================================================================= */

/* ---- Form wrapper ---- */
.qm-cp-wrap {}

.qm-cp-heading {
    margin-bottom: 1.5rem;
}

/* ---- Error notice ---- */
.qm-cp-notice {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    background: #fdf2f2;
    color: #c0392b;
    border: 1px solid #f5b7b1;
}

/* ---- Section (accordion-style) ---- */
.qm-cp-section {
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.qm-cp-section__toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: #f7f7f7;
    cursor: pointer;
    user-select: none;
    margin: 0;
    border-radius: 6px 6px 0 0;
}

.qm-cp-section__toggle:hover {
    background: #efefef;
}

.qm-cp-section__toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
    margin: 0;
}

.qm-cp-section__label {
    font-weight: 600;
    font-size: 1rem;
}

/* ---- Section fields ---- */
.qm-cp-fields {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.qm-cp-fields[hidden] {
    display: none;
}

/* ---- Form groups (label + input) ---- */
.qm-cp-group {
    margin-bottom: 1rem;
}

.qm-cp-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.qm-cp-input,
.qm-cp-select,
.qm-cp-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
    background-color: #fff;
    color: inherit;
    font-family: inherit;
}

.qm-cp-input:focus,
.qm-cp-select:focus,
.qm-cp-textarea:focus {
    border-color: #555;
    outline: none;
}

.qm-cp-input[type="number"] {
    max-width: 200px;
}

.qm-cp-textarea {
    resize: vertical;
    min-height: 80px;
}

/* ---- Trägerpalette sub-section ---- */
.qm-cp-traeger-fields {
    margin-top: 0.5rem;
    padding: 14px 16px;
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
}

.qm-cp-traeger-fields[hidden] {
    display: none;
}

.qm-cp-subsection-heading {
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0 0 1rem;
    color: #555;
}

/* ---- Submit button ---- */
.qm-cp-actions {
    margin-top: 1.5rem;
}

/* .qm-cp-submit inherits from .qm-btn — Elementor style controls override */

/* ---- Tooltip ---- */
.qm-cp-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    vertical-align: middle;
}

.qm-cp-tooltip__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #bbb;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    font-style: normal;
    line-height: 1;
    cursor: default;
    user-select: none;
    flex-shrink: 0;
}

.qm-cp-tooltip__bubble {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.4;
    padding: 6px 10px;
    border-radius: 4px;
    white-space: normal;
    width: 220px;
    z-index: 9999;
    pointer-events: none;
}

.qm-cp-tooltip__bubble::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
}

.qm-cp-tooltip:hover .qm-cp-tooltip__bubble {
    display: block;
}
