/*
 * =========================================================================
 * FILE: assets/css/style.css
 * =========================================================================
 */
/* TABLE WRAPPER & LOADING */
.kaleco-table-wrapper { 
    min-height: 200px; 
    position: relative; 
    transition: opacity 0.3s ease-in-out; 
}

/* TABS */
.kaleco-tabs { 
    margin-bottom: 20px; 
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.kaleco-tab { 
    background: #eee; 
    border: 1px solid #ddd; 
    padding: 10px 20px; 
    border-radius: 6px; 
    cursor: pointer; 
    font-weight: 600; 
    font-size: 15px; 
    transition: all 0.2s ease-in-out; 
    line-height: 1.2;
}
.kaleco-tab:hover { 
    background: #ddd; 
    border-color: #ccc;
}
.kaleco-tab.active { 
    background: #45a5d8; 
    color: #fff; 
    border-color: #45a5d8;
}

/* MAIN TABLE STYLES */
.kaleco-table { 
    width: 100%; 
    border-collapse: collapse; 
    margin: 0; 
    font-family: inherit; 
}
.kaleco-table th { 
    background: #45a5d8; 
    color: #fff; 
    padding: 12px 15px; 
    text-align: left; 
    font-weight: bold;
}
.kaleco-table th.sortable { 
    cursor: pointer; 
}
.kaleco-table th.sortable:hover {
    background: #3a96c7;
}
.kaleco-table th.asc, 
.kaleco-table th.desc { 
    background: #2e7ca4; 
}
.kaleco-table td { 
    border-bottom: 1px solid #ddd; 
    padding: 12px 15px; 
    vertical-align: middle; 
}
.kaleco-table tr:last-child td {
    border-bottom: none;
}

/* Style for the random sort header */
.kaleco-table th[data-sort="random"] {
    text-align: center;
}
.kaleco-table th[data-sort="random"] .dashicons {
    font-size: 20px;
    line-height: inherit;
}

/* Style for the sort arrow container */
.sort-arrow {
    display: inline-block;
    width: 1em;
    text-align: left;
    margin-left: 5px;
}

/* TABLE CELL CONTENT */
.kaleco-table td.kaleco-thumb { 
    width: 170px; /* Width for the container cell */
    padding: 10px !important; 
}
.kaleco-table td.kaleco-thumb img { 
    width: 150px !important; 
    height: 150px !important; 
    object-fit: cover !important; 
    display: block !important; 
    margin: 0 !important; 
    border-radius: 6px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.kaleco-table a { 
    text-decoration: none !important; 
    color: inherit;
}
.kaleco-name-desc strong { 
    color: #0a2e40; 
    display: block; 
    margin-bottom: 5px; 
    font-size: 1.1em;
}
.kaleco-desc { 
    color: #444; 
    font-size: 0.9em; 
}
.kaleco-price { 
    font-weight: bold; 
    color: #000; 
    text-align: center; 
    font-size: 1.1em;
}
.kaleco-rating { 
    text-align: center; 
    white-space: nowrap; 
}
.kaleco-rating .star-rating {
    margin: 0 auto;
}
.kaleco-rating .no-rating { 
    color: #aaa; 
    font-size: 0.9em; 
}
.kaleco-table td.kaleco-action { 
    text-align: center !important; 
}
.kaleco-table .kaleco-learnmore { 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    gap: 6px; 
    background: #45a5d8; 
    color: #fff; 
    padding: 8px 14px; 
    border-radius: 6px; 
    font-weight: 600; 
    font-size: 0.95em; 
    text-decoration: none !important; 
    white-space: nowrap; 
    transition: background-color 0.2s ease-in-out;
}
.kaleco-table .kaleco-learnmore:hover { 
    background: #2e7ca4; 
}

/* MOBILE STACKED VIEW */
@media (max-width: 768px) {
    .kaleco-table, 
    .kaleco-table thead, 
    .kaleco-table tbody, 
    .kaleco-table th, 
    .kaleco-table td, 
    .kaleco-table tr { 
        display: block; 
        width: 100% !important; 
        border: none !important; 
    }
    .kaleco-table thead { 
        display: none; 
    }
    .kaleco-table tr { 
        margin-bottom: 20px; 
        border: 1px solid #ddd !important; 
        border-radius: 8px; 
        padding: 15px; 
        background: #fff; 
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    }
    .kaleco-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0 !important;
        border-bottom: 1px solid #eee !important;
        text-align: right;
    }
    .kaleco-table td:last-child {
        border-bottom: none !important;
    }
    .kaleco-table td:before {
        content: attr(data-label);
        font-weight: bold;
        padding-right: 15px;
        text-align: left;
    }
    /* Re-define specific cells for the stacked layout */
    .kaleco-table td.kaleco-thumb,
    .kaleco-table td.kaleco-name-desc,
    .kaleco-table td.kaleco-action {
        display: block;
        text-align: center;
    }
    .kaleco-table td.kaleco-thumb {
        margin-bottom: 15px;
    }
    .kaleco-table td.kaleco-thumb img { 
        width: 250px !important; 
        height: 250px !important; 
        margin: 0 auto 10px !important; 
    }
    .kaleco-name-desc strong {
        font-size: 1.2em;
    }
    .kaleco-table td.kaleco-rating,
    .kaleco-table td.kaleco-price {
        justify-content: center;
    }
    .kaleco-table td.kaleco-rating:before,
    .kaleco-table td.kaleco-price:before {
        display: none;
    }
    .kaleco-table td.kaleco-action {
        margin-top: 15px;
    }
    
    .kaleco-tabs { 
        gap: 6px; 
    }
    .kaleco-tab { 
        flex: 1 1 auto; 
        margin: 0; 
        text-align: center; 
    }
    
    /* Hide labels for cells that don't need them */
    .kaleco-table td.kaleco-thumb:before,
    .kaleco-table td.kaleco-name-desc:before,
    .kaleco-table td.kaleco-action:before {
        content: "" !important;
        display: none;
    }
}
