/* ======================================================
   AGREE / CHECKBOXES – CF7
   Custom checkbox UI, consent text, legal links, CF7
   cleanup rules and lightweight radio layout.

   Color palette is kept in the product theme:
   main:  #cf480b
   hover: #bb4108
   error: red
====================================================== */

/* ------------------------------------------------------
   1. Local color tokens
   Scoped to CF7/forms so the main theme palette is not changed.
------------------------------------------------------ */
.wpcf7-form,
.form-check,
.form-check-one,
.legal-more,
.orderform {
    --agree-main-color: var(--clr-primary);
	--agree-main-text:#333;
    --agree-hover-color: var(--clr-primary);
    --agree-error-color: #d81835;
    --agree-box-size: 16px;
    --agree-gap: 14px;
    --agree-offset: calc(var(--agree-box-size) + var(--agree-gap));
}

/* ------------------------------------------------------
   2. CF7 agreement button groups
   Safe fallback for button-like consent choices.
------------------------------------------------------ */
.wpcf7-form .agreements label.btn-agreement {
    border-color: #969998;
    background-color: #e9e9e9;
    background-image: unset;
    transition: all .3s ease;
}

.wpcf7-form .agreements label.btn-agreement:hover,
.wpcf7-form .agreements .btn-group input:checked + label {
    background-color: var(--agree-main-color);
    border-color: var(--agree-main-color);
    color: #fff;
}

.wpcf7-form .agreements input[type=checkbox]:focus-visible ~ label.btn-agreement {
    outline: 2px solid -webkit-focus-ring-color;
    outline-offset: 2px;
}

/* ------------------------------------------------------
   3. Native checkbox reset
   The real checkbox stays accessible, but visually hidden
   when a custom .check / .agree-check element is present.
------------------------------------------------------ */
.wpcf7-form input[type=checkbox],
.wpcf7-form-control-wrap[data-name="agree"] input[type=checkbox],
.wpcf7-form-control-wrap[data-name="agree-thp"] input[type=checkbox] {
    position: absolute;
    top: 0;
    left: 0;
    clip: rect(0, 0, 0, 0);
}

.form-check-input,
.form-check-input-thp {
    border-color: var(--agree-main-color);
}

.checkboxes .form-check-input {
    background: none;
    border: none;
}

/* ------------------------------------------------------
   4. Checkbox spacing and label positioning
------------------------------------------------------ */
.wpcf7-form .checkboxes .wpcf7-form-control-wrap {
    margin-top: 8px;
}

.wpcf7-form .wpcf7-acceptance .wpcf7-list-item label,
.wpcf7-form .distributor .wpcf7-list-item label,
.wpcf7-form .wpcf7-distributor .wpcf7-list-item label {
    position: relative;
}

.wpcf7-list-item {
    margin: 0 !important;
}

/* ------------------------------------------------------
   5. Focus state
   Keeps keyboard navigation visible.
------------------------------------------------------ */
.wpcf7-form input[type=checkbox]:focus-visible ~ .check,
.wpcf7-form-control-wrap[data-name="agree"] input[type=checkbox]:focus-visible + .agree-check,
.wpcf7-form-control-wrap[data-name="agree-thp"] input[type=checkbox]:focus-visible + .agree-thp-check {
    outline: 2px solid -webkit-focus-ring-color;
    outline-offset: 1px;
}

/* ------------------------------------------------------
   6. Custom checkbox square
   Supports generic .check and named agree classes.
------------------------------------------------------ */
.wpcf7-form .wpcf7-acceptance .wpcf7-list-item label .check,
.wpcf7-form .distributor .wpcf7-list-item label .check,
.wpcf7-form .wpcf7-distributor .wpcf7-list-item label .check,
.wpcf7-form-control-wrap[data-name="agree"] .agree-check,
.wpcf7-form-control-wrap[data-name="agree-thp"] .agree-thp-check {
    display: block;
    width: var(--agree-box-size);
    height: var(--agree-box-size);
    border: 2px solid var(--agree-main-color);
    border-radius: 2px;
    position: absolute;
    top: 3px;
    left: -30px;
}

/* ------------------------------------------------------
   6a. Inline agreement checkbox layout
   Same principle as HF/MS/FA:
   - no flex/grid,
   - no breakpoint-dependent left offsets,
   - spacing is calculated automatically,
   - text wraps naturally.
------------------------------------------------------ */
.wpcf7-form .form-check-one.agreement-agree,
.wpcf7-form .form-check.agreement-agree,
.wpcf7-form .agreement-agree {
    position: relative;
    padding-left: var(--agree-offset);
    color: var(--agree-main-text);
}

.wpcf7-form .form-check-one.agreement-agree > .wpcf7-form-control-wrap,
.wpcf7-form .form-check.agreement-agree > .wpcf7-form-control-wrap,
.wpcf7-form .agreement-agree > .wpcf7-form-control-wrap {
    position: absolute;
    top: 4px;
    left: 0;
    width: var(--agree-box-size);
    height: var(--agree-box-size);
}

.wpcf7-form .form-check-one.agreement-agree .wpcf7-form-control,
.wpcf7-form .form-check-one.agreement-agree .wpcf7-list-item,
.wpcf7-form .form-check-one.agreement-agree .wpcf7-list-item label,
.wpcf7-form .form-check.agreement-agree .wpcf7-form-control,
.wpcf7-form .form-check.agreement-agree .wpcf7-list-item,
.wpcf7-form .form-check.agreement-agree .wpcf7-list-item label,
.wpcf7-form .agreement-agree .wpcf7-form-control,
.wpcf7-form .agreement-agree .wpcf7-list-item,
.wpcf7-form .agreement-agree .wpcf7-list-item label {
    display: block;
    width: var(--agree-box-size);
    height: var(--agree-box-size);
    margin: 0;
}

.wpcf7-form .form-check-one.agreement-agree .wpcf7-list-item label,
.wpcf7-form .form-check.agreement-agree .wpcf7-list-item label,
.wpcf7-form .agreement-agree .wpcf7-list-item label {
    position: relative !important;
}

.wpcf7-form .form-check-one.agreement-agree .wpcf7-list-item label .check,
.wpcf7-form .form-check-one.agreement-agree .check,
.wpcf7-form .form-check.agreement-agree .wpcf7-list-item label .check,
.wpcf7-form .form-check.agreement-agree .check,
.wpcf7-form .agreement-agree .wpcf7-list-item label .check,
.wpcf7-form .agreement-agree .check {
    position: absolute;
    top: 0;
    left: 0 !important;
    display: block;
    width: var(--agree-box-size);
    height: var(--agree-box-size);
}

/* ------------------------------------------------------
   7. Checkmark shape
------------------------------------------------------ */
.wpcf7-form .wpcf7-acceptance .wpcf7-list-item label .check::before,
.wpcf7-form .wpcf7-acceptance .wpcf7-list-item label .check::after,
.wpcf7-form .distributor .wpcf7-list-item label .check::before,
.wpcf7-form .distributor .wpcf7-list-item label .check::after,
.wpcf7-form .wpcf7-distributor .wpcf7-list-item label .check::before,
.wpcf7-form .wpcf7-distributor .wpcf7-list-item label .check::after,
.wpcf7-form-control-wrap[data-name="agree"] .agree-check::before,
.wpcf7-form-control-wrap[data-name="agree"] .agree-check::after,
.wpcf7-form-control-wrap[data-name="agree-thp"] .agree-thp-check::before,
.wpcf7-form-control-wrap[data-name="agree-thp"] .agree-thp-check::after {
    content: '';
    position: absolute;
    height: 4px;
    background: var(--agree-hover-color);
    visibility: hidden;
}

.wpcf7-form .wpcf7-acceptance .wpcf7-list-item label .check::before,
.wpcf7-form .distributor .wpcf7-list-item label .check::before,
.wpcf7-form .wpcf7-distributor .wpcf7-list-item label .check::before,
.wpcf7-form-control-wrap[data-name="agree"] .agree-check::before,
.wpcf7-form-control-wrap[data-name="agree-thp"] .agree-thp-check::before {
    width: 70%;
    top: 60%;
    left: 40%;
    transform: translate(-50%, -50%) rotate(45deg);
}

.wpcf7-form .wpcf7-acceptance .wpcf7-list-item label .check::after,
.wpcf7-form .distributor .wpcf7-list-item label .check::after,
.wpcf7-form .wpcf7-distributor .wpcf7-list-item label .check::after,
.wpcf7-form-control-wrap[data-name="agree"] .agree-check::after,
.wpcf7-form-control-wrap[data-name="agree-thp"] .agree-thp-check::after {
    width: 150%;
    top: 20%;
    left: 105%;
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* ------------------------------------------------------
   8. Checked state
------------------------------------------------------ */
.wpcf7-form .wpcf7-acceptance .wpcf7-list-item label input[type=checkbox]:checked ~ .check::before,
.wpcf7-form .wpcf7-acceptance .wpcf7-list-item label input[type=checkbox]:checked ~ .check::after,
.wpcf7-form .distributor .wpcf7-list-item label input[type=checkbox]:checked ~ .check::before,
.wpcf7-form .distributor .wpcf7-list-item label input[type=checkbox]:checked ~ .check::after,
.wpcf7-form .wpcf7-distributor .wpcf7-list-item label input[type=checkbox]:checked ~ .check::before,
.wpcf7-form .wpcf7-distributor .wpcf7-list-item label input[type=checkbox]:checked ~ .check::after,
.wpcf7-form-control-wrap[data-name="agree"] input[type=checkbox]:checked + .agree-check::before,
.wpcf7-form-control-wrap[data-name="agree"] input[type=checkbox]:checked + .agree-check::after,
.wpcf7-form-control-wrap[data-name="agree-thp"] input[type=checkbox]:checked + .agree-thp-check::before,
.wpcf7-form-control-wrap[data-name="agree-thp"] input[type=checkbox]:checked + .agree-thp-check::after {
    visibility: visible;
}

/* ------------------------------------------------------
   9. Consent / legal text colors
------------------------------------------------------ */
.wpcf7-form .form-check-one,
.wpcf7-form .form-check,
.wpcf7-form .agreement-agree,
.wpcf7-form .wpcf7-list-item-label,
.wpcf7-form .legal-more,
.checkboxes .form-check {
    color: var(--agree-main-text);
}

/* Consent links are bold. */
.wpcf7-form .form-check-one a,
.wpcf7-form .form-check a,
.wpcf7-form .agreement-agree a,
.wpcf7-form .wpcf7-list-item-label a,
.form-check:has(input[name="agree"]) a {
    color: inherit;
    font-weight: 500;
    text-decoration: none;
    text-underline-offset: 2px;
	 color: var(--agree-hover-color);
}

/* Legal “more” link is intentionally not bold. */
.wpcf7-form .legal-more a,
.wpcf7-form .morelink {
    color: inherit;
    font-weight: 400;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.wpcf7-form .form-check-one a:hover,
.wpcf7-form .form-check a:hover,
.wpcf7-form .agreement-agree a:hover,
.wpcf7-form .wpcf7-list-item-label a:hover,
.wpcf7-form .legal-more a:hover,
.wpcf7-form .morelink:hover,
.form-check:has(input[name="agree"]) a:hover {
    color: var(--agree-hover-color);
	 text-decoration: underline;
}

/* ------------------------------------------------------
   10. Legal “read more” collapsed content
------------------------------------------------------ */
.morecontent span,
.morecontenta span {
    display: none;
}

/* ------------------------------------------------------
   11. CF7 validation / response cleanup
   Hide native CF7 messages when custom validation UI is used.
------------------------------------------------------ */
.agree-thp-error {
    color: var(--agree-error-color);
    font-size: 0.9rem;
    margin-top: 4px;
}

.wpcf7-not-valid-tip,
.screen-reader-response,
span.wpcf7-not-valid-tip {
    display: none;
}

.wpcf7 .ajax-loader {
    display: none !important;
}

.wpcf7 .wpcf7-form .wpcf7-mail-sent-ok {
    display: none !important;
}

div.wpcf7-response-output,
div.wpcf7-validation-errors {
    display: none !important;
}

/* ------------------------------------------------------
   12. Lightweight CF7 radio layout
   Moved from style.css with unchanged behavior.
------------------------------------------------------ */
.wpcf7-form .wpcf7-radio {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 0;
}

/* ------------------------------------------------------
   13. Final override
   Inline agreement checkbox must never use legacy negative left.
------------------------------------------------------ */
.wpcf7-form .form-check-one.agreement-agree .wpcf7-list-item label .check,
.wpcf7-form .form-check-one.agreement-agree .check,
.wpcf7-form .form-check.agreement-agree .wpcf7-list-item label .check,
.wpcf7-form .form-check.agreement-agree .check,
.wpcf7-form .agreement-agree .wpcf7-list-item label .check,
.wpcf7-form .agreement-agree .check {
    left: 0 !important;
}

/* ------------------------------------------------------
   14. Product order static checkbox
   Matches the legacy HU offer block: visual icon only.
------------------------------------------------------ */
.orderform .form-info {
    position: relative;
    color: var(--agree-main-text);
    padding-left: 2rem;
}

.orderform .product-order-check {
    position: absolute;
    top: 0.35em;
    left: 0;
    display: block;
    width: 1.2rem;
    height: 1.2rem;
    border: 2px solid var(--agree-main-color);
    background: #fff;
}

.orderform .product-order-check::before,
.orderform .product-order-check::after {
    content: '';
    position: absolute;
    height: 4px;
    background: var(--agree-hover-color);
}

.orderform .product-order-check::before {
    width: 70%;
    top: 60%;
    left: 40%;
    transform: translate(-50%, -50%) rotate(45deg);
}

.orderform .product-order-check::after {
    width: 150%;
    top: 36%;
    left: 105%;
    transform: translate(-50%, -50%) rotate(-45deg);
}
