/* ============================================================
   Lengde Pris – frontend.css
   Styled to match WooCommerce .variations table rows.
   ============================================================ */

/* ── Wrapper ─────────────────────────────────────────────── */
.lp-length-wrap {
    margin: 0;
}

/* ── Variation-style row ─────────────────────────────────── */
.lp-variation-row {
    display: flex;
    align-items: center;
    gap: 1em;
    padding: 0.6em 0;
}

/* Label cell */
.lp-variation-label {
    flex: 0 0 auto;
    min-width: 160px;
}

.lp-variation-label label {
    font-weight: 600;
    font-size: 1em;
    color: inherit;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.2em;
    white-space: nowrap;
}

.lp-variation-label label abbr {
    color: #e11d48;
    text-decoration: none;
    border: none;
    font-size: 1em;
}

/* Value cell */
.lp-variation-value {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5em;
}

/* ── Stepper ─────────────────────────────────────────────── */
.lp-length-wrap .lp-stepper {
    display: inline-flex !important;
    align-items: center;
    gap: 0;
    border: 1.5px solid #ccc;
    border-radius: 2em;
    background: #fff;
    overflow: hidden;
    height: 44px;
    width: auto !important;
    max-width: 240px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.lp-stepper:focus-within {
    border-color: #888;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.08);
}

.lp-stepper .lp-btn,
button.lp-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 40px !important;
    min-width: 0 !important;
    height: 100% !important;
    min-height: 0 !important;
    flex-shrink: 0;
    background: transparent !important;
    background-image: none !important;
    border: none;
    border-radius: 0 !important;
    color: #333 !important;
    font-size: 1.3em;
    line-height: 1;
    cursor: pointer;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    text-transform: none !important;
    transition: background 0.12s;
    user-select: none;
}

.lp-stepper .lp-btn:hover,
button.lp-btn:hover {
    background: #f1f1f1 !important;
    color: #333 !important;
}

.lp-stepper .lp-btn:active,
button.lp-btn:active {
    background: #e4e4e4 !important;
}

.lp-stepper .lp-btn-minus,
button.lp-btn-minus {
    border-right: 1px solid #ddd !important;
    border-left: none !important;
}

.lp-stepper .lp-btn-plus,
button.lp-btn-plus {
    border-left: 1px solid #ddd !important;
    border-right: none !important;
}

.lp-length-wrap .lp-length-input {
    width: 80px !important;
    height: 100% !important;
    border: none !important;
    outline: none;
    text-align: center;
    font-size: 1em;
    background: transparent !important;
    padding: 0 4px !important;
    margin: 0 !important;
    box-shadow: none !important;
    -moz-appearance: textfield;
    appearance: textfield;
}

.lp-length-input::-webkit-inner-spin-button,
.lp-length-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.lp-unit {
    font-size: 0.88em;
    color: #666;
    padding: 0 10px 0 0;
    pointer-events: none;
    user-select: none;
}

/* ── Range hint ──────────────────────────────────────────── */
.lp-range-hint {
    font-size: 0.82em;
    color: #888;
    margin: 0;
    padding: 0;
    align-self: center;
}

/* ── Validation message ──────────────────────────────────── */
.lp-validation-msg {
    margin: 0.35em 0 0;
    padding: 0.4em 0.8em;
    border-radius: 5px;
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    font-size: 0.85em;
}

/* Error state */
.lp-length-wrap.lp-error .lp-stepper {
    border-color: #f87171;
    box-shadow: 0 0 0 2px rgba(248,113,113,0.2);
}

/* ── Price preview ───────────────────────────────────────── */
.lp-price-preview {
    padding: 0.5em 0 0.25em;
    font-size: 0.95em;
    color: #333;
    min-height: 1.5em;
    display: flex;
    align-items: baseline;
    gap: 0.4em;
    flex-wrap: wrap;
}

.lp-price-label {
    color: #555;
}

.lp-price-value {
    font-weight: 700;
    font-size: 1.15em;
    color: #2e7d32;
}

/* ── Quantity + ATC wrapper (moved by JS) ────────────────── */
.lp-quantity-atc-block {
    padding-top: 0.75em;
    border-top: 1px solid #eee;
    margin-top: 0.5em;
    display: flex;
    align-items: center;
    gap: 0.75em;
    flex-wrap: wrap;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media ( max-width: 600px ) {
    .lp-variation-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4em;
    }

    .lp-variation-label {
        min-width: 0;
    }

    .lp-length-input {
        width: 60px;
    }
}
