/* ==========================================================
   Elementor Advanced Table Widget — Frontend Styles
   ========================================================== */

/* ── Wrapper ─────────────────────────────────────────────── */
.etw-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Base Table ──────────────────────────────────────────── */
.etw-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    font-size: inherit;
}

/* ── Cells ───────────────────────────────────────────────── */
.etw-table td,
.etw-table th {
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    vertical-align: middle;
    line-height: 1.5;
    word-break: break-word;
}

/* ── Label (Key) Cells ───────────────────────────────────── */
.etw-table .etw-cell-label {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #212529;
    text-align: left;
    min-width: 25%;
    max-width: 25%;
    width: 25%;
    font-size: 0.9em;
}

/* ── Value Cells ─────────────────────────────────────────── */
.etw-table .etw-cell-value {
    background-color: #ffffff;
    color: #495057;
    text-align: right;
    min-width: 25%;
    max-width: 25%;
    width: 25%;
    font-size: 0.9em;
}

/* ── Custom / Template Cells ────────────────────────────── */
.etw-table .etw-cell-custom {
    background-color: #ffffff;
    color: #212529;
    text-align: left;
}

.etw-table .etw-cell-content > :first-child {
    margin-top: 0;
}

.etw-table .etw-cell-content > :last-child {
    margin-bottom: 0;
}

.etw-table .etw-cell-content .elementor,
.etw-table .etw-cell-content .elementor-section,
.etw-table .etw-cell-content .elementor-container,
.etw-table .etw-cell-content .elementor-widget-wrap,
.etw-table .etw-cell-content .e-con,
.etw-table .etw-cell-content .e-child {
    max-width: 100%;
    width: 100%;
}

.etw-table .etw-cell-empty,
.etw-table .etw-template-preview {
    color: #6c757d;
    display: block;
    font-style: italic;
    text-align: center;
}

/* ── Header ──────────────────────────────────────────────── */
.etw-table thead th {
    background-color: #343a40;
    color: #ffffff;
    font-weight: 700;
    text-align: left;
    padding: 12px 16px;
    white-space: nowrap;
}

/* ── Zebra Striping ──────────────────────────────────────── */
.etw-table.etw-zebra tbody tr:nth-child(even) td,
.etw-table.etw-zebra tbody tr:nth-child(even) th {
    background-color: #f8f9fa;
}
.etw-table.etw-zebra tbody tr:nth-child(odd) td,
.etw-table.etw-zebra tbody tr:nth-child(odd) th {
    background-color: #ffffff;
}

/* ── Hover ───────────────────────────────────────────────── */
.etw-table.etw-hoverable tbody tr td,
.etw-table.etw-hoverable tbody tr th {
    transition: background-color 200ms ease, color 200ms ease;
}
.etw-table.etw-hoverable tbody tr:hover td,
.etw-table.etw-hoverable tbody tr:hover th {
    background-color: #e8f4f8;
}

/* ── Highlighted Row ─────────────────────────────────────── */
.etw-table tr.etw-row-highlight td,
.etw-table tr.etw-row-highlight th {
    background-color: #fff3cd !important;
}

/* ── Icon in label cell ──────────────────────────────────── */
.etw-table .etw-label-icon {
    display: inline-flex;
    align-items: center;
    margin-right: 6px;
    vertical-align: middle;
    opacity: 0.7;
}
.etw-table .etw-label-icon svg,
.etw-table .etw-label-icon i {
    font-size: 0.9em;
    line-height: 1;
}

/* ==========================================================
   Responsive — Stack layout on mobile
   ========================================================== */
@media (max-width: 767px) {
    .etw-table.etw-responsive thead {
        display: none;
    }

    .etw-table.etw-responsive,
    .etw-table.etw-responsive tbody,
    .etw-table.etw-responsive tr,
    .etw-table.etw-responsive td,
    .etw-table.etw-responsive th {
        display: flex;
        width: 100% !important;
        flex-wrap: wrap;
    }

    .etw-table.etw-responsive tr {
        border: 1px solid #dee2e6;
        overflow: hidden;
    }

    .etw-table.etw-responsive td,
    .etw-table.etw-responsive th {
        text-align: left !important;
        border: none;
        border-bottom: 1px solid #dee2e6;
    }

    .etw-table.etw-responsive td:last-child,
    .etw-table.etw-responsive th:last-child {
        border-bottom: none;
    }

    .etw-table.etw-responsive .etw-cell-label {
        font-weight: 700;
        width: 50% !important;
        min-width: 50%;
        max-width: 50%;
        border-right: 1px solid #dee2e6;
    }

    .etw-table.etw-responsive .etw-cell-value {
        width: 50% !important;
        min-width: 50%;
        max-width: 50%;
    }

    /* Four-column: each pair stacks as its own block */
    .etw-table.etw-responsive tr > .etw-cell-label:nth-child(3),
    .etw-table.etw-responsive tr > .etw-cell-value:nth-child(4) {
        border-top: 1px solid #dee2e6;
    }
}
