/* =============================================================
   BARF Rechner
   ============================================================= */

/* ── Layout wrappers ──────────────────────────────────────── */

.barf-rechner,
.barf-rechner__inputs,
.barf-rechner__results {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.barf-rechner {
    max-width: 640px;
    margin: 0 auto;
}

.barf-rechner__question {
    font-family: "Raleway", Sans-serif;
    font-weight: 700;
    font-size: 18px;
    line-height: 24px;
    letter-spacing: 0%;
    text-align: center;
    font-variant-numeric: lining-nums proportional-nums;
    color: #3E3A3C;
    margin: 0;
}

.barf-rechner__weight-display {
    color: #3E3A3C;
    display: inline-flex;
    justify-content: center;
    align-items: baseline;
    gap: 8px;
}

.barf-rechner__weight-value,
.barf-rechner__weight-unit {
    font-family: "Raleway", Sans-serif;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-align: center;
    font-variant-numeric: lining-nums proportional-nums;
    color: #3E3A3C;
    leading-trim: cap-height;
    line-height: 16px;
}

.barf-rechner__weight-value { font-size: 64px; }
.barf-rechner__weight-unit  { font-size: 14px; }

/* ── Slider wrap ──────────────────────────────────────────── */

.barf-rechner__slider-wrap {
    padding: 4px 2px;
}

/* ── Base input reset ─────────────────────────────────────── */

.barf-rechner__slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 16px;
    background: #ffffff;
    outline: none;
    cursor: pointer;
    border: none;
    margin: 0;
    display: block;
}

/* ── Webkit track ─────────────────────────────────────────── */

.barf-rechner__slider::-webkit-slider-runnable-track {
    height: 8px;
    background: #ffffff;
    border-radius: 16px;
}

/* ── Mozilla track ────────────────────────────────────────── */

.barf-rechner__slider::-moz-range-track {
    height: 8px;
    background: #ffffff;
    border-radius: 16px;
    border: none;
}

/* ── Webkit thumb ─────────────────────────────────────────── */

.barf-rechner__slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #F24B3C;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(242, 75, 60, 0.40);
    margin-top: -10px; /* vertically centre thumb on track */
}

/* ── Mozilla thumb ────────────────────────────────────────── */

.barf-rechner__slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #F24B3C;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(242, 75, 60, 0.40);
}

/* ── Focus ring (accessibility) ───────────────────────────── */

.barf-rechner__slider:focus-visible::-webkit-slider-thumb {
    outline: 3px solid #F24B3C;
    outline-offset: 3px;
}

.barf-rechner__slider:focus-visible::-moz-range-thumb {
    outline: 3px solid #F24B3C;
    outline-offset: 3px;
}

/* ── Section wrapper ──────────────────────────────────────── */

.barf-rechner__section {
    background: #EDECE8;
    border-radius: 4px;
    padding: 24px;
    text-align: center;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* ── Lifecycle group (Radio Buttons) ──────────────────────── */

.barf-rechner__lifecycle-group {
    display: flex;
    justify-content: center;
    gap: 12px;
    border: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.barf-rechner__radio-label {
    flex: none;
    cursor: pointer;
}

.barf-rechner__radio-input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* Focus indicator for radio buttons */
.barf-rechner__radio-input:focus-visible + .barf-rechner__radio-button {
    outline: 2px solid #F24B3C;
    outline-offset: 2px;
}

.barf-rechner__radio-button {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 16px 18px 16px 10px;
    gap: 8px;
    height: 42px;
    width: auto;
    white-space: nowrap;
    box-sizing: border-box;
    border-radius: 40px;
    border: 2px solid transparent;
    font-family: "Raleway", Sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 16px;
    letter-spacing: 0.5px;
    font-variant-numeric: lining-nums proportional-nums;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    /* inactive default */
    background: #DDD6CB;
    color: #3E3A3C;
}

.barf-rechner__radio-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #EDECE8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.barf-rechner__radio-icon svg {
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* ── Radio active state ──────────────────────────────────────── */

.barf-rechner__radio-input:checked + .barf-rechner__radio-button {
    background: #3E3A3C;
    color: #EDECE8;
}

.barf-rechner__radio-input:checked + .barf-rechner__radio-button .barf-rechner__radio-icon {
    background: #EDECE8;
}

.barf-rechner__radio-input:checked + .barf-rechner__radio-button .barf-rechner__radio-icon svg {
    opacity: 1;
}

/* ── Disclaimer text ─────────────────────────────────────── */

.barf-rechner__disclaimer {
    font-family: "Raleway", Sans-serif;
    font-weight: 400;
    font-size: 12px;
    line-height: 16px;
    letter-spacing: 0;
    text-align: center;
    color: #3E3A3C;
    margin: 0;
}

.barf-rechner__help-link {
    text-decoration: underline;
    color: #3E3A3C;
    font-weight: 600;
}

.barf-rechner__help-link:hover {
    color: #F24B3C;
}

/* ── Inputs wrapper ──────────────────────────────────────── */

/* (shared with .barf-rechner and .barf-rechner__results above) */

/* ── Buttons (shared base) ────────────────────────────────── */

.barf-rechner__calculate-btn,
.barf-rechner__reset-btn {
    display: block;
    width: 100%;
    height: 48px;
    padding: 16px 22px;
    border-radius: 4px;
    font-family: "Raleway", Sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 16px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-align: center;
    cursor: pointer;
    box-sizing: border-box;
}

.barf-rechner__calculate-btn {
    border: none;
    background: #F24B3C;
    vertical-align: middle;
    transition: background 0.2s ease;
}

.barf-rechner__calculate-btn:focus-visible,
.barf-rechner__reset-btn:focus-visible {
    outline: 2px solid #F24B3C;
    outline-offset: 3px;
}

.barf-rechner__calculate-btn,
.barf-rechner__calculate-btn:visited,
.barf-rechner__calculate-btn:hover,
.barf-rechner__calculate-btn:focus {
    color: #ffffff !important;
    text-decoration: none !important;
}

.barf-rechner__calculate-btn:hover {
    background: #d13e34;
}

.barf-rechner__reset-btn {
    border: 2px solid #3E3A3C !important;
    padding: 14px 20px !important;
    background: transparent !important;
    color: #3E3A3C !important;
    transition: background 0.2s ease, color 0.2s ease !important;
}

.barf-rechner__reset-btn:hover {
    background: #E0DED7 !important;
    color: #3E3A3C !important;
}

/* ── Results area ────────────────────────────────────────── */

.barf-rechner__results[hidden] {
    display: none;
}

/* ── Result box (dark) ────────────────────────────────────── */

.barf-rechner__result-box {
    background: #3E3A3C;
    border-radius: 4px;
    padding: 24px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 24px;
    text-align: center;
}

.barf-rechner__result-title,
.barf-rechner__result-label-main,
.barf-rechner__tipp-title {
    font-family: "Raleway", Sans-serif;
    font-weight: 700;
    font-size: 18px;
    line-height: 24px;
    letter-spacing: 0;
    font-variant-numeric: lining-nums proportional-nums;
    color: #EDECE8;
    margin: 0;
}

.barf-rechner__result-title,
.barf-rechner__result-label-main { text-align: center; }

.barf-rechner__divider {
    border: none;
    border-top: 1px solid #333031;
    margin: 0;
}

.barf-rechner__result-amount {
    display: inline-flex;
    justify-content: center;
    align-items: baseline;
    gap: 4px;
}

.barf-rechner__result-grams,
.barf-rechner__result-gram-unit {
    font-family: "Raleway", Sans-serif;
    font-weight: 700;
    line-height: 1;
    color: #EDECE8;
}

.barf-rechner__result-grams    { font-size: 80px; letter-spacing: -2px; }
.barf-rechner__result-gram-unit { font-size: 28px; }

.barf-rechner__result-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.barf-rechner__result-label-sub {
    font-family: "Raleway", Sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 18px;
    color: #EDECE8;
    margin: 0;
}

/* ── Tipp section ──────────────────────────────────────────── */

.barf-rechner__tipp { text-align: left; }

.barf-rechner__tipp-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.barf-rechner__tipp-badge {
    width: 32px;
    height: 32px;
    min-width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.barf-rechner__tipp-badge svg {
    width: 32px;
    height: 32px;
}

.barf-rechner__tipp-text {
    font-family: "Raleway", Sans-serif;
    font-weight: 500;
    font-size: 18px;
    line-height: 24px;
    letter-spacing: 0;
    font-variant-numeric: lining-nums proportional-nums;
    color: #EDECE8;
    margin: 0;
}

/* ── Shop button ───────────────────────────────────────────── */

/* (uses .barf-rechner__calculate-btn – see above) */

/* ── Result disclaimer ─────────────────────────────────────── */

.barf-rechner__result-disclaimer {
    font-family: "Raleway", Sans-serif;
    font-weight: 500;
    font-size: 12px;
    line-height: 16px;
    letter-spacing: 0;
    text-align: center;
    font-variant-numeric: lining-nums proportional-nums;
    color: #DDD6CB;
    margin: 0;
}

.barf-rechner__result-disclaimer a,
.barf-rechner__result-disclaimer a:visited {
    font-weight: 500;
    font-size: 12px;
    line-height: 16px;
    color: #DDD6CB !important;
    text-decoration: underline !important;
    text-decoration-style: solid;
    text-decoration-skip-ink: auto;
}

/* ── Recommendation box ────────────────────────────────────── */

.barf-rechner__products {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 480px) {
    .barf-rechner__products {
        grid-template-columns: 1fr;
    }
}

.barf-rechner__product-card {
    background: #DDD6CB !important;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.barf-rechner__product-card:hover {
    opacity: 0.85;
}

.barf-rechner__product-image {
    width: 60px;
    height: 60px;
    min-width: 60px;
    background: #EDECE8;
    border-radius: 4px;
}

.barf-rechner__product-name {
    font-family: "Raleway", Sans-serif;
    font-weight: 600;
    font-size: 12px;
    line-height: 16px;
    color: #3E3A3C;
    margin: 0;
}

/* ── Reset button ─────────────────────────────────────────── */

/* (uses .barf-rechner__reset-btn – see buttons section above) */

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 480px) {
    .barf-rechner__section {
        padding: 36px 24px 32px;
    }

    .barf-rechner__weight-value  { font-size: 3rem; }
    .barf-rechner__weight-unit   { font-size: 1.5rem; }

    .barf-rechner__radio-label {
        max-width: 100%;
    }
}
