/* =========================
   Base wrapper + themes
   ========================= */
.wootable-wrapper {
    margin: 1.5em 0;
    font-size: 14px;
    color: #222;
}

.wootable-wrapper.wootable-theme-compact {
    font-size: 13px;
}

.wootable-wrapper.wootable-theme-bordered .wootable-table {
    border: 1px solid #ddd;
    border-collapse: separate;
    border-spacing: 0;
}

/* =========================
   Search row + reset link
   ========================= */
.wootable-search-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.wootable-search-input {
    flex: 1 1 220px;
    max-width: 350px;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
}

.wootable-reset-filters {
    font-size: 13px;
    text-decoration: none;
    color: #555;
    padding: 5px 10px;
    border-radius: 3px;
    border: 1px solid #ddd;
    background: #f7f7f7;
    cursor: pointer;
}

.wootable-reset-filters:hover {
    background: #eee;
    color: #000;
}

/* =========================
   Filters row
   ========================= */
.wootable-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.wootable-filter-item label {
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.wootable-filter-item select.wootable-filter {
    min-width: 150px;
    padding: 4px 6px;
    font-size: 13px;
}

/* =========================
   Table
   ========================= */
.wootable-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.wootable-table th,
.wootable-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.wootable-wrapper.wootable-theme-compact .wootable-table th,
.wootable-wrapper.wootable-theme-compact .wootable-table td {
    padding: 6px 8px;
}

.wootable-wrapper.wootable-theme-bordered .wootable-table th,
.wootable-wrapper.wootable-theme-bordered .wootable-table td {
    border-right: 1px solid #eee;
}

.wootable-wrapper.wootable-theme-bordered .wootable-table tr:last-child td {
    border-bottom: none;
}

.wootable-table thead th {
    background: #f9f9f9;
    font-weight: 600;
    font-size: 13px;
    text-align: left;
}

/* Image column */
.wootable-col-image img {
    display: inline-block;
}

/* “View” button */
.wootable-view-product.button {
    font-size: 12px;
    line-height: 1.4;
    padding: 4px 10px;
}

/* Attribute header & cells (pa_color, pa_size, etc.) */
.wootable-col-attr {
    font-size: 13px;
    white-space: nowrap;
}

/* =========================
   Sortable header (visual hints only)
   JS should add/remove .wootable-sort-asc/desc classes
   ========================= */
.wootable-table th[data-sort-key] {
    cursor: pointer;
    position: relative;
    padding-right: 18px;
}

.wootable-table th[data-sort-key]:after {
    content: '⇅';
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: #aaa;
}

.wootable-table th.wootable-sort-asc[data-sort-key]:after {
    content: '▲';
    color: #555;
}

.wootable-table th.wootable-sort-desc[data-sort-key]:after {
    content: '▼';
    color: #555;
}

/* =========================
   Pagination
   ========================= */
.wootable-pagination {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    font-size: 13px;
}

.wootable-pagination .wootable-page-btn {
    padding: 4px 8px;
    border-radius: 3px;
    border: 1px solid #ddd;
    background: #f9f9f9;
    cursor: pointer;
    text-decoration: none;
    color: #333;
}

.wootable-pagination .wootable-page-btn:hover {
    background: #eee;
}

.wootable-pagination .wootable-page-btn.is-active {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
    font-weight: 600;
}

/* =========================
   Responsive – card layout on mobile
   ========================= */
@media (max-width: 768px) {
    .wootable-table {
        border: 0;
    }

    .wootable-table thead {
        display: none;
    }

    .wootable-table tbody {
        display: block;
    }

    .wootable-table tr.wootable-row {
        display: block;
        margin-bottom: 12px;
        border: 1px solid #eee;
        border-radius: 6px;
        padding: 8px 10px;
        background: #fff;
        box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    }

    .wootable-wrapper.wootable-theme-compact .wootable-table tr.wootable-row {
        margin-bottom: 8px;
        padding: 6px 8px;
    }

    .wootable-table td {
        display: block;
        width: 100% !important;
        border: 0;
        padding: 4px 0;
    }

    .wootable-table td:first-child {
        margin-top: 0;
    }

    .wootable-table td:last-child {
        margin-bottom: 0;
    }

    /* Label on the left (from data-label) */
    .wootable-table td::before {
        content: attr(data-label);
        display: inline-block;
        font-weight: 600;
        margin-right: 6px;
        min-width: 90px;
        color: #555;
    }

    /* For image column, put label above image to avoid weird layout */
    .wootable-col-image {
        text-align: left !important;
    }

    .wootable-col-image::before {
        display: block;
        margin-bottom: 4px;
    }

    .wootable-col-image a img {
        max-width: 100%;
        height: auto;
    }

    /* Product title a bit bolder */
    .wootable-col-title a {
        font-weight: 600;
    }

    /* Search & filters vertical alignment tweaks */
    .wootable-search-row {
        flex-direction: row;
        align-items: stretch;
    }

    .wootable-search-input {
        flex: 1 1 auto;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .wootable-search-row {
        flex-direction: column;
        align-items: stretch;
    }

    .wootable-search-input {
        max-width: 100%;
    }

    .wootable-reset-filters {
        align-self: flex-start;
    }
}

/* Sticky filters on desktop */
@media (min-width: 783px) {
    .wootable-filters--sticky-desktop {
        position: sticky;
        top: 10px;              /* adjust if your header is tall */
        z-index: 5;
        background: #fff;
        padding-top: 4px;
        padding-bottom: 4px;
        border-bottom: 1px solid #eee;
    }
}
