/* =================================================================== */
/* CONTENEDOR RESPONSIVE PARA TABLAS - RESPONSIVE TABLE CONTAINER */
/* =================================================================== */
.table-container, .cmc-table-responsive {
    overflow-x: auto; /* Enable horizontal scrolling */
    width: 100%;
    margin-bottom: 20px;
}

.cmc-table-responsive {
    position: relative;
    margin: 20px 0;
    background: #fff;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    -webkit-overflow-scrolling: touch; /* Improve mobile scrolling */
}

/* =================================================================== */
/* ESTILOS BASE DE TABLAS - BASE TABLE STYLES */
/* =================================================================== */
.wp-list-table.widefat {
    min-width: 800px; /* Minimum width for horizontal scrolling */
    border-collapse: collapse;
    width: 100%;
}

.wp-list-table.widefat th,
.wp-list-table.widefat td {
    padding: 12px;
    text-align: left;
    border: 1px solid #ddd;
    vertical-align: middle;
}

.wp-list-table.widefat th {
    background-color: #f5f5f5;
}

/* =================================================================== */
/* ESTILOS DEL BOTÓN - BUTTON STYLES */
/* =================================================================== */
.button {
    margin: 0 3px !important;
    vertical-align: middle;
}

/* =================================================================== */
/* ESTILOS DEL INTERRUPTOR DE VISIBILIDAD - TOGGLE SWITCH STYLES */
/* =================================================================== */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #2196F3;
}

input:checked + .toggle-slider:before {
    transform: translateX(30px);
}

/* =================================================================== */
/* ESTILOS DE PRECIOS EN EL FRONT-END - FRONTEND PRICE STYLES */
/* =================================================================== */
.cmc-prices {
    margin: 15px 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.price-main {
    color: #d32f2f;
    font-size: 1.4em;
    font-weight: 700;
}

.price-alt {
    color: #666;
    font-size: 1em;
    position: relative;
    padding-left: 15px;
}

.price-alt::before {
    content: "/";
    position: absolute;
    left: 5px;
    color: #999;
}

/* =================================================================== */
/* MEJORAS DE TABLAS EN EL ADMIN - ADMIN TABLE IMPROVEMENTS */
/* =================================================================== */
.form-table input[type="number"] {
    width: 200px;
    max-width: 100%;
    padding: 5px 10px;
}

.form-table input[type="number"]:not(:first-child) {
    margin-top: 8px;
}

.wp-list-table.widefat .column-thumbnail {
    width: 100px;
    text-align: center;
}

.wp-list-table.widefat .column-name {
    min-width: 200px;
}

.wp-list-table.widefat .column-description {
    min-width: 300px;
    white-space: normal !important;
}

/* =================================================================== */
/* IMAGEN MINIATURA EN TABLAS - THUMBNAIL IMAGE IN TABLES */
/* =================================================================== */
.cmc-thumbnail-preview {
    max-width: 60px;
    height: auto;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* =================================================================== */
/* OPTIMIZACIÓN MÓVIL PARA TABLA DE PLATILLOS - MOBILE OPTIMIZATION */
/* =================================================================== */
@media (max-width: 782px) {
    .wp-list-table.widefat {
        font-size: 14px;
    }

    .wp-list-table.widefat .column-thumbnail img {
        max-width: 40px;
    }
}

/* =================================================================== */
/* RESPONSIVE PRICES - PRECIOS RESPONSIVOS */
/* =================================================================== */
@media (max-width: 768px) {
    .cmc-prices {
        flex-direction: column;
        gap: 5px;
    }

    .price-alt::before {
        display: none;
    }

    .price-alt {
        padding-left: 0;
        font-size: 0.9em;
    }
}

/* =================================================================== */
/* OCULTAR COLUMNAS EN DISPOSITIVOS PEQUEÑOS - HIDE COLUMNS ON MOBILE */
/* =================================================================== */
@media screen and (max-width: 782px) {
    table.platillos-list th:nth-child(2), 
    table.platillos-list td:nth-child(2),
    table.platillos-list th:nth-child(3),
    table.platillos-list td:nth-child(3),
    table.platillos-list th:nth-child(5),
    table.platillos-list td:nth-child(5),
    table.platillos-list th:nth-child(6),
    table.platillos-list td:nth-child(6) {
        display: none;
    }
}

.cmc-table-responsive {
    overflow-x: auto;
    max-width: 100%;
}

.cmc-thumbnail-preview {
    max-width: 60px;
    height: auto;
}

@media screen and (max-width: 782px) {
    .column-price2, .column-price3, .column-category {
        display: none;
    }
    .cmc-thumbnail-preview {
        max-width: 40px;
    }
}