/* Krafty Custom Size — dimension fields.
   Hidden by default; shown only when JS adds .is-visible (i.e. the customer
   selected the Custom Size variation). The [hidden] attr is the belt; the
   :not(.is-visible) rule is the suspenders — either alone keeps it hidden. */
.kpp-size-match-fields {
    display: none;
}
.kpp-size-match-fields.is-visible {
    display: block;
    margin: 18px 0;
    padding: 20px 22px;
    border: 1px solid rgba(0, 0, 0, 0.10);
    border-radius: 10px;
    background: #fbfaf8;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.kpp-size-match-head {
    margin-bottom: 16px;
}
.kpp-size-match-title {
    display: block;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #1c1c1c;
    margin-bottom: 6px;
}
.kpp-size-match-intro {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #6b6b6b;
}

.kpp-size-fields-grid {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}
.kpp-size-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 100px;
    min-width: 90px;
    margin: 0;
}
.kpp-size-field-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #8a7d63;
}
.kpp-size-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.kpp-size-input-wrap input[type="number"] {
    width: 100%;
    padding: 11px 40px 11px 14px;
    font-size: 15px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -moz-appearance: textfield;
}
.kpp-size-input-wrap input[type="number"]::-webkit-outer-spin-button,
.kpp-size-input-wrap input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.kpp-size-input-wrap input[type="number"]:focus {
    outline: none;
    border-color: #c8a96a;
    box-shadow: 0 0 0 3px rgba(200, 169, 106, 0.18);
}
.kpp-size-unit {
    position: absolute;
    right: 14px;
    font-size: 13px;
    color: #a09a8c;
    pointer-events: none;
}

.kpp-size-match-result {
    margin: 14px 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: #6b6b6b;
}
.kpp-size-match-result.kpp-size-error {
    color: #b32d2e;
    font-weight: 600;
}

@media (max-width: 480px) {
    .kpp-size-fields-grid {
        gap: 10px;
    }
    .kpp-size-field {
        flex: 1 1 100%;
    }
}

/* Live price result emphasis */
.kpp-size-match-result:not(:empty) {
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(200, 169, 106, 0.10);
    border: 1px solid rgba(200, 169, 106, 0.25);
    color: #6b5d3e;
    font-weight: 600;
}
.kpp-size-match-result.kpp-size-error:not(:empty) {
    background: rgba(179, 45, 46, 0.06);
    border-color: rgba(179, 45, 46, 0.25);
    color: #b32d2e;
}

/* Blocked add-to-cart when dimensions exceed the largest tier */
.single_add_to_cart_button.kpp-size-blocked {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* v0.9.28
   Custom Size updates WooCommerce's own variation price element.
   Do NOT hide .woocommerce-variation-price here; otherwise the correct price is
   calculated but invisible to the customer. Keep only a harmless legacy rule for
   old stray plugin price nodes, if any remain from cached HTML. */
.variations_form.kpp-custom-size-active .woocommerce-variation-price,
.variations_form.kpp-custom-size-active .single_variation .woocommerce-variation-price {
    display: block !important;
}
.kpp-price-hidden-by-size {
    display: block !important;
}
.kpp-size-live-price {
    display: none !important;
}
