/* =============================================
   KAS Limited - Airfreight Price Calculator
   ============================================= */
.af-calc {
    --af-accent: #1477d2;
    --af-accent-dark: #0e5da6;
    --af-border: #e5e5e5;
    --af-bg: #f7f9fb;
}

/* ---- Generic calculator box ---- */
.af-box {
    background: #fff;
    border: 1px solid var(--af-border);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    padding: 24px;
}

.af-box h3 {
    margin: 0 0 18px;
    font-size: 18px;
    color: #222;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 2px solid var(--af-border);
    padding-bottom: 12px;
}

/* ---- Form fields ---- */
.af-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}
.af-field {
    flex: 1 1 180px;
    display: flex;
    flex-direction: column;
}
.af-field.wide { flex-basis: 100%; }
.af-divider {
    display: block;
    width: 100%;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--af-accent);
    border-bottom: 1px solid var(--af-border);
    padding-bottom: 6px;
    margin: 4px 0 12px;
}
.af-field label {
    font-size: 13px;
    color: #555;
    margin-bottom: 5px;
    font-weight: 600;
}
.af-field .af-input-wrap {
    position: relative;
}
.af-field input[type="text"],
.af-field input[type="email"],
.af-field input[type="tel"],
.af-field input[type="number"],
.af-field select {
    width: 100%;
    height: 42px;
    padding: 8px 12px;
    border: 1px solid var(--af-border);
    border-radius: 4px;
    font-size: 15px;
    color: #333;
    background: #fff;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.af-field input:focus,
.af-field select:focus {
    border-color: var(--af-accent);
    box-shadow: 0 0 0 2px rgba(20,119,210,.15);
}
.af-field .af-input-wrap .af-unit {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #999;
    pointer-events: none;
}

/* ---- Checkbox toggle ---- */
.af-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}
.af-toggle input { width: 17px; height: 17px; accent-color: var(--af-accent); }

/* ---- Results ---- */
.af-results {
    background: var(--af-bg);
    border: 1px solid var(--af-border);
    border-radius: 6px;
    padding: 22px 24px;
    min-height: 100%;
}
.af-results .af-results-title {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    color: #222;
    margin-bottom: 16px;
}
.af-results table { width: 100%; border-collapse: collapse; }
.af-results td {
    padding: 9px 6px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    color: #555;
}
.af-results td.af-val { text-align: right; font-weight: 600; color: #222; white-space: nowrap; }
.af-results .af-total td {
    border-bottom: none;
    border-top: 2px solid var(--af-accent);
    padding-top: 14px;
    font-size: 17px;
    font-weight: 700;
    color: var(--af-accent-dark);
}
.af-results .af-total td.af-val { font-size: 22px; color: var(--af-accent-dark); }
.af-results .af-disclaimer {
    margin-top: 14px;
    font-size: 12px;
    color: #888;
    line-height: 1.5;
}
.af-results .af-note-empty {
    color: #999;
    font-size: 14px;
    font-style: italic;
}
.af-results .af-note-var {
    font-size: 13px;
    color: var(--af-accent-dark);
    font-weight: 600;
    text-align: right;
    white-space: normal;
    line-height: 1.4;
}

/* ---- Buttons ---- */
.af-btn {
    display: inline-block;
    padding: 12px 26px;
    background: var(--af-accent);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    cursor: pointer;
    transition: background .2s;
    text-decoration: none;
}
.af-btn:hover { background: var(--af-accent-dark); color: #fff; text-decoration: none; }
.af-btn-block { display: block; width: 100%; text-align: center; }

/* ---- Rates table (info) ---- */
.af-rates-table { width: 100%; border-collapse: collapse; }
.af-rates-table th, .af-rates-table td {
    padding: 10px 14px;
    border: 1px solid var(--af-border);
    font-size: 14px;
    text-align: center;
}
.af-rates-table th {
    background: var(--af-bg);
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
    font-size: 12px;
}

/* ---- Formula explainer boxes ---- */
.af-formula {
    background: var(--af-bg);
    border-left: 3px solid var(--af-accent);
    padding: 14px 18px;
    margin: 10px 0 20px;
    border-radius: 0 4px 4px 0;
    font-size: 14px;
    color: #444;
}
.af-formula b { color: #222; }

/* ---- Layout helpers for full page ---- */
.af-calc-full .af-calc-col-form { margin-bottom: 24px; }

/* ---- Homepage CTA strip ---- */
.af-cta {
    background: var(--af-accent);
    color: #fff;
    text-align: center;
    padding: 52px 0;
}
.af-cta h2 {
    color: #fff;
    font-size: 30px;
    font-weight: 700;
    margin: 0 0 10px;
    text-transform: uppercase;
}
.af-cta p { color: rgba(255,255,255,.92); font-size: 16px; margin: 0 0 26px; }
.af-cta .af-btn {
    background: #fff;
    color: var(--af-accent-dark);
}
.af-cta .af-btn:hover { background: #f2f2f2; color: var(--af-accent-dark); }

/* ---- Widget (sidebar) ---- */
.af-widget .af-box { padding: 16px; }
.af-widget h3 { font-size: 15px; margin-bottom: 12px; }
.af-widget .af-field { flex-basis: 100%; }
.af-widget .af-results { padding: 14px 16px; }
.af-widget .af-results td { padding: 6px 4px; font-size: 13px; }

/* Prevent the results table from overflowing the narrow sidebar widget
   (the theme's .widget has overflow:hidden and was clipping the total). */
.widget.af-widget { overflow: visible; }
.af-widget .af-results { overflow: hidden; }
.af-widget .af-results table { table-layout: fixed; width: 100%; }
.af-widget .af-results td:first-child { width: 44%; }
.af-widget .af-results td { overflow-wrap: break-word; }
.af-widget .af-results td.af-val { white-space: normal; word-break: break-word; }
.af-widget .af-results .af-total td.af-val { font-size: 18px; }

/* ---- Responsive ---- */
@media (max-width: 767px) {
    .af-cta h2 { font-size: 24px; }
}
