@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: thin;                            /* Firefox */
  scrollbar-color: rgba(0,0,0,0.2) transparent;    /* Firefox */
}
*::-webkit-scrollbar              { width: 6px; height: 6px; }
*::-webkit-scrollbar-track        { background: transparent; }
*::-webkit-scrollbar-thumb        { background: rgba(0,0,0,0.2); border-radius: 10px; }
*::-webkit-scrollbar-thumb:hover  { background: rgba(0,0,0,0.35); }

/************ESTILOS GLOBALES****************+*/
:root {
  --color-primario: #284c22;
  --color-secundario: #f4ecdf;
  --color-terciario: #2d2d2d;
  --color-cuaternario: #75892a;
  --color-quinto: #e67318;
  --color-sexto: #1e2be4;
}

html {
  font-size: 62.5%;
}

body {
  font-family: 'Inter', Arial, sans-serif;
  background-color: var(--color-secundario);
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  opacity: 1;
}

body.loaded {
    opacity: 1;
}

body:not(.loaded) {
    opacity: 0;
    transition: opacity 0.3s ease;
}
body.loaded {
    opacity: 1;
    transition: opacity 0.3s ease;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

a {
  text-decoration: none;
  color: var(--color-secundario);
}

.no-scroll {
    overflow: hidden;
    height: 100vh;
}



/***************ESTILOS PENDIENTE TITULO*****************************/

.panel {
  display: flex;
  justify-content: space-between;
}

.panel__content {
  display: block;
  margin-top: 100px;
}

.panel__welcome-title{
  display: flex;
  justify-self: center;
  align-items: center;
  margin: 5px auto;
  height: 50px;
  text-align: center;
  width: 100%;
  justify-content: center;
}

.header-container {
  min-height: 80px;
  background-color: var(--color-primario);
}


.header,
.dashboard__header,
.inventory__header {
  z-index: 2;
  background-color: var(--color-primario);
  color: var(--color-secundario);
  padding: 0 4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  width: 100%;
  min-height: 80px;
  top: 0;
  left: 0;
}

.header-title,
.dashboard__header-title,
.inventory__header-title {
  font-size: 3rem;
  margin: 0 auto;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 auto;
}

.header-center .header-title {
  margin: 0;
}

.header-home-btn {
  display: flex;
  align-items: center;
  background: none;
  border: none;
  color: var(--color-secundario);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background-color 0.2s;
}

.header-home-btn:hover {
  background-color: var(--color-quinto);
}

/* ── TOOLTIP REUTILIZABLE ─────────────────────────────────────── */
.with-tooltip {
  position: relative;
}

.with-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 130%;
  left: 50%;
  transform: translateX(-50%) translateY(5px);
  background-color: var(--color-quinto);
  color: var(--color-secundario);
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  pointer-events: none;
  z-index: 100;
}

.with-tooltip::before {
  content: '';
  position: absolute;
  top: 115%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: var(--color-quinto);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.with-tooltip:hover::after,
.with-tooltip:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.header-list,
.dashboard__header-list,
.inventory__header-list {
  list-style: none;
  display: flex;
  font-size: 1.6rem;
}

.header-item,
.dashboard__header-item,
.inventory__header-item {
  margin-left: 1rem;
}

.header-link,
.dashboard__header-link,
.inventory__header-link {
  color: var(--color-secundario);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.header-logout-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.6rem;
}
.header-logout-icon { flex-shrink: 0; }

/* ── BOTÓN SALA ───────────────────────────────────────────────── */
.btn-sala {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background-color: rgba(230, 115, 24, 0.15);
    border: 1px solid rgba(230, 115, 24, 0.5);
    border-radius: 20px;
    color: var(--color-secundario);
    font-size: 1.4rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, transform 0.1s;
}
.btn-sala:hover {
    background-color: rgba(230, 115, 24, 0.35);
    border-color: var(--color-quinto);
    transform: translateY(-1px);
}
.btn-sala::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #6b7280;
    transition: background-color 0.3s;
}
.btn-sala.sala-activa::before {
    background-color: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
    animation: pulso-sala 1.8s infinite;
}
@keyframes pulso-sala {
    0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
    70%  { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.action-button {
  background-color: var(--color-secundario);
  border: none;
  color: var(--color-primario);
  cursor: pointer;
}

.action-button:hover {
  color: var(--color-quinto);
}

.sidebar_img img, .panel__logo-wrapper img {
    height: 100px;
    width: auto;
    object-fit: contain;
}

.panel__footer{
  display: flex;
  justify-content: center;
  height: 50px;
  padding: 10px;
  background-color: var(--color-primario);
  color: var(--color-secundario);
  font-size: 1.5rem;  
}


/********************ESTILOS PARA CARRITO*******************/

.car_product_list th,
.car_product_list td {
  border-bottom: 1px solid var(--color-primario);
}

.car_product_list th {
  padding: 10px;
}

.car_product_list td {
  padding: 5px;
}

.car_total {
  display: flex;
  font-weight: bold;
  width: 80%;
  justify-content: center;
  gap: 50px;
  margin: 5px auto;
}

.btn-container {
  display: flex;
  max-width: 400px;
  margin: 10px auto 30px auto;
  gap: 30px;
}

.btn-container button {
  padding: 5px;
  color: var(--color-secundario);
  border: none;
  cursor: pointer;
}

.btn-container button:hover {
  background-color: var(--color-quinto);
}

.btn-container button {
  background-color: var(--color-primario);
  border: 1px solid var(--color-terciario);
  color: var(--color-secundario);
  font-weight: bold;
  border-radius: 5px;
}

.btn-container button:hover {
  background-color: var(--color-quinto);
  border: 1px solid var(--color-secundario);
}

/********************ESTILOS PARA IMPRIMIR********************/
@media print {
  body {
    width: 80mm;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 16px !important;
    margin: 0;
    padding: 0;
  }

  #btn_edit,
  #btn_confirm,
  #btn_print,
  header,
  .btn-container {
    display: none;
  }

  #valor-servicio {
    margin-bottom: 50px;
  }

  .car_product_list,
  .car_data_pedido,
  .car_data_branch,
  .car_data_date,
  .car_data_observation {
    font-size: 16px;
    width: 100%;
    max-width: none;
  }

  .history-management__row th:nth-child(4),
  .history-management__tbody td:nth-child(4) {
    display: none;
  }
}
















/*********************ORDENES********************/
.logo_orders {
  display: flex;
  width: auto;
  height: 150px;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  padding: 20px;
  border-radius: 20%;
}

body.orders_body {
  margin: 0;
  overflow-x: hidden;
}

.orders_main {
  color: var(--color-primario);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: calc(100vh - 150px);
  overflow-x: hidden;
}

.orders_title {
  display: flex;
  justify-content: space-around;
  margin: 10px;
}

.orders_title__image {
  width: 70px;
  height: 70px;
  border-radius: 50px;
  margin: 10px;
}

.title_order {
  color: var(--color-primario);
  text-align: center;
  font-size: 80px;
  margin: 0px;
}

.parragraph {
  font-size: 20px;
  margin: 0 auto;
  text-align: center;
}

.form_products {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.list_products {
  display: block;
  text-align: center;
  margin: 0 auto;
}

.product,
.list_location,
.day_delivery {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 380px;
  margin: 8px 0;
  gap: 8px;
  padding: 4px 8px;
  box-sizing: border-box;
}

.day_delivery {
  margin: 0 auto 30px auto;
}

.observation_products {
  width: 95%;
}

.list_location label,
.list_location select,
.day_delivery label,
.day_delivery input {
  width: 50%;
  display: flex;
  justify-content: center;
}

.day_delivery label,
.day_delivery select {
  width: 50%;
  display: flex;
  justify-content: center;
}

.product label {
  flex: 1;
  text-align: left;
}

.product select,
.product input.prod-qty-input,
.day_delivery input,
.list_location select {
  text-align: center;
  font-weight: bold;
}

.product input.prod-qty-input {
  width: 70px;
  padding: 4px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: inherit;
}

.list_location select:hover,
.day_delivery select:hover,
.list_products select:hover {
  opacity: 0.8;
  cursor: pointer;
}

.observation {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 380px;
}

.observation label {
  margin: 5px auto;
}

.observation_box {
  display: flex;
  width: 80%;
  height: 200px;
  padding: 10px;
  margin: 0 auto;
}

@keyframes btn-orders-pulse {
  0%, 100% { transform: scale(1);    box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
  50%       { transform: scale(1.04); box-shadow: 0 6px 20px rgba(0,0,0,0.25); }
}

.btn_orders {
  width: fit-content;
  min-width: 200px;
  max-width: calc(100vw - 2rem);
  height: 40px;
  padding: 0 1.8rem;
  margin: 50px auto;
  font-size: 20px;
  white-space: nowrap;
  display: block;
  border-radius: 50px;
  background-color: var(--color-secundario);
  color: var(--color-primario);
  animation: btn-orders-pulse 2s ease-in-out infinite;
}

.btn_orders:hover {
  background-color: var(--color-quinto);
  color: var(--color-secundario);
  cursor: pointer;
}

@media (max-width: 600px) {
  .title_order {
    font-size: 50px;
  }

  .parragraph {
    max-width: 90vw;
    padding: 10px;
    font-size: 14px;
  }

  .form_products {
    width: 100%;
  }

  .orders_title {
    font-size: 20px;
  }

  .orders_title__image {
    width: 50px;
    height: 50px;
    margin-right: 10px;
  }
}











/*********************BARRA INFERIOR CONTINUAR (products.html)*****************/

#barra-continuar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: var(--color-primario);
  padding: 0.9rem 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.15);
  z-index: 150;
  animation: slide-up 0.25s ease;
}

@keyframes slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

#barra-continuar .btn_orders {
  margin: 0;
  background-color: var(--color-secundario);
  color: var(--color-primario);
  font-weight: bold;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

#barra-continuar .btn_orders:hover {
  background-color: var(--color-quinto);
  color: var(--color-secundario);
  transform: scale(1.04);
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

/* Espacio para barras fijas superior e inferior */
.orders_main {
  padding-top: 50px;
  padding-bottom: 80px;
}

/*********************BARRA DE CONTEXTO (products.html)************************/

#barra-contexto {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: var(--color-primario);
  color: var(--color-secundario);
  padding: 0.7rem 1rem;
  font-size: 1.2rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.bc-icono { font-size: 1.3rem; }

.bc-sep { opacity: 0.5; }

#instruccion-productos {
  text-align: center;
  font-size: 1.2rem;
  color: #555;
  padding: 1rem 1rem 0.2rem;
  margin: 0;
}

/*********************MODAL BIENVENIDA PEDIDO (products.html)*******************/

#modal-bienvenida {
  border: none;
  border-radius: 14px;
  padding: 0;
  max-width: 380px;
  width: 92vw;
  background-color: var(--color-secundario);
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
}

#modal-bienvenida::backdrop {
  background: rgba(0,0,0,0.5);
}

.mbienvenida__header {
  background-color: var(--color-primario);
  border-radius: 14px 14px 0 0;
  padding: 1.5rem;
  text-align: center;
  color: var(--color-secundario);
}

.mbienvenida__greeting {
  font-size: 1.4rem;
  display: block;
  margin-bottom: 0.8rem;
}

.mbienvenida__texto {
  font-size: 1.1rem;
  opacity: 0.85;
  margin-bottom: 0.3rem;
}

.mbienvenida__sede {
  font-size: 1.9rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.mbienvenida__body {
  padding: 1.5rem;
  text-align: center;
}

.mbienvenida__pregunta {
  font-size: 1.2rem;
  color: var(--color-terciario);
  margin-bottom: 1.2rem;
}

.mbienvenida__opciones {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.mbienvenida__opcion {
  flex: 1;
  border: 2px solid var(--color-primario);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  padding: 1rem 0.5rem;
  transition: background-color 0.2s, color 0.2s;
  font-family: inherit;
}

.mbienvenida__opcion:hover {
  background-color: var(--color-primario);
}

.mbienvenida__opcion-label {
  display: block;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--color-primario);
  margin-bottom: 0.4rem;
  transition: color 0.2s;
}

.mbienvenida__opcion:hover .mbienvenida__opcion-label {
  color: var(--color-secundario);
}

.mbienvenida__opcion-fecha {
  display: block;
  font-size: 1rem;
  color: #666;
  transition: color 0.2s;
}

.mbienvenida__opcion:hover .mbienvenida__opcion-fecha {
  color: var(--color-secundario);
}

/*********************MODAL CONFIRMACIÓN (products.html)***********************/

#modal-confirm {
  border: none;
  border-radius: 14px;
  padding: 0;
  max-width: 400px;
  width: 94vw;
  max-height: 90vh;
  background-color: var(--color-secundario);
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  overflow: hidden;
}

#modal-confirm::backdrop {
  background: rgba(0,0,0,0.5);
}

.mconfirm__header {
  background-color: var(--color-primario);
  border-radius: 14px 14px 0 0;
  padding: 1.2rem 1.5rem;
  color: var(--color-secundario);
}

.mconfirm__title {
  font-size: 1.4rem;
  margin: 0 0 0.3rem;
}

.mconfirm__info {
  font-size: 1.1rem;
  opacity: 0.92;
  margin: 0;
  line-height: 1.7;
}

.mc-resalte {
  font-size: 1.35rem;
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#mc-form {
  overflow-y: auto;
  max-height: calc(90vh - 80px);
}

.mconfirm__lista-wrap {
  position: relative;
}

.mconfirm__lista {
  list-style: none;
  padding: 0.8rem 1.5rem;
  margin: 0;
  max-height: 32vh;
  overflow-y: auto;
}

/* Degradado + flecha animada */
.scroll-indicator {
  display: block;
  width: 100%;
  box-sizing: border-box;
  height: 48px;
  margin-top: -48px;
  position: relative;
  z-index: 2;
  text-align: center;
  line-height: 48px;
  background: linear-gradient(to bottom, transparent, var(--color-secundario));
  color: var(--color-primario);
  font-size: 1.3rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  animation: bounce-arrow 1.2s ease-in-out infinite;
  will-change: transform;
}

@keyframes bounce-arrow {
  0%, 100% { transform: translateY(0);   }
  50%       { transform: translateY(6px); }
}

.mconfirm__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(40,76,34,0.12);
  font-size: 1.2rem;
  color: var(--color-terciario);
}

.mconfirm__item:last-child {
  border-bottom: none;
}

.mconfirm__item strong {
  color: var(--color-primario);
}

.mconfirm__obs {
  padding: 0.6rem 1.5rem 0;
}

.mconfirm__obs-label {
  display: block;
  font-size: 1rem;
  color: #666;
  margin-bottom: 0.4rem;
}

.mconfirm__textarea {
  width: 100%;
  height: 70px;
  border: 1.5px solid rgba(40,76,34,0.3);
  border-radius: 8px;
  padding: 0.7rem;
  font-size: 1.1rem;
  font-family: inherit;
  resize: none;
  background: #fff;
  box-sizing: border-box;
  color: var(--color-terciario);
}

.mconfirm__textarea:focus {
  outline: none;
  border-color: var(--color-primario);
}

.mconfirm__acciones {
  display: flex;
  gap: 0.8rem;
  padding: 1rem 1.5rem 1.5rem;
}

.mconfirm__btn {
  flex: 1;
  padding: 0.75rem 0;
  border: none;
  border-radius: 8px;
  font-size: 1.2rem;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
  transition: filter 0.2s;
}

.mconfirm__btn:hover { filter: brightness(0.88); }
.mconfirm__btn:disabled { opacity: 0.6; cursor: not-allowed; }

.mconfirm__btn--back {
  background-color: #e0e0e0;
  color: var(--color-terciario);
}

.mconfirm__btn--send {
  background-color: var(--color-primario);
  color: var(--color-secundario);
}

#mc-success {
  flex-direction: column;
  align-items: center;
  padding: 2.5rem 1.5rem;
  text-align: center;
  gap: 0.6rem;
}

.mconfirm__success-icon { font-size: 3rem; }

.mconfirm__success-title {
  font-size: 1.6rem;
  color: var(--color-primario);
  margin: 0;
}

.mconfirm__success-sub {
  font-size: 1.2rem;
  color: #555;
  margin: 0;
}

/*********************STEPPER DE CANTIDAD (products.html)**********************/

.stepper {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

.stepper__btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.5px solid var(--color-primario);
    background: transparent;
    color: var(--color-primario);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.stepper__btn:hover:not(:disabled) {
    background: var(--color-primario);
    color: var(--color-secundario);
}

.stepper__btn:disabled {
    opacity: 0.25;
    cursor: default;
}

.stepper .prod-qty-input {
    width: 28px;
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 2px 0;
    box-sizing: border-box;
    -moz-appearance: textfield;
}

.stepper .prod-qty-input::-webkit-inner-spin-button,
.stepper .prod-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.stepper .prod-qty-input[readonly] {
    background: #f5f5f5;
    cursor: default;
}

/*********************HIGHLIGHT + BADGE DE CATEGORÍA (products.html)***********/

/* Fila seleccionada */
li.product.is-selected {
  background-color: rgba(40,76,34,0.07);
  border-left: 3px solid var(--color-primario);
  border-radius: 0 6px 6px 0;
  padding-left: 6px;
  transition: background-color 0.2s;
}

li.product.is-selected label {
  color: var(--color-primario);
  font-weight: bold;
}

/* Badge naranja en el header de categoría */
.cat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 50px;
  background-color: var(--color-quinto);
  color: #fff;
  font-size: 1rem;
  font-weight: bold;
  margin-right: 8px;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.cat-badge[style*="inline-flex"] {
  animation: badge-pop 0.2s ease;
}

@keyframes badge-pop {
  0%   { transform: scale(0.6); }
  60%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/*********************ACORDEÓN DE CATEGORÍAS (products.html)*******************/

.category-accordion {
  width: 340px;
  margin: 6px auto;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.accordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background-color: var(--color-primario);
  color: var(--color-secundario);
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  font-weight: bold;
  font-family: inherit;
  text-align: left;
  transition: background-color 0.2s;
}

.accordion-header:hover {
  background-color: var(--color-cuaternario);
}

.accordion-title {
  flex: 1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.accordion-count {
  font-size: 1.2rem;
  font-weight: normal;
  opacity: 0.75;
  margin-right: 10px;
}

.cat-badge {
  background: #e67e22;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
  line-height: 1.4;
  flex-shrink: 0;
  margin-right: 8px;
}

.accordion-chevron {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
  display: inline-block;
}

.category-accordion.is-open .accordion-chevron {
  transform: rotate(180deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  background-color: #fff;
  transition: max-height 0.35s ease;
}

.category-accordion.is-open .accordion-body {
  max-height: 9999px;
}

@media (max-width: 600px) {
  .category-accordion {
    width: 95%;
  }
}

/*********************DETALLES DE PEDIDO*******************/
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
    max-height: 70vh; /* No permite que el modal mida más del 85% de la pantalla */
    display: flex;
    flex-direction: column; /* Alinea hijos verticalmente */
    overflow: hidden;
}


.modal-content h2 {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 50px;
  font-size: 2rem;
  text-align: center;
  margin-bottom: 20px;
  color: var(--color-secundario);
  background-color: var(--color-primario);
  border-radius: 10px;
}

.modal-body-scroll {
    overflow-y: auto; /* Activa el scroll vertical */
    flex-grow: 1;     /* Ocupa todo el espacio disponible */
    margin-bottom: 10px;
    padding-right: 5px; /* Espacio para que el scroll no tape el texto */
}

/* Estilizar la barra de scroll (opcional pero profesional) */
.modal-body-scroll::-webkit-scrollbar {
    width: 6px;
}
.modal-body-scroll::-webkit-scrollbar-thumb {
    background: var(--color-primario);
    border-radius: 10px;
}

.modal-content img {
  width: 50px;
}

.modal-content .info-pedido {
  font-size: 1.6rem;
}

.close-detalle {
    position: absolute; 
    right: 10px; 
    top: 0;
    font-size: 3rem; 
    font-weight: bold;
    cursor: pointer;
    color: var(--color-primario);
}

.table-detalle {
    width: 100%; 
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 1.2rem;
}

.table-detalle th, .table-detalle td {
    border-bottom: 1px solid #ddd; 
    padding: 2px; 
    text-align: left;
}

.table-detalle th:nth-child(2) ,.table-detalle td:nth-child(2),
.table-detalle th:nth-child(3) ,.table-detalle td:nth-child(3) {
  text-align: center;
}

.info-pedido {
    margin-bottom: 20px;
    font-size: 1.4rem;
    color: var(--color-terciario);
}

.totales-detalle {
    text-align: right;
    font-size: 1.2rem;
    border-top: 2px solid var(--color-primario);
    padding-top: 10px;
}

.btn-modal {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 22px;
    padding: 4px 8px;
    border-radius: 6px;
    line-height: 1;
    transition: opacity 0.15s, background 0.15s;
}

.btn-modal:hover {
    background: rgba(0,0,0,0.07);
    opacity: 0.85;
}

.btn-modal--danger:hover { background: rgba(220,53,69,0.12); }

.modal-actions { display:flex; align-items:center; gap:4px; }

@keyframes pulse-save {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(39,174,96,0.6); }
    50%       { transform: scale(1.2); box-shadow: 0 0 0 8px rgba(39,174,96,0); }
}
.btn-save-pulsing {
    animation: pulse-save 1.2s ease-in-out infinite;
    border-radius: 4px;
}

#btn-add-product {
    margin-left: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: #27ae60;
    color: white;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    transition: background 0.15s, transform 0.15s;
}
#btn-add-product:hover {
    background: #1e8449;
    transform: scale(1.15);
}

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}
.badge-pendiente  { background: #fff3cd; color: #856404; }
.badge-entregado  { background: #d1e7dd; color: #0f5132; }
.badge-pagado     { background: #cfe2ff; color: #084298; }

.btn-save-modal { font-size: 20px; }

/* ── Modal agregar producto — resultados de búsqueda ── */
.prod-result-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.prod-result-item:hover { background: #f0f7ff; }
.prod-result-item--disabled {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    opacity: 0.6;
    cursor: default;
    background: #fafafa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.prod-result-item__name { font-weight: 600; }
.prod-result-item__price { color: #888; font-size: 12px; }
.prod-result-item__tag { color: #e67e22; font-size: 11px; font-weight: 600; }







/****************DASHBOARD SIDEBAR****************/
.sidebar {
  display: flex;
  flex-direction: column;
  background-color: var(--color-primario);
  color: var(--color-secundario);
  width: 220px;
  padding: 14rem 0;
  position: fixed;
  top: 0px;
  bottom: 0;
  left: 0;
}

.is-hidden {
  display: none !important;
}

.is-visible{
  display: flex !important;
}

.sidebar_img {
  display: flex;
  align-items: center;
}

.sidebar_img img {
  width: 100px;
  margin: 0 auto;
}

.sidebar .sidebar__nav .sidebar__list {
  list-style: none;
  padding: 0;
}

.sidebar .sidebar__nav .sidebar__list .sidebar__item {
  margin: 1rem 0;
}

.sidebar .sidebar__nav .sidebar__list .sidebar__item .sidebar__link {
  color: var(--color-secundario);
  text-align: center;
  text-decoration: none;
  display: block;
  padding: 0.5rem;
  border-radius: 4px;
  font-size: 1.6rem;
  transition: background-color 0.3s;
  cursor: pointer;
}

.sidebar__list .sidebar__item .sidebar__link:hover {
  background-color: var(--color-quinto);
}

.sidebar__section-label {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  padding: 0.4rem 0.5rem 0.2rem;
  margin-top: 1.8rem;
  border-top: 1px solid rgba(255,255,255,0.15);
  list-style: none;
}


.toggle-btn , .inventory-toggle {
  width: 50px;
  height: 50px;
  border-radius: 50px;
  position: fixed;
  transition: left 0.3s ease;
  top: 75px;
  z-index: 10;
  left: 200px;
  background-color: var(--color-primario);
  border: 0.1px solid var(--color-secundario);
  color: var(--color-secundario);
  font-size: 30px;
  cursor: pointer;
}



/* ── Sidebar overlay backdrop ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 999;
}
.sidebar-overlay.active { display: block; }

@media (max-width: 768px) {

/* Header visible y compacto en mobile */
.header {
    display: flex !important;
    padding: 0 1.8rem;
    min-height: 58px;
    z-index: 1050;
}
.header-title { font-size: 1.3rem !important; }
.header .sidebar_img img { width: 38px; height: 38px; object-fit: contain; }
.header .header-center { flex: 1; justify-content: center; }
.header-home-btn { padding: 4px 6px; }
.header-home-btn svg { width: 18px; height: 18px; }
.header-logout-text { display: none; }
.header-logout-btn { gap: 0; }
.header-logout-icon { width: 18px; height: 18px; }

/* Sidebar como drawer overlay (no full width), arranca debajo del header */
.sidebar {
    width: 220px;
    top: 58px;
    z-index: 1000;
}
.sidebar-overlay {
    top: 58px;
}

/* Toggle visible en mobile, alineado con el header */
.toggle-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    font-size: 16px;
    top: 41px;
    left: 10px !important;
    z-index: 1100;
}
/* En mobile el toggle no se mueve — siempre en la misma posición */
.toggle-btn.left-hidden { left: 10px !important; }
.sidebar--collapsed { width: 8px !important; }
.sidebar--collapsed * { opacity: 0; }

.sidebar .sidebar__nav .sidebar__list .sidebar__item .sidebar__link {
    font-size: 1.4rem;
}

}



/****************DASHBOARD MAIN*************/
.dashboard__main , .inventory__main{
  margin-left: 170px;
  margin-top: 100px;
  margin-bottom: 50px;
  padding: 2rem;
  flex: 1;
  font-size: 1.4rem;
  transition: margin-left 0.3s ease;
}

.dashboard__overview .inventory__overview , .dashboard__section , .inventory__section {
  margin-left: 80px;
}

.dashboard__overview h2 , .inventory__overview h2 {
  margin-top: 1rem;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.margin-hidden {
  margin-left: 0px;
}

.margin-hidden-20 {
  margin-left: 20px;
}

.dashboard__overview-cards , .inventory__overview-cards{
  display: flex;
  justify-content: space-between;
  padding: 0 1rem;
}

.dashboard__overview-subtitle {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6c757d;
  padding: 0.5rem 1rem 0.25rem;
  margin: 0.5rem 0 0;
}



/********************CARDS*******************/


.cards_container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
    width: 70%;
    margin: 0 auto;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .cards_container {
        width: 100%;
    }
}

.card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-radius: 12px;
    background-color: var(--color-secundario);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    text-align: center;
}

/* Efecto al pasar el mouse en tarjetas activas */
.card--active:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
}

/* Estilo para tarjetas deshabilitadas */
.card--disabled {
    filter: grayscale(1);
    opacity: 0.7;
    cursor: not-allowed;
}

.card__icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.card__text {
    font-weight: 600;
    color: #333;
    margin: 0;
}






/* Ocultar Iframe para imprimir sin ver contenido desde Dashboard */
#hiddenIframe {
  display: none;
}




/******************* INVENTORY TABLE STYLES *********************/

/* Contenedor de la tabla para permitir scroll horizontal en móviles */
.inventory-management {
    overflow-x: auto;
    padding: 1rem;
    background-color: var(--color-secundario); /* Ajusta según tu paleta */
    border-radius: 8px;
}

.inventory-management__title {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

#inv-search {
    min-width: 260px;
}

.inventory-management__table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 1.2rem;
    margin: 0;
    font-family: inherit;
    background-color: var(--color-secundario);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.inventory-management__thead {
    background-color: var(--color-secundario); /* Gris muy claro para el encabezado */
    border-bottom: 1.5px solid var(--color-primario);
}

.inventory-management__heading {
    padding: 12px 15px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Encabezados alineados igual que sus celdas */
.inventory-management__thead th:nth-child(2) { text-align: left; }
.inventory-management__thead th:nth-child(4),
.inventory-management__thead th:nth-child(5),
.inventory-management__thead th:nth-child(6) { text-align: right; }

/* Estilos para las celdas de datos */
.inventory-management__cell {
    padding: 6px 15px;
    border-bottom: 1px solid var(--color-secundario);
    font-size: 1.3rem;
    text-align: center;
    color: var(--color-terciario);
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 0;
    font-variant-numeric: tabular-nums;
}

/* Alineación por tipo de columna: texto izquierda, números derecha */
.inventory-management__cell:nth-child(2) { text-align: left; }   /* Nombre */
.inventory-management__cell:nth-child(4),
.inventory-management__cell:nth-child(5),
.inventory-management__cell:nth-child(6) { text-align: right; }  /* Stock, Precio, Total */

.inventory-management__link {
    cursor: pointer;
    color: var(--color-quinto);
    margin: 5px;
}

.inventory-management__link:hover {
  text-decoration: underline;
}
.inventory-management__row {
  cursor: pointer; /* Cambia el cursor a la mano para indicar clic */
  transition: background-color 0.2s ease;
}
/* Efecto hover para facilitar la lectura de filas largas */
.inventory-management__row:hover {
  background-color: rgba(0, 0, 0, 0.05);  
}

/* Alineación específica para valores de moneda */
.inventory-management__cell:nth-child(1) {
    font-weight: bold;
    text-align: center;
}

.obs-badge {
    display: inline-block;
    margin-left: 5px;
    font-size: 1rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    vertical-align: middle;
    cursor: default;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.obs-badge--active {
    background: var(--color-primario);
    color: var(--color-secundario);
    cursor: pointer;
}

.obs-badge--active::after {
    content: attr(title);
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #2d2d2d;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 400;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: pre-wrap;
    max-width: 240px;
    min-width: 120px;
    text-align: left;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    line-height: 1.4;
    pointer-events: none;
}

.obs-badge--active:hover::after {
    display: block;
}

/* Estilo para los estados (pendiente/entregado) */
.inventory-management__cell select {
    padding: 4px 8px;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 0.8rem;
}

.btn-primary {
    background-color: transparent;
    border: 1px solid #ccc;
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;    
}

.btn_orderBy option {
  background-color: var(--color-secundario);
}

/* ── Filtros dashboard ───────────────────────────────────────────── */
.dashboard__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1.2rem;
  margin-bottom: 1.6rem;
}

.dashboard__filters-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.dashboard__filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 1.3rem;
}

.dashboard__filter-group label {
  font-weight: 600;
  color: var(--color-terciario);
}

.dashboard__filters-quick {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.btn-quick {
  font-family: inherit;
  font-size: 1.3rem;
  padding: 0.5rem 1.2rem;
  border-radius: 20px;
  border: 1.5px solid #c8bfb0;
  background-color: transparent;
  color: var(--color-terciario);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-quick:hover {
  border-color: var(--color-primario);
  color: var(--color-primario);
}

.btn-quick.active {
  background-color: var(--color-primario);
  border-color: var(--color-primario);
  color: var(--color-secundario);
}

/* ── Botones de acción (compartidos entre páginas) ── */
.ap-btn {
  font-family: inherit;
  font-size: 1.4rem;
  padding: 0.7rem 1.8rem;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  transition: filter 0.15s, background-color 0.15s;
}
.ap-btn--primary {
  background-color: var(--color-primario);
  color: var(--color-secundario);
}
.ap-btn--primary:hover { filter: brightness(1.15); }
.ap-btn--ghost {
  background-color: transparent;
  color: var(--color-terciario);
  border: 1.5px solid #c8bfb0;
}
.ap-btn--ghost:hover { background-color: #f0e8db; }
.ap-btn--filter {
  background-color: transparent;
  color: var(--color-terciario);
  border: 1.5px solid #c8bfb0;
}
.ap-btn--filter:hover { background-color: #f0e8db; }
.ap-btn--filter-active {
  background-color: var(--color-primario);
  color: var(--color-secundario);
  border-color: var(--color-primario);
}

/* ── Panel de filtros ── */
.filtros-dropdown {
  position: relative;
}
.filtros-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e74c3c;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  margin-left: 4px;
  vertical-align: middle;
}
.filtros-panel {
  position: fixed;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  padding: 12px 16px;
  min-width: 230px;
  z-index: 1000;
}
.filtros-panel__title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #adb5bd;
  margin: 10px 0 4px;
}
.filtros-panel__title:first-child { margin-top: 0; }
.filtros-opcion {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: #495057;
  padding: 4px 0;
  cursor: pointer;
}
.filtros-opcion input { cursor: pointer; }
.filtros-panel__footer {
  border-top: 1px solid #dee2e6;
  margin-top: 10px;
  padding-top: 8px;
  text-align: right;
}
.ap-btn--edit {
  background-color: var(--color-cuaternario);
  color: var(--color-secundario);
  font-size: 1.3rem;
  padding: 0.4rem 1.2rem;
}
.ap-btn--edit:hover { filter: brightness(1.15); }

/* ── Inputs de formulario (compartidos) ── */
.ap-input,
.ap-select {
  font-family: inherit;
  font-size: 1.4rem;
  padding: 0.7rem 1rem;
  border: 1.5px solid #c8bfb0;
  border-radius: 6px;
  background-color: #fff;
  color: var(--color-terciario);
  outline: none;
  transition: border-color 0.2s;
}
.ap-input:focus,
.ap-select:focus { border-color: var(--color-primario); }

/* ── Modales de formulario (compartidos) ── */
dialog.ap-modal-dialog {
  border: none;
  border-radius: 12px;
  padding: 0;
  width: min(540px, 96vw);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  margin: auto;
}
.ap-modal-dialog::backdrop { background: rgba(0,0,0,0.45); }
.ap-modal__form {
  padding: 2.4rem 2.4rem 2rem;
  background-color: var(--color-secundario);
  border-radius: 12px;
}
.ap-modal__title {
  font-size: 2rem;
  color: var(--color-primario);
  margin-bottom: 2rem;
}
.ap-modal__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
}
.ap-field { display: flex; flex-direction: column; gap: 0.5rem; }
.ap-field--full { grid-column: 1 / -1; }
.ap-field--row { flex-direction: row; align-items: center; gap: 1rem; }
.ap-label { font-size: 1.3rem; font-weight: 600; color: var(--color-terciario); }
.ap-label__hint { font-weight: normal; color: #888; font-size: 1.2rem; }
.ap-checkbox { width: 18px; height: 18px; accent-color: var(--color-primario); cursor: pointer; }
.ap-modal__error { color: #c0392b; font-size: 1.3rem; margin-top: 1.2rem; min-height: 1.8rem; }
.ap-modal__actions { display: flex; justify-content: flex-end; gap: 1rem; margin-top: 2rem; }
@media (max-width: 600px) {
  .ap-modal__grid { grid-template-columns: 1fr; }
}

.btn-primary:hover {
    color: var(--color-primario);
    border: 1px solid var(--color-primario);

}
/* ── Paginación ──────────────────────────────────────────────────────────── */
.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  padding: 1rem 0;
}

.pagination-controls #pagination-info {
  font-size: 1.3rem;
  color: var(--color-texto);
  min-width: 7rem;
  text-align: center;
}

/************INGRESO DE STOCK*****************/

.stock-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--color-primario);
  border-radius: 5px;
  margin-bottom: 10px;
  padding: 5px;  
}

.stock-info h2 {
  display: flex;
  width: 150px;
  height: 30px;  
  align-items: center;
  color: var(--color-secundario);
  padding: 5px;  
}






/******************INGRESO DE STOCK MODAL***************/

.header-stock {
  margin-bottom: 20px;
  text-align: center;
  font-size: 2rem;
}


/* La capa oscura que cubre toda la pantalla */
.modal-overlay {
    display: none; /* Oculto inicialmente */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Fondo semi-transparente */
    backdrop-filter: blur(3px); /* Efecto de desenfoque opcional */
}

/* La "caja" del formulario */
.modal-content {
    background-color: #f3f0e7; /* El crema de DrivePizza */
    margin: 10% auto;
    padding: 25px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: slideDown 0.3s ease-out;
}

.form-body .form-group {
  display: flex;
  flex-direction: column;
  margin: 10px auto;
  width: 85%;
}

.form-body .form-group .label {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 5px;
  color: #2d4628;
}

.form-body .form-group .form-control {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #c5bfa8;
  font-size: 1rem;
  background-color: #fff;
  box-sizing: border-box;
}

.form-body .form-group textarea.form-control {
  resize: vertical;
}

.inventory-management__stock-btn {
  display: flex;
  justify-content: space-around;
  margin: 10px auto;
}

/* Animación de entrada */
@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Botón de cerrar (X) */
.close-modal {
    position: absolute;
    top: 0px;
    right: 10px;
    font-size: 28px;
    font-weight: bold;
    color: #2d4628;
    cursor: pointer;
}




/***************DASHBOARD*********************/



/* Sin sidebar: ocupa el ancho completo */
.dashboard__main--full {
  margin-left: 0;
}
.dashboard__main--full .dashboard__section,
.dashboard__main--full .inventory__section {
  margin-left: 0;
}
.dashboard__main--full ~ .dashboard__footer,
.dashboard__main--full ~ .inventory__footer {
  margin-left: 0;
  width: 100%;
}

.dashboard__footer , .inventory__footer {
  background-color: var(--color-primario);
  color: var(--color-secundario);
  text-align: center;
  padding: 1rem;
  position: fixed;
  bottom: 0;
  width: 100%;
  margin-left: 220px;
}

.margin-hidden {
  margin-left: 12px;
}

.left-hidden {
  left: -5px;
}

/* Sidebar colapsado — franja visible */
.sidebar--collapsed {
  width: 12px !important;
  overflow: hidden;
  transition: width 0.3s ease;
}
.sidebar--collapsed * {
  opacity: 0;
  transition: opacity 0.15s ease;
}
.sidebar {
  transition: width 0.3s ease;
}

@media (max-width: 600px) {
.dashboard__footer, .inventory__footer {
  display: none;
}
  
}

/***********************CARRITO DASHBOARD*******************/



.cartDashboard__body {
  width: 100%;
  max-width: 400px;
  justify-self: right;
  border: 1px solid var(--color-terciario);
  border-radius: 10px;
}

.cartDashboard__header , .cartDashboard__heading , .cartDashboard__summary-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  margin: 0 10px;
  border-bottom: 1px solid var(--color-terciario);
}

.cartDashboard__header {
  display: flex;
  justify-content: space-between;
  background-color: var(--color-primario);
  margin: 0;
  border-radius: 10px 10px 0 0;
}

.cartDashboard__heading {
  font-size: 2.5rem;
}

.cartDashboard__header-title {
  display: flex;
  align-items: center;
  color: var(--color-secundario);
  font-size: 1.5rem;
}

.cartDashboard__header-title p {
  padding-left: 10px;
  font-size: 2.5rem;
}

.cartDashboard__header-exit img {
  width: 20px;
}

.cartDashboard__main {
  margin: 0 10px 20px 10px ;
  padding: 10px;
}

.cartDashboard__summary-heading {
  border-top: 1px solid var(--color-terciario);
}




/********************ESTILOS PARA IMPRIMIR********************/


@media print {
  body {
      width: 80mm; /* Ancho del papel */
      font-family: 'Inter', Arial, sans-serif;
      display: flex;
      align-items: center;
      font-size: 10px; 
      margin: 0 auto;
      padding: 0;
  }
  #btn_edit , #btn_confirm , #btn_print ,header {
      display: none; /* Oculta elementos no deseados en la impresión */
  }
  #valor-servicio {
      margin-bottom: 50px;
  }
}






/*********************CONFIRMACIÓN ENVIO PEDIDO*********************************/
.envio_ok_main {
  width: 100vw;
  height: 100vh;
  background-color: var(--color-primario);
}

.confirmation_container {
  background-color: var(--color-primario);
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  max-width: 400px;
  margin: 0 auto;
  gap: 30px;
  font-size: 30px;
  text-align: center;
  color: var(--color-secundario);
}

.confirmation_container img:nth-child(1) {
  width: 200px;
}

.confirmation_container img:nth-child(2) {
  width: 50px;
}





/**************CALENDARIO EXPORTE*********************/

.exportDate-container {
  position: relative;
}

.exportDate {
  display: none;
  position: absolute;
  top: 10px;
  left: -10px;
  flex-direction: column;
  width: 200px;
  margin: 30px 10px;
  padding: 10px;
  background-color: var(--color-secundario);
  border-radius: 5px;
  gap: 5px;
}

.exportDate-container label {
  color: var(--color-primario);
  font-weight: bold;
}









/******COLORES ESTADOS DE PEDIDOS************/

.status-entregado {
    background-color: var(--color-terciario); 
    color: var(--color-primario); 
    font-weight: bold;
    border-radius: 4px;
}

.status-pagado {
    background-color: var(--color-terciario); 
    color: var(--color-sexto); 
    font-weight: bold;
    border-radius: 4px;
}

/* Estilo para que el SELECT adopte el color de fondo */
.inventory-management__cell .status-select {
    /* Es importante que el select tenga el fondo transparente para que se vea el fondo del TD */
    background-color: transparent; 
    border: none;
    font-size: 1.2rem;
    padding: 4px 8px;
    cursor: pointer;
}

/* Estilo para la celda (<td>) que contendrá el select */
.inventory-management__cell.status-cell {
    /* Asegura que el contenido se centre y el fondo de color luzca bien */
    padding: 0;
    text-align: center;
}


/* ── Overlay de procesamiento ───────────────────────────────────────────────── */
.dp-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--color-secundario) 92%, transparent);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 1;
    transition: opacity 0.35s ease;
}
.dp-overlay--fadeout { opacity: 0; pointer-events: none; }

.dp-overlay__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    background: #fff;
    border: 1px solid color-mix(in srgb, var(--color-primario) 15%, transparent);
    border-radius: 22px;
    padding: 42px 52px 36px;
    box-shadow: 0 8px 40px color-mix(in srgb, var(--color-primario) 12%, transparent);
    min-width: 280px;
}

/* ── Estado cargando ── */
.dp-overlay__ring-wrap {
    position: relative;
    width: 88px;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dp-overlay__ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    animation: dp-spin 1.1s linear infinite;
    transform-origin: center;
}
.dp-overlay__ring circle {
    fill: none;
    stroke: var(--color-primario);
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-dasharray: 120 45;
    stroke-dashoffset: 0;
}
.dp-overlay__logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 50%;
    background: var(--color-secundario);
    padding: 8px;
    animation: dp-pulse 1.6s ease-in-out infinite;
}
.dp-overlay__texto {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    letter-spacing: 0.02em;
    text-align: center;
}

/* ── Estado éxito ── */
.dp-overlay--success .dp-overlay__ring-wrap,
.dp-overlay--success .dp-overlay__texto { display: none; }

.dp-overlay__success-body {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}
.dp-overlay--success .dp-overlay__success-body {
    display: flex;
    animation: dp-fadein 0.35s ease forwards;
}

.dp-overlay__line { margin: 0; }
.dp-overlay__line--asesor {
    font-size: 15px;
    font-weight: 500;
    color: #666;
}
.dp-overlay__line--pedido {
    font-size: 30px;
    font-weight: 800;
    color: var(--color-primario);
    background: color-mix(in srgb, var(--color-primario) 10%, transparent);
    padding: 2px 14px;
    border-radius: 8px;
    letter-spacing: 0.03em;
}
.dp-overlay__line--sede {
    font-size: 13px;
    font-weight: 400;
    color: #888;
    margin-top: 2px;
}

.dp-overlay__check {
    display: none;
    font-size: 48px;
    line-height: 1;
    margin-top: 8px;
    animation: dp-popin 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
.dp-overlay--success .dp-overlay__check { display: block; }

@keyframes dp-spin {
    to { transform: rotate(360deg); }
}
@keyframes dp-pulse {
    0%, 100% { transform: scale(1);    opacity: 0.9; }
    50%       { transform: scale(1.08); opacity: 1;   }
}
@keyframes dp-popin {
    from { transform: scale(0.4); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}
@keyframes dp-fadein {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════
   MOBILE — max-width: 768px  (al final para ganar cascada)
   ══════════════════════════════════════════════════ */
@media (max-width: 768px) {

/* ── Layout principal ── */
.dashboard__main, .inventory__main {
    margin-left: 12px !important;
    margin-top: 66px;
    margin-bottom: 20px;
    padding: 0.8rem;
    font-size: 1.2rem;
}
.dashboard__section, .inventory__section {
    margin-left: 0 !important;
}

/* ── Título sección + botones ── */
.inventory-management__title {
    flex-wrap: wrap;
    font-size: 1.3rem;
    gap: 0.5rem;
}

/* ── Ocultar Cards ── */
.inventory__overview-cards {
  display: none;
}

/* ── Filtros: ocultar fecha/ordenar, mantener botones rápidos ── */
.dashboard__filters-dates { display: none; }
.btn-quick {
    font-size: 1.1rem;
    padding: 0.35rem 0.8rem;
}
.ap-btn {
    font-size: 1.2rem;
    padding: 0.5rem 1rem;
}

/* ── Tabla: solo 4 columnas ── */
.inventory-management__heading {
    font-size: 1rem;
    padding: 6px 5px;
}
.inventory-management__cell {
    font-size: 1.05rem;
    padding: 5px 5px;
}
/* ── Dashboard móvil: ID, Fecha, Sede, Estado ── */
#table-dashboard th:nth-child(n+5),
#table-dashboard td:nth-child(n+5) { display: none; }
#table-dashboard { table-layout: fixed; }
#table-dashboard th:nth-child(1), #table-dashboard td:nth-child(1) { width: 12%; }
#table-dashboard th:nth-child(2), #table-dashboard td:nth-child(2) { width: 28%; }
#table-dashboard th:nth-child(3), #table-dashboard td:nth-child(3) { width: 28%; text-align: center; white-space: nowrap; overflow: hidden; }
#table-dashboard th:nth-child(4), #table-dashboard td:nth-child(4) { width: 32%; }
#table-dashboard td:nth-child(3) .sede-nombre {
    display: inline-block;
    max-width: calc(100% - 32px);
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    white-space: nowrap;
}
#table-dashboard td:nth-child(3) .obs-badge {
    font-size: 0.7rem;
    padding: 1px 4px;
    margin-left: 3px;
    vertical-align: middle;
}

/* ── Inventory móvil: ID, Nombre, Stock ── */
#table-inventory th:nth-child(n+3),
#table-inventory td:nth-child(n+3) { display: none; }
#table-inventory th:nth-child(4), #table-inventory td:nth-child(4) { display: table-cell; }
#table-inventory { table-layout: fixed; }
#table-inventory th:nth-child(1), #table-inventory td:nth-child(1) { width: 15%; }
#table-inventory th:nth-child(2), #table-inventory td:nth-child(2) { width: 55%; text-align: left; }
#table-inventory th:nth-child(4), #table-inventory td:nth-child(4) { width: 30%; text-align: center; }

/* ── Paginación ── */
.pagination-controls {
    gap: 0.4rem;
    font-size: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0.5rem 0;
}

/* ── Panel CallCenter shell — sin scroll, footer siempre visible ── */
body.panel {
    height: 100vh;
    overflow: hidden;
    justify-content: flex-start;
    padding-bottom: 55px;
}
.panel__content {
    flex: 1;
    margin-top: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.panel__welcome-title {
    font-size: 1.6rem;
    height: auto;
    padding: 6px 0 2px;
    margin: 0 0 4px;
}
.cards_container {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 10px 12px;
    width: 100%;
    margin: 0;
}
.card {
    padding: 10px 6px;
}
.card__icon {
    font-size: 1.6rem;
    margin-bottom: 4px;
}
.card__text {
    font-size: 1.1rem;
}
.panel__footer {
    height: auto;
    padding-bottom: max(10px, env(safe-area-inset-bottom, 10px));
}
.footer__text {
    font-size: 1rem;
}

}

/* ══ Barra de carga entre páginas ══════════════════════════════════════════
   Visible mientras body.loaded no existe (auth aún verificando).
   Usa html::before para no heredar opacity:0 del body.
   ──────────────────────────────────────────────────────────────────────── */
html::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(
        90deg,
        var(--color-primario) 0%,
        #5a9e50 40%,
        var(--color-primario) 100%
    );
    background-size: 200% 100%;
    animation: page-bar-sweep 1.6s ease-in-out infinite;
    z-index: 99999;
    opacity: 1;
    transition: opacity 0.4s ease 0.1s;
}

html:has(body.loaded)::before {
    opacity: 0;
    pointer-events: none;
}

@keyframes page-bar-sweep {
    0%   { background-position:  200% 0; }
    100% { background-position: -200% 0; }
}
