/* ============================================================
   VARIABLES
   ============================================================ */
:root {
  --bg: #0f1217;
  --panel: #161a21;
  --card: #1c2028;
  --accent: #4c8bf5;
  --accent-hover: #3a73d1;
  --muted: #e8edf5;
  --text-secondary: #bfc7d9;
  --text-muted: #8892a4;
  --line: #333;
  --bg-input: #12151b;
  --bg-input-readonly: #0a0e13;
  --bg-item: #131822;
  --btn-secondary: #2f3640;

  /* Estados */
  --color-success: #28a745;
  --color-success-dark: #1e7e34;
  --color-danger: #d9534f;
  --color-warning: #f5c518;
  --color-info: #6f42c1;
  --color-disabled: #6c757d;
  --color-whatsapp: #25D366;
  --color-whatsapp-hover: #20b858;
}

/* ============================================================
   BASE
   ============================================================ */
html, body {
  margin: 0;
  padding: 0;
  font-family: Inter, system-ui, Arial;
  background: var(--bg);
  color: var(--muted);
}

.hidden { display: none; }

/* ============================================================
   HEADER FIJO (index.html)
   ============================================================ */
#headerTop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 2000;
  box-sizing: border-box;
  padding: 8px 10px;
  background-image: url("binario.webp");
  background-repeat: repeat-x;
  background-size: auto 100%;
  background-position: center;
}

.bannerWrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  height: 18vh;
  max-height: 160px;
  position: relative;
  z-index: 2;
}
.bannerCentral { flex: 2; height: 100%; object-fit: contain; }
.gifLateral { flex: 1; height: 100%; object-fit: contain; }

.headerLine {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}
.headerLine h2 {
  margin: 0;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.categorySelectors { display: flex; gap: 8px; }
.searchCart { display: flex; gap: 8px; }

/* Bloques internos del header */
.navActions,
.authActions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ============================================================
   HEADER SIMPLE (orders.html, checkout.php, repairs.html)
   ============================================================ */
.simpleHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 10px;
}
.simpleHeader h2 {
  margin: 0;
  font-size: 1.3rem;
}
body.has-simple-header main {
  margin-top: 0;
  padding: 20px;
}

/* ============================================================
   MAIN Y LAYOUTS
   ============================================================ */
main {
  padding: 20px;
  /* El margin-top se ajusta dinámicamente con JS según la altura real del header */
  margin-top: 220px; /* fallback por si el JS no corre */
}

/* Layout del admin (3 columnas) */
.layout {
  display: grid;
  grid-template-columns: 180px 1fr 360px;
  gap: 16px;
  margin-top: 220px; /* fallback, el JS lo ajusta */
  padding: 20px;
}

/* ============================================================
   PRODUCTOS Y CARDS
   ============================================================ */
#products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  padding: 20px;
}

.card {
  background: var(--card);
  padding: 12px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
  position: relative;
}
.card img {
  width: 100%;
  height: 160px;
  object-fit: contain;
  border-radius: 8px;
  cursor: pointer;
}
.card h4 { margin: 10px 0 6px 0; font-size: 1rem; }
.card p { margin: 0 0 8px 0; color: var(--text-secondary); font-size: 0.95rem; white-space: pre-line; }
.card p.description { white-space: pre-line; line-height: 1.4; max-height: calc(1.4em * 5); overflow: hidden; }
.card h2, .card h3 { margin-top: 0; margin-bottom: 12px; font-size: 1.1rem; font-weight: 600; }
.card button[disabled] { opacity: .5; cursor: not-allowed; }

/* ============================================================
   ETIQUETAS (promo, stock, etc.)
   ============================================================ */
.tag {
  position: absolute;
  top: 8px;
  left: 8px;
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .5px;
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  z-index: 2;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.tag-promo     { background: var(--color-danger); top: 8px; left: 8px; }
.tag-instock   { background: var(--color-success); top: 8px; right: 8px; left: auto; }
.tag-madeorder { background: var(--color-info); top: 8px; right: 8px; left: auto; }
.tag-outofstock { background: var(--color-danger); }

/* Evitar solapamiento promo + disponibilidad */
.card .tag-promo + .tag-instock,
.card .tag-promo + .tag-madeorder { top: 8px; }

/* Mensajes de disponibilidad */
.availability-msg {
  font-size: .8rem;
  margin: 4px 0 8px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.availability-msg.instock   { color: var(--color-success-dark); }
.availability-msg.madeorder { color: var(--color-info); }
.availability-msg.outofstock { color: var(--color-disabled); }

.availability-msg .dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block;
}
.availability-msg.instock   .dot { background: var(--color-success); }
.availability-msg.madeorder .dot { background: var(--color-info); }
.availability-msg.outofstock .dot { background: var(--color-disabled); }

/* ============================================================
   BOTONES
   ============================================================ */
button {
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  cursor: pointer;
}
button.secondary { background: var(--btn-secondary); }
button:disabled { opacity: .6; cursor: not-allowed; }

#cartBadge {
  font-weight: 600;
  background: var(--accent);
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  color: #fff;
  cursor: pointer;
}

/* Botones de pago */
.btn-pago { margin-right: 8px; margin-bottom: 6px; }
.btn-pago:disabled { background: #555; cursor: not-allowed; opacity: 0.7; }

.accionesPago {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Botón resubir comprobante */
.btn-resubir {
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}
.btn-resubir:hover { background: var(--accent-hover); }

/* ============================================================
   CARRITO / CANTIDAD
   ============================================================ */
.qtyWrap { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.qtyInput {
  width: 64px;
  padding: 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg-input);
  color: var(--muted);
}

/* ============================================================
   MODALES GENÉRICOS
   ============================================================ */
.modalOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: #0009;
  justify-content: center;
  align-items: center;
  z-index: 4000;
}
.modalOverlay[aria-hidden="false"] { display: flex; }

.modalBox {
  background: var(--panel);
  padding: 20px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 12px;
  color: var(--muted);
}
.modalBox label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}
.modalBox input,
.modalBox select,
.modalBox textarea {
  width: 100%;
  padding: 8px;
  margin-bottom: 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg-input);
  color: var(--muted);
  box-sizing: border-box;
}

/* Scrollbar */
.modalBox::-webkit-scrollbar { width: 8px; }
.modalBox::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }
.modalBox::-webkit-scrollbar-track { background: var(--card); }

/* Modal de gestión de imágenes (ancho especial) */
#manageImagesModal .modalBox {
  display: flex;
  flex-direction: column;
  max-height: 80vh;
  overflow: hidden;
}

/* Modales de pago/reparación más anchos */
#repairModal .modalBox,
#repairListModal .modalBox,
#transferModal .modalBox,
#qrModal .modalBox {
  max-width: 1000px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
}

/* Modal de selección de método de pago */
#paymentMethodModal .paymentMethods {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
#paymentMethodModal .paymentMethods button {
  flex: 1;
  padding: 10px;
  font-weight: 600;
  border-radius: 8px;
  transition: background 0.2s ease;
}
#paymentMethodModal .paymentMethods button:hover {
  background: var(--accent-hover);
}
#paymentMethodModal #btnCloseMetodo {
  margin-top: 16px;
  background: var(--btn-secondary);
  color: #fff;
  font-weight: 500;
}

/* ============================================================
   MODALES ADMIN
   ============================================================ */
.adminModal {
  display: flex;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
  z-index: 5000;
}
.adminModal.hidden { display: none !important; }

.adminModalBox {
  background: var(--card);
  padding: 20px;
  border-radius: 12px;
  max-width: 800px;
  width: 95%;
  max-height: 80vh;
  overflow-y: auto;
  box-sizing: border-box;
}

.adminModalBox h3 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 1.2rem;
  font-weight: 600;
}
.adminModalBox label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}
.adminModalBox input,
.adminModalBox select,
.adminModalBox textarea {
  width: 100%;
  padding: 8px;
  margin-bottom: 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg-input);
  color: var(--muted);
  box-sizing: border-box;
}
.adminModalBox label input[type="checkbox"] {
  width: auto;
  margin-right: 6px;
}

/* ============================================================
   LISTA DE ITEMS (admin)
   ============================================================ */
.list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  overflow: hidden;   /* evita que los hijos se salgan */
}

/* Nombre del item: ocupa el espacio disponible, corta con elipsis si es largo */
.list-item > span:first-child,
.list-item > .list-item-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

/* Meta info (ej: "cat #18"): no se achica, no se corta */
.list-item > .list-item-meta {
  flex: 0 0 auto;
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Botones de acciones: no se achican */
.list-item-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.list-item-actions button {
  padding: 4px 8px;
  font-size: 0.85rem;
  border-radius: 6px;
  white-space: nowrap;
}

/* Solo en el modal de órdenes (nombre + qty + precio) */
.adminModalBox .list-item > span:first-child {
  flex: 2;
  min-width: 0;
}

.itemQuantity,
.itemPrice {
  width: auto;
  max-width: 80px;
  padding: 4px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg-input);
  color: var(--muted);
  box-sizing: border-box;
  flex-shrink: 0;
}
.itemQuantity { text-align: center; }
.itemPrice { text-align: right; }

/* Lista columna izquierda del admin */
.layout aside.card {
  padding: 12px;
  margin-top: 0;
  background: var(--card);
  border-radius: 8px;
}
.layout aside.card strong {
  display: block;
  margin-bottom: 10px;
  font-size: 1rem;
  color: var(--muted);
}
.layout aside.card .list-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.layout aside.card button {
  width: 100%;
  text-align: left;
}

/* Listas con scroll */
.list-group {
  max-height: 400px;
  overflow-y: auto;
}

/* ============================================================
   GALERÍA
   ============================================================ */
#galleryModal.modalOverlay {
  z-index: 3000;
}
#galleryModal .modalBox {
  position: relative;
}

.galleryWrap {
  margin-bottom: 16px;
  position: relative;
}
.galleryImageContainer {
  position: relative;
  width: 100%;
  height: 60vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}
.mainImg {
  width: 65%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  margin: auto;
  border-radius: 6px;
  z-index: 2;
}
.previewImg {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 35%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  opacity: 0.4;
  filter: blur(6px);
  z-index: 1;
}
.previewImg.left { left: 0; }
.previewImg.right { right: 0; }

#prevImg, #nextImg {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: #fff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  cursor: pointer;
}
#prevImg { left: 10px; }
#nextImg { right: 10px; }

.galleryDesc {
  margin-top: 16px;
  white-space: pre-line;
  line-height: 1.4;
}

/* Grilla de imágenes del admin */
#imagesGrid {
  height: 300px;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 8px;
  justify-content: flex-start;
  border: 1px solid var(--line);
}
#imagesGrid img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.2s ease;
}
#imageControls {
  margin-top: 16px;
  flex-shrink: 0;
  text-align: center;
}

/* ============================================================
   ORDER CARDS (orders.html / repairs.html)
   ============================================================ */
.orderCard {
  background: var(--card);
  padding: 16px 20px;
  border-radius: 10px;
  margin-bottom: 16px;
}
.orderCard h3 {
  margin: 0 0 12px 0;
  font-size: 1.1rem;
  color: #fff;
}
.orderCard p {
  margin: 4px 0;
  font-size: 0.95rem;
}
.orderCard table {
  display: block;
  overflow-x: auto;
  white-space: nowrap;
  margin-top: 12px;
  width: 100%;
  border-collapse: collapse;
}
.orderCard table th,
.orderCard table td {
  padding: 8px 10px;
  font-size: 0.9rem;
}
.orderCard > button {
  margin-top: 10px;
  margin-right: 8px;
}

/* ============================================================
   CHECKOUT
   ============================================================ */
.checkoutCard {
  max-width: 600px;
  margin: 20px auto;
  background: var(--card);
  padding: 24px;
  border-radius: 12px;
}
.checkoutCard label {
  display: block;
  margin-bottom: 14px;
  font-weight: 500;
  font-size: 0.95rem;
}
.checkoutCard label input,
.checkoutCard label select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-input);
  color: var(--muted);
  box-sizing: border-box;
  font-size: 1rem;
}
.checkoutCard label input[readonly] {
  background: var(--bg-input-readonly);
  cursor: default;
  opacity: 0.85;
}
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.form-actions button {
  flex: 1;
  padding: 12px;
  font-size: 1rem;
  font-weight: 600;
}

/* ============================================================
   TABLAS GENERALES
   ============================================================ */
table { width: 100%; border-collapse: collapse; margin-top: 20px; }
td, th { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; }

/* ============================================================
   WHATSAPP
   ============================================================ */
.whatsappNotice {
  margin-top: 12px;
  margin-bottom: 12px;
}
.whatsappBtn {
  display: inline-block;
  background-color: var(--color-whatsapp);
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
}
.whatsappBtn:hover { background-color: var(--color-whatsapp-hover); }

/* ============================================================
   ALERTAS DE PAGO
   ============================================================ */
.payment-alert {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
}
.payment-alert.rejected {
  background: #3d0d0d;
  border-left: 4px solid #f87171;
  color: #fca5a5;
}
.payment-alert.pending {
  background: #3a2f00;
  border-left: 4px solid var(--color-warning);
  color: #fde68a;
}

/* Badges */
.badge { padding: 2px 8px; border-radius: 10px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
.badge-pending  { background: #3a2f00; color: var(--color-warning); }
.badge-partial  { background: #3a2400; color: #ff9f40; }
.badge-paid     { background: #0d3d1a; color: #4ade80; }
.badge-approved { background: #0d3d1a; color: #4ade80; }
.badge-rejected { background: #3d0d0d; color: #f87171; }

/* ============================================================
   RESPONSIVE — max-width: 1024px
   ============================================================ */
@media (max-width: 1024px) {
  /* Header del index */
  .headerLine {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }
  .headerLine h2 {
    flex-basis: 100%;
    text-align: center;
  }
  .categorySelectors,
  .filterSelectors {
    flex-basis: auto;
  }
  .searchCart {
    flex-basis: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
  .navActions,
  .authActions {
    flex-basis: 100%;
    justify-content: center;
  }

  /* Grilla de imágenes */
  #imagesGrid img { width: 100px; height: 100px; }
}

/* ============================================================
   RESPONSIVE — max-width: 768px
   ============================================================ */
@media (max-width: 768px) {
  /* Header index */
  .headerLine {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .headerLine h2 {
    font-size: 1.05rem;
    text-align: center;
  }
  .categorySelectors,
  .filterSelectors {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
    .categorySelectors select {
    flex: 1 1 45%;
    min-width: 0;
    font-size: 0.9rem;
    padding: 8px;
  }

  /* Filtros compactos: en una sola fila, sin fondo */
  .filterSelectors {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    gap: 14px;
    flex: 1 1 100%;
  }

  .filterSelectors label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    padding: 0;
    background: transparent;
    border-radius: 0;
    text-align: left;
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .filterSelectors input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
  }
  .searchCart {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    width: 100%;
  }
  .searchCart #searchBox {
    grid-column: 1 / -1;
    padding: 10px;
    font-size: 0.95rem;
  }
  .searchCart button {
    width: 100%;
    font-size: 0.85rem;
    padding: 10px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .navActions,
  .authActions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    width: 100%;
  }

  /* Header simple */
  .simpleHeader { padding: 12px; }
  .simpleHeader h2 { font-size: 1.1rem; }

  body.has-simple-header main { padding: 12px; }

  /* Checkout */
  .checkoutCard {
    padding: 16px;
    margin: 12px auto;
  }

  /* Order card */
  .orderCard { padding: 12px; }
  .orderCard h3 { font-size: 1rem; }
  .orderCard p { font-size: 0.9rem; }
  .orderCard table th,
  .orderCard table td {
    padding: 6px 8px;
    font-size: 0.85rem;
  }

  /* Grilla de imágenes */
  #imagesGrid img { width: 90px; height: 90px; }
    /* Compactar el header en mobile */
  #headerTop {
    padding: 4px 6px;
  }
  .bannerWrap {
    height: 12vh;
    max-height: 90px;
    margin-bottom: 4px;
  }
  .gifLateral {
    display: none;   /* Ocultar los gifs laterales en mobile */
  }
  .bannerCentral {
    flex: 1;
  }
  .headerLine {
    gap: 6px;
    margin-top: 4px;
  }
}

/* ============================================================
   RESPONSIVE — max-width: 600px
   ============================================================ */
@media (max-width: 600px) {
  .modalBox {
    width: 95%;
    max-width: none;
    padding: 12px;
  }
  .card {
    width: 100%;
    margin-bottom: 16px;
  }
  #galleryImg { max-height: 60vh; }

  .accionesPago {
    flex-direction: column;
    gap: 8px;
  }
}

/* ============================================================
   RESPONSIVE — max-width: 480px
   ============================================================ */
@media (max-width: 480px) {
  /* Header index */
  .headerLine {
    flex-direction: column;
    align-items: stretch;
  }
  .headerLine h2 { font-size: 0.95rem; }
  #searchBox { width: 100%; }

  /* Header simple */
  .simpleHeader {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .simpleHeader h2 { text-align: center; }
  .simpleHeader button { width: 100%; }

  /* Checkout */
  .checkoutCard label { font-size: 0.9rem; }
  .checkoutCard label input,
  .checkoutCard label select {
    font-size: 0.9rem;
    padding: 8px;
  }

  /* Cards */
  .card img { height: 120px; }
  .qtyInput { width: 56px; }

  /* Grilla de imágenes */
  #imagesGrid img { width: 80px; height: 80px; }
}

/* ============================================================
   RESPONSIVE — max-width: 400px
   ============================================================ */
@media (max-width: 400px) {
  .categorySelectors select,
  .filterSelectors label {
    flex: 1 1 100%;
  }
  .navActions,
  .authActions {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   RESPONSIVE — altura limitada (modales admin)
   ============================================================ */
@media (max-height: 600px) {
  .adminModalBox { max-height: 90vh; }
}

/* ============================================================
   DESKTOP GRANDE (>= 1025px)
   ============================================================ */
@media (min-width: 1025px) {
  .searchCart {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
  }
  .navActions { margin-left: auto; }
  .authActions {
    border-left: 1px solid var(--line);
    padding-left: 12px;
  }
}
/* ============================================================
   RESPONSIVE — LANDSCAPE MOBILE (celular en horizontal)
   Detecta: pantalla ancha pero de poca altura
   ============================================================ */
@media (orientation: landscape) and (max-height: 500px) {

  /* Header compacto al máximo */
  #headerTop {
    padding: 4px 8px;
  }

  .bannerWrap {
    height: 40px;          /* banner ultra chico en landscape */
    max-height: 40px;
    margin-bottom: 2px;
  }

  .gifLateral {
    display: none;         /* ocultar gifs laterales */
  }

  .bannerCentral {
    flex: 1;
    height: 100%;
  }

  /* Header en una fila pero compacto */
  .headerLine {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: 4px;
  }

  .headerLine h2 {
    flex-basis: auto;
    font-size: 0.9rem;
    text-align: left;
    margin-right: 8px;
  }

  /* Selectores y filtros compactos */
  .categorySelectors {
    display: flex;
    gap: 4px;
    flex-basis: auto;
  }
  .categorySelectors select {
    font-size: 0.75rem;
    padding: 4px 6px;
  }

  .filterSelectors {
    display: flex;
    flex-direction: row;
    gap: 8px;
    flex-basis: auto;
    justify-content: flex-start;
  }
  .filterSelectors label {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.75rem;
    padding: 0;
    background: transparent;
    white-space: nowrap;
    flex: 0 0 auto;
  }
  .filterSelectors input[type="checkbox"] {
    margin: 0;
    width: 14px;
    height: 14px;
  }

  /* Buscador y botones */
  .searchCart {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    flex-basis: 100%;
    justify-content: flex-start;
  }

  .searchCart #searchBox {
    flex: 1 1 180px;
    padding: 6px 10px;
    font-size: 0.85rem;
    min-width: 0;
  }

  .navActions,
  .authActions {
    display: flex;
    gap: 4px;
    flex-basis: auto;
  }

  .navActions button,
  .authActions button {
    font-size: 0.75rem;
    padding: 6px 8px;
    white-space: nowrap;
    width: auto;
  }
  .authActions {
    border-left: none;      /* quitar separador */
    padding-left: 0;
  }

  /* Productos: más compactos y con scroll vertical cómodo */
  #products {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    padding: 10px;
  }

  .card img {
    height: 100px;
  }

  .card p.description {
    max-height: calc(1.4em * 3);   /* menos líneas en landscape */
  }

  /* Modal de galería en landscape */
  .galleryImageContainer {
    height: 70vh;
  }
  .mainImg {
    width: 50%;
    max-height: 100%;
  }
  .previewImg {
    width: 25%;
  }

  /* Modales genéricos: menos padding */
  .modalBox {
    padding: 12px;
    max-height: 90vh;
  }

  /* Filtros del listado de subcategorías (admin) */
  .list-item {
    padding: 6px;
  }

  /* Order cards en landscape */
  .orderCard {
    padding: 10px;
  }
  .orderCard h3 {
    font-size: 1rem;
  }
}