/*
 Theme Name:   Astra Child
 Template:     Astra
 Author:       Tu nombre
 Description:  Tema hijo de "astra-child"
 Version:      1.0.1
*/

/* =============================================
   VARIABLES GLOBALES LOS SANTOS
   ============================================= */
:root {
  --ls-red: #DD183B;
  --ls-red-hover: #B71835;
  --ls-red-dark: #A0132C;
}

/* =============================================
   MINI-CARRITO: Ocultar botón "Finalizar compra"
   ============================================= */
.foodonline-mini-cart a.checkout,
.widget_shopping_cart .buttons a.checkout {
  display: none !important;
}

.widget_shopping_cart .buttons a.wc-forward {
  display: inline-block !important;
}

/* =============================================
   PANEL DE GESTIÓN DE PRODUCTOS (#ls-pm)
   ============================================= */

/* Contenedor principal */
#ls-pm {
  max-width: 1220px;
  margin: 0 auto;
}

/* Botones de tabs superiores */
#ls-pm .ls-tab-btn {
  padding: 8px 12px;
  border: 1px solid #e2e2e2;
  border-radius: 10px;
  background: #f7f7f7;
  color: #222;
  cursor: pointer;
  transition: background 0.2s ease;
}

#ls-pm .ls-tab-btn:hover {
  background: #eee;
}

/* Botones de acción principales (rojo Los Santos) */
#ls-pm #lsq-btn,
#ls-pm .btn-save,
#ls-pm .btn-vars,
#ls-pm .vr-save,
#ls-pm #s-create,
#ls-pm #v-create,
#ls-pm #cat-create1,
#ls-pm #cat-create2,
#ls-pm #v-attrc-create,
#ls-pm #v-attrv-add,
#ls-pm #new-create {
  background: var(--ls-red) !important;
  border: 1px solid var(--ls-red) !important;
  color: #fff !important;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  transition: all 0.15s ease;
}

#ls-pm #lsq-btn:hover,
#ls-pm .btn-save:hover,
#ls-pm .btn-vars:hover,
#ls-pm .vr-save:hover,
#ls-pm #s-create:hover,
#ls-pm #v-create:hover,
#ls-pm #cat-create1:hover,
#ls-pm #cat-create2:hover,
#ls-pm #v-attrc-create:hover,
#ls-pm #v-attrv-add:hover,
#ls-pm #new-create:hover {
  background: var(--ls-red-hover) !important;
  border-color: var(--ls-red-hover) !important;
}

#ls-pm #lsq-btn:active,
#ls-pm .btn-save:active,
#ls-pm .btn-vars:active,
#ls-pm .vr-save:active,
#ls-pm #s-create:active,
#ls-pm #v-create:active,
#ls-pm #cat-create1:active,
#ls-pm #cat-create2:active,
#ls-pm #v-attrc-create:active,
#ls-pm #v-attrv-add:active,
#ls-pm #new-create:active {
  transform: translateY(1px);
}

/* Botón Eliminar (estilo especial de advertencia) */
#ls-pm #del-btn,
#ls-pm #attr-add {
  background: var(--ls-red) !important;
  border: 1px solid var(--ls-red) !important;
  color: #fff !important;
  border-radius: 12px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  transition: all 0.15s ease;
}

#ls-pm #del-btn:hover,
#ls-pm #attr-add:hover {
  background: var(--ls-red-hover) !important;
  border-color: var(--ls-red-hover) !important;
}

/* Botones deshabilitados */
#ls-pm button:disabled,
#ls-pm button[disabled],
#ls-pm .btn-save:disabled,
#ls-pm #attr-add:disabled,
#ls-pm #v-attrc-create:disabled,
#ls-pm #cat-create1:disabled,
#ls-pm #cat-create2:disabled {
  background: #F2F2F2 !important;
  border: 1px solid #DDDDDD !important;
  color: #777 !important;
  opacity: 1 !important;
  cursor: not-allowed !important;
}

/* Botones "×" de eliminar atributo (neutros) */
#ls-pm #attr-rows button {
  background: #fff !important;
  color: #333 !important;
  border: 1px solid #ddd !important;
  padding: 4px 8px;
  border-radius: 4px;
}

#ls-pm #attr-rows button:hover {
  background: #f7f7f7 !important;
}

/* Inputs y selects */
#ls-pm input[type="text"],
#ls-pm input[type="number"],
#ls-pm input[type="search"],
#ls-pm select {
  background: #fff;
  color: #111;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 10px;
}

/* Quitar flechas de los selects específicos */
#ls-pm select.in-mstock,
#ls-pm select.in-sstatus {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: none !important;
  padding-right: 2.4rem;
}

/* =============================================
   GESTIÓN DE PEDIDOS
   ============================================= */

/* Estilos para tablas de pedidos */
.gestion-pedidos-wrap {
  width: 100%;              /* ocupa todo el ancho */
  margin: 0 auto;
  padding: 0 10px;
}

.tabla-pedidos-wrap {
  width: 100% !important;   /* ancho completo */
  border: 1px solid #eee;
  border-radius: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tabla-pedidos {
  width: 100% !important;
  border-collapse: collapse;
  min-width: 900px;
}

.tabla-pedidos th,
.tabla-pedidos td {
  padding: 12px;
  border: 1px solid #ddd;
  text-align: left;
  font-size: 14px;
}

.tabla-pedidos th {
  background: #f8f9fa;
  font-weight: 600;
}

.tabla-pedidos tr:nth-child(even) {
  background: #f8f9fa;
}

/* Scrollbar personalizada para tablas */
.tabla-pedidos::-webkit-scrollbar {
  height: 6px;
}
.tabla-pedidos::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

/* Pedidos nuevos destacados */
.pedido-nuevo {
  background: #fff3cd !important;
  font-weight: 600;
}

/* Contador de pedidos en el menú */
.contador-pedidos {
  background: #ff3b30;
  color: #fff;
  border-radius: 50%;
  padding: 3px 7px;
  font-size: 12px;
  font-weight: bold;
  margin-left: 6px;
  display: inline-block;
  min-width: 20px;
  text-align: center;
  line-height: 1.2;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  vertical-align: middle;
}

/* Botón guardar estilo Astra/Woo */
.btn-guardar-estado {
  background: var(--ast-global-color-0, #0073e6) !important;
  border: none !important;
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  border-radius: 4px !important;
  padding: 8px 16px !important;
  cursor: pointer !important;
  transition: all 0.2s ease;
}
.btn-guardar-estado:hover {
  background: var(--ast-global-color-1, #005bb5) !important;
}
.btn-guardar-estado:disabled {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
}

/* Formulario de estado */
.form-estado {
  display: flex;
  align-items: center;
  gap: 6px;
}

.estado-pedido {
  background-color: #fff;
  color: #232323;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  padding: 6px 10px;
  cursor: pointer;
  min-width: 140px;
}

/* Bolita de color */
.estado-color {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;   /* evita que se estire */
}

/* Colores por estado */
.estado-processing { background: orange; }
.estado-confirmed { background: dodgerblue; }
.estado-completed { background: green; }
.estado-on-hold { background: #ff9800; }
.estado-cancelled { background: red; }
.estado-enviado { background: purple; }

/* Enlace ver detalle */
.ver-detalle {
  color: #e74c3c;
  font-weight: bold;
  text-decoration: none;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 6px 12px;
  background: #fff;
}
.ver-detalle:hover {
  background: #f5f5f5;
}

/* Notificaciones */
.notificacion-exito,
.aviso-exito {
  background: #d4edda;
  color: #155724;
  padding: 12px;
  margin: 15px 0;
  border: 1px solid #c3e6cb;
  border-radius: 5px;
  font-weight: bold;
}

/* =============================================
   RESPONSIVE - MOBILE
   ============================================= */
@media (max-width: 768px) {
  .gestion-pedidos-wrap {
    padding: 0 8px;
  }

  .tabla-pedidos {
    font-size: 13px;
    min-width: 100%;
  }

  .form-estado {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .estado-pedido,
  .btn-guardar-estado {
    width: 100% !important;
  }

  .ver-detalle {
    display: block;
    text-align: center;
    margin-top: 6px;
  }
}
@media print {
    @page {
        size: 80mm auto;  /* ancho de papel térmico */
        margin: 0;        /* sin márgenes */
    }

    body {
        margin: 0;
        padding: 0;
        background: #fff;
    }

    #ticket-print {
        width: 80mm;      /* ajusta al papel */
        margin: 0;
        padding: 5px;
        font-size: 12px;
        line-height: 1.4;
    }

    /* Hacemos que la tabla se adapte bien */
    #ticket-print table {
        width: 100%;
        border-collapse: collapse;
    }
    #ticket-print td {
        font-size: 12px;
        padding: 2px 0;
    }
}
<style>
.delivery-block {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.btn-accion {
    display: inline-block;
    min-width: 200px;   /* mismo tamaño mínimo */
    text-align: center;
    padding: 12px 25px;
    border-radius: 30px;
    font-weight: bold;
    text-transform: uppercase;
    font-family: Arial, sans-serif;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
    text-decoration: none;
    color: #fff !important;   /* letras blancas siempre */
}
.btn-guardar {
    background: #c8102e;
}
.btn-guardar:hover {
    background: #a50d25;
}
.btn-ticket {
    background: #0073e6;
}
.btn-ticket:hover {
    background: #005bb5;
}
table.tabla-pedidos {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}
table.tabla-pedidos th,
table.tabla-pedidos td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}
</style>
