/* ============================================================
   Alfalend Teenused – Frontend Styles
   v1.0.0
   ============================================================ */

.af-services {
    --af-brown:      #3D1A00;
    --af-green:      #7DC242;
    --af-green-dim:  rgba(125, 194, 66, 0.15);
    --af-green-brd:  rgba(125, 194, 66, 0.35);
    --af-text:       #1e1a16;
    --af-muted:      #6b5f55;
    --af-bg:         #ffffff;
    --af-bg-expand:  #faf7f3;
    --af-border:     #e8e0d8;
    --af-yellow:     #fff8e1;
    --af-yellow-brd: #f5e280;
    --af-radius:     10px;
    --af-font:       'Inter', 'Poppins', -apple-system, sans-serif;

    font-family: var(--af-font);
    color:       var(--af-text);
    line-height: 1.65;
}

.af-services *,
.af-services *::before,
.af-services *::after {
    box-sizing: border-box;
}

/* ── Category filter tabs ── */

.af-svc-filter {
    display:     flex;
    flex-wrap:   wrap;
    gap:         8px;
    margin-bottom: 28px;
}

.af-tab {
    background:    transparent;
    border:        1.5px solid var(--af-border);
    border-radius: 40px;
    padding:       7px 18px;
    font-size:     14px;
    font-weight:   500;
    color:         var(--af-muted);
    cursor:        pointer;
    transition:    all 0.17s ease;
    line-height:   1.3;
}

.af-tab:hover {
    border-color: var(--af-green);
    color:        var(--af-green);
}

.af-tab.is-active {
    background:   var(--af-green);
    border-color: var(--af-green);
    color:        #fff;
    font-weight:  600;
}

/* ── Services list ── */

.af-svc-list {
    display:        flex;
    flex-direction: column;
    gap:            12px;
}

/* ── Service card ── */

.af-svc {
    background:    var(--af-bg);
    border:        1.5px solid var(--af-border);
    border-radius: var(--af-radius);
    border-left:   4px solid var(--af-green);
    overflow:      hidden;
    transition:    box-shadow 0.2s ease, border-color 0.2s ease;
}

.af-svc:hover {
    box-shadow: 0 4px 16px rgba(61, 26, 0, 0.09);
}

.af-svc.is-open {
    border-color: var(--af-green);
    box-shadow:   0 6px 24px rgba(61, 26, 0, 0.12);
}

/* ── Card header ── */

.af-svc-head {
    display:     flex;
    align-items: center;
    gap:         16px;
    padding:     18px 20px;
    cursor:      pointer;
    user-select: none;
}

.af-svc-head:hover .af-svc-toggle {
    background: var(--af-surface-strong, var(--af-brown));
    color:      var(--af-on-surface-strong, #fff);
    border-color: var(--af-surface-strong, var(--af-brown));
}

/* ── Icon circle ── */

.af-svc-icon {
    width:           46px;
    height:          46px;
    min-width:       46px;
    background:      var(--af-green-dim);
    border-radius:   50%;
    display:         flex;
    align-items:     center;
    justify-content: center;
    color:           var(--af-green);
    border:          1.5px solid var(--af-green-brd);
    transition:      background 0.2s, border-color 0.2s;
}

.af-svc-icon svg {
    width:  22px;
    height: 22px;
}

.af-svc.is-open .af-svc-icon {
    background:   var(--af-green);
    border-color: var(--af-green);
    color:        #fff;
}

/* ── Card info block ── */

.af-svc-info {
    flex:     1;
    min-width: 0;
}

.af-svc-title-row {
    display:     flex;
    align-items: center;
    flex-wrap:   wrap;
    gap:         8px;
    margin-bottom: 4px;
}

.af-svc-title {
    font-size:   17px;
    font-weight: 700;
    color:       var(--af-brown);
    line-height: 1.2;
    margin:      0;
}

.af-svc-cat {
    font-size:      11px;
    font-weight:    600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color:          var(--af-green);
    background:     var(--af-green-dim);
    padding:        2px 8px;
    border-radius:  20px;
}

.af-svc-short {
    font-size:   14px;
    color:       var(--af-muted);
    margin:      0 0 8px;
    line-height: 1.5;
}

/* ── Price chips ── */

.af-chips {
    display:   flex;
    flex-wrap: wrap;
    gap:       6px;
}

.af-chip {
    font-size:     12px;
    font-weight:   600;
    color:         var(--af-brown);
    background:    rgba(61, 26, 0, 0.07);
    border:        1px solid rgba(61, 26, 0, 0.15);
    border-radius: 4px;
    padding:       3px 8px;
    white-space:   nowrap;
}

.af-chip-more {
    color:      var(--af-muted);
    background: transparent;
    border-color: var(--af-border);
}

/* ── Toggle button ── */

.af-svc-toggle {
    display:         flex;
    align-items:     center;
    gap:             6px;
    flex-shrink:     0;
    background:      transparent;
    border:          1.5px solid var(--af-green);
    border-radius:   6px;
    color:           var(--af-green);
    font-size:       13px;
    font-weight:     600;
    padding:         7px 13px;
    cursor:          pointer;
    transition:      all 0.17s ease;
    white-space:     nowrap;
    font-family:     inherit;
}

.af-toggle-label { line-height: 1; }

.af-chev {
    width:      14px;
    height:     14px;
    transition: transform 0.25s ease;
}

.af-svc.is-open .af-chev {
    transform: rotate(180deg);
}

/* ── Expandable body ── */

.af-svc-body {
    max-height: 0;
    overflow:   hidden;
    transition: max-height 0.38s ease, opacity 0.25s ease;
    opacity:    0;
}

.af-svc.is-open .af-svc-body {
    max-height: 4000px;
    opacity:    1;
}

.af-svc-body-inner {
    background:  var(--af-bg-expand);
    border-top:  1.5px solid var(--af-border);
    padding:     24px 24px 24px 28px;
    display:     flex;
    flex-direction: column;
    gap:         20px;
}

/* ── Post content inside expanded body ── */

.af-svc-content {
    font-size:   15px;
    color:       var(--af-text);
    line-height: 1.7;
}

.af-svc-content p { margin: 0 0 12px; }
.af-svc-content p:last-child { margin-bottom: 0; }
.af-svc-content ul, .af-svc-content ol { margin: 0 0 12px 20px; }
.af-svc-content li { margin-bottom: 4px; }
.af-svc-content strong { color: var(--af-brown); }

/* ── Price table ── */

.af-svc-prices-title {
    font-size:   13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color:       var(--af-muted);
    margin:      0 0 10px;
}

.af-price-table {
    width:           100%;
    border-collapse: collapse;
    font-size:       14px;
    border-radius:   8px;
    overflow:        hidden;
}

.af-price-table thead tr {
    background: var(--af-surface-strong, var(--af-brown));
    color:      var(--af-on-surface-strong, #fff);
}

.af-price-table th {
    padding:    10px 14px;
    font-weight: 600;
    font-size:  12.5px;
    text-align: left;
    letter-spacing: 0.4px;
}

.af-price-table tbody tr:nth-child(even) {
    background: rgba(61, 26, 0, 0.035);
}

.af-price-table tbody tr:hover {
    background: var(--af-green-dim);
}

.af-price-table td {
    padding:    10px 14px;
    border-bottom: 1px solid var(--af-border);
    vertical-align: top;
    line-height: 1.45;
}

.af-price-table tbody tr:last-child td {
    border-bottom: none;
}

.af-price-val {
    font-weight: 700;
    color:       var(--af-green);
    white-space: nowrap;
}

.af-col-note {
    color:    var(--af-muted);
    font-size: 13px;
}

/* Mobile: hide notes column if empty */
@media (max-width: 600px) {
    .af-col-note { display: none; }
    .af-price-table th.af-col-note { display: none; }
}

/* ── Timeline + Notes rows ── */

.af-svc-meta {
    display:     flex;
    align-items: flex-start;
    gap:         10px;
    font-size:   14px;
    line-height: 1.5;
    border-radius: 6px;
    padding:     10px 14px;
}

.af-svc-meta svg {
    width:      18px;
    height:     18px;
    flex-shrink: 0;
    margin-top:  1px;
}

.af-svc-timeline {
    background: rgba(125, 194, 66, 0.10);
    color:      #3a6e0a;
    border:     1px solid rgba(125, 194, 66, 0.25);
}

.af-svc-timeline svg { color: var(--af-green); }

.af-svc-notes {
    background: var(--af-yellow);
    color:      #6b5400;
    border:     1px solid var(--af-yellow-brd);
}

.af-svc-notes svg { color: #c9a200; }

/* ── Single service [af_service id="..."] ── */

.af-service-single {
    background:    var(--af-bg);
    border:        1.5px solid var(--af-border);
    border-left:   4px solid var(--af-green);
    border-radius: var(--af-radius);
    overflow:      hidden;
}

.af-ss-head {
    display:     flex;
    align-items: center;
    gap:         16px;
    padding:     20px 24px;
    background:  var(--af-surface-strong, var(--af-brown));
}

.af-ss-head .af-svc-icon {
    background:   var(--af-on-surface-strong-faint, rgba(255,255,255,0.15));
    border-color: var(--af-on-surface-strong-soft, rgba(255,255,255,0.3));
    color:        var(--af-on-surface-strong, #fff);
}

.af-ss-title {
    font-size:   22px;
    font-weight: 700;
    color:       var(--af-on-surface-strong, #fff);
    margin:      0 0 4px;
    line-height: 1.2;
}

.af-ss-head .af-svc-cat {
    background: var(--af-on-surface-strong-faint, rgba(255,255,255,0.15));
    color:      var(--af-on-surface-strong-soft, rgba(255,255,255,0.85));
}

.af-ss-body {
    padding: 0;
}

.af-ss-body .af-svc-body-inner {
    border-top:  none;
    padding:     28px 28px 28px 32px;
}

/* ── No services message ── */

.af-no-services {
    color:     var(--af-muted);
    font-size: 15px;
}

/* ── Responsive ── */

@media (max-width: 768px) {
    .af-svc-head {
        flex-wrap: wrap;
        gap:       12px;
    }
    .af-svc-toggle {
        margin-top: 4px;
        width:      100%;
        justify-content: center;
    }
    .af-svc-body-inner {
        padding: 20px 18px;
    }
    .af-svc-title { font-size: 15px; }
    .af-ss-title  { font-size: 18px; }
    .af-ss-head   { padding: 16px 18px; }
    .af-ss-body .af-svc-body-inner { padding: 20px 18px; }
}

@media (max-width: 480px) {
    .af-svc-head { padding: 14px 14px; }
    .af-svc-icon { width: 38px; height: 38px; min-width: 38px; }
    .af-svc-icon svg { width: 18px; height: 18px; }
}
