/* ──────────────────────────────────────────────────────────────────────────
   Elementor Table Widget — Frontend Styles
   ────────────────────────────────────────────────────────────────────────── */

.etw-table-wrap {
    width: 100%;
    display: block;
}

/* Horizontal scroll mode */
.etw-table-wrap.etw-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.etw-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    font-family: inherit;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.etw-table thead th {
    background-color: #164680;
    color: #ffffff;
    font-weight: 600;
    text-align: center;
    padding: 14px 16px;
    border: 1px solid #e0e0e0;
    white-space: nowrap;
}

.etw-table thead th .etw-header-icon {
    margin-right: 6px;
    vertical-align: middle;
    opacity: 0.85;
}

/* ── Body cells ─────────────────────────────────────────────────────────── */
.etw-table tbody td {
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    color: #333333;
    background-color: #ffffff;
    transition: background-color 0.15s ease;
    vertical-align: middle;
}

/* ── Striped rows ───────────────────────────────────────────────────────── */
.etw-table.etw-striped tbody tr:nth-child(even) td {
    background-color: #f5f7fa;
}

/* ── Hover highlight ────────────────────────────────────────────────────── */
.etw-table.etw-hover tbody tr:hover td {
    background-color: #eef2ff;
    cursor: default;
}

/* ══════════════════════════════════════════════════════════════════════════
   STACKED CARD LAYOUT — mobile
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {

    .etw-table-wrap.etw-stack .etw-table,
    .etw-table-wrap.etw-stack .etw-table tbody,
    .etw-table-wrap.etw-stack .etw-table tr,
    .etw-table-wrap.etw-stack .etw-table td {
        display: block;
        width: 100%;
    }

    /* Hide the desktop header row */
    .etw-table-wrap.etw-stack .etw-table thead {
        display: none;
    }

    /* Each row becomes a card */
    .etw-table-wrap.etw-stack .etw-table tbody tr {
        margin-bottom: 12px;
        border: 1px solid #e0e0e0;
        border-radius: 6px;
        overflow: hidden;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    }

    /* Reset borders on individual cells inside a card */
    .etw-table-wrap.etw-stack .etw-table tbody td {
        border: none;
        border-bottom: 1px solid #e0e0e0;
        padding: 10px 14px;
        display: flex;
        align-items: baseline;
        gap: 10px;
        text-align: left !important;
    }

    .etw-table-wrap.etw-stack .etw-table tbody td:last-child {
        border-bottom: none;
    }

    /* Inject the column label before each value */
    .etw-table-wrap.etw-stack .etw-table tbody td[data-label]::before {
        content: attr(data-label);
        font-weight: 700;
        color: #164680;
        white-space: nowrap;
        min-width: 40%;
        flex-shrink: 0;
        font-size: 0.82em;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    /* Stripe per card */
    .etw-table-wrap.etw-stack .etw-table.etw-striped tbody tr:nth-child(even) td {
        background-color: #f5f7fa;
    }

    /* Hover on stacked cards */
    .etw-table-wrap.etw-stack .etw-table.etw-hover tbody tr:hover td {
        background-color: #eef2ff;
    }
}

/* ── Scroll mode: shrink padding on small screens ───────────────────────── */
@media (max-width: 767px) {
    .etw-table-wrap.etw-scroll .etw-table thead th,
    .etw-table-wrap.etw-scroll .etw-table tbody td {
        padding: 10px 12px;
        font-size: 0.875em;
    }
}

/* ── Caption / Note ─────────────────────────────────────────────────────── */
.etw-caption {
    margin-top: 8px;
    margin-bottom: 0;
    color: #888888;
    font-size: 0.875em;
    text-align: right;
    line-height: 1.5;
}
