/* ==========================================================================
   Blog Responsive Compact Tables (Desktop & Mobile) - Theme LightShop Style
   ========================================================================== */

/* 1. Scrollable Table Wrapper */
.zk-table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 22px 0 28px 0;
    border-radius: 12px;
    border: 1px solid #e8e2dc;
    box-shadow: 0 3px 14px rgba(142, 96, 72, 0.07);
    background: #ffffff;
    position: relative;
    box-sizing: border-box;
}

/* Scroll hint on mobile */
.zk-table-hint {
    display: none;
}

@media (max-width: 767px) {
    .zk-table-hint {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 6px;
        padding: 8px 14px;
        font-size: 12px;
        font-weight: 600;
        color: #8e6048;
        background: #faf6f2;
        border-bottom: 1px solid #eee7e0;
        letter-spacing: 0.02em;
    }
    .zk-table-hint svg {
        width: 14px;
        height: 14px;
        fill: currentColor;
    }
}

/* 2. Desktop Table Styling */
.editor table.zk-table,
.editor table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
    font-size: 14.5px;
    line-height: 1.45;
    color: #333333;
    margin: 0;
}

.editor table.zk-table thead th,
.editor table thead th {
    background: linear-gradient(180deg, #faf7f4 0%, #f1ece6 100%);
    color: #443226;
    font-weight: 700;
    font-size: 14px;
    padding: 13px 16px;
    border-bottom: 2px solid #8e6048;
    border-right: 1px solid #e8e2dc;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.editor table.zk-table thead th:last-child,
.editor table thead th:last-child {
    border-right: none;
}

.editor table.zk-table tbody tr,
.editor table tbody tr {
    transition: background-color 0.15s ease;
}

.editor table.zk-table tbody tr:nth-child(even),
.editor table tbody tr:nth-child(even) {
    background-color: #faf8f6;
}

.editor table.zk-table tbody tr:hover,
.editor table tbody tr:hover {
    background-color: #f5eee8;
}

.editor table.zk-table tbody td,
.editor table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #eee7e0;
    border-right: 1px solid #eee7e0;
    vertical-align: middle;
    color: #333333;
    font-size: 14px;
}

.editor table.zk-table tbody tr:last-child td,
.editor table tbody tr:last-child td {
    border-bottom: none;
}

.editor table.zk-table tbody td:last-child,
.editor table tbody td:last-child {
    border-right: none;
}

.editor table.zk-table td.zk-model {
    font-weight: 700;
    color: #3b281d;
    font-size: 14.5px;
    white-space: nowrap;
}

.editor table.zk-table td[data-label="№"] {
    text-align: center;
    font-weight: 700;
    color: #8e6048;
}

/* 3. Mobile Compact Table Styling (screens <= 767px) */
@media (max-width: 767px) {
    .zk-table-wrapper {
        margin: 16px 0 24px 0;
        border-radius: 10px;
        box-shadow: 0 2px 12px rgba(142, 96, 72, 0.08);
    }

    .editor table.zk-table,
    .editor table {
        font-size: 13.5px !important;
        line-height: 1.4 !important;
        min-width: 600px; /* Comfortable width with clear readable typography */
    }

    /* Compact Header */
    .editor table.zk-table thead th,
    .editor table thead th {
        padding: 10px 12px !important;
        font-size: 13px !important;
        font-weight: 700 !important;
        background: #f7f3ee !important;
        color: #443226 !important;
        border-bottom: 2px solid #8e6048 !important;
        border-right: 1px solid #e8e2dc !important;
        white-space: nowrap !important;
        letter-spacing: 0.01em !important;
    }

    /* Compact Cells */
    .editor table.zk-table tbody td,
    .editor table tbody td {
        padding: 9px 12px !important;
        font-size: 13.5px !important;
        border-bottom: 1px solid #ede7e1 !important;
        border-right: 1px solid #ede7e1 !important;
        white-space: nowrap !important;
        color: #2e2e2e !important;
    }

    /* Sticky first column (Model / #) on mobile */
    .editor table.zk-table thead th:first-child,
    .editor table thead th:first-child {
        position: sticky;
        left: 0;
        z-index: 3;
        background: #f7f3ee !important;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.06);
    }

    .editor table.zk-table tbody td:first-child,
    .editor table tbody td:first-child {
        position: sticky;
        left: 0;
        z-index: 2;
        background: #ffffff !important;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.06);
        font-weight: 600;
        font-size: 13.5px !important;
    }

    .editor table.zk-table tbody tr:nth-child(even) td:first-child,
    .editor table tbody tr:nth-child(even) td:first-child {
        background: #faf8f6 !important;
    }

    .editor table.zk-table tbody tr:hover td:first-child,
    .editor table tbody tr:hover td:first-child {
        background: #f5eee8 !important;
    }

    /* Model cell */
    .editor table.zk-table td.zk-model {
        font-weight: 700 !important;
        color: #3b281d !important;
        font-size: 14px !important;
    }

    /* Price highlight */
    .editor table.zk-table td[data-label*="Цена"] {
        font-weight: 700 !important;
        color: #8e6048 !important;
        font-size: 14px !important;
    }

    /* Rating highlight */
    .editor table.zk-table td[data-label*="Рейтинг"] {
        font-weight: 700 !important;
        font-size: 13.5px !important;
    }
}

/* Custom Scrollbar for the table wrapper */
.zk-table-wrapper::-webkit-scrollbar {
    height: 6px;
}

.zk-table-wrapper::-webkit-scrollbar-track {
    background: #f5f0eb;
    border-radius: 3px;
}

.zk-table-wrapper::-webkit-scrollbar-thumb {
    background: #cbbab0;
    border-radius: 3px;
}

.zk-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #8e6048;
}
