/* Mostrar dos tarjetas por fila en móviles */
@media (max-width: 600px) {
  .productos-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  .product-card {
    min-width: 0;
    max-width: 100%;
  }
}
/* styles.css - Inspirado en Taurus y Mercado Libre */

:root {
  --color-primary: #1976d2;
  --color-secondary: #1565c0;
  --color-header: #1976d2F2;
  --color-text: #333;
  --color-bg: #f8f8f8;
  --color-footer: #fff;
  --color-accent: #00a650;
  --font-main: 'Noto Sans', Arial, sans-serif;
}

body {
  margin: 0;
  font-family: var(--font-main);
  background: var(--color-bg);
  color: var(--color-text);
}

.header {
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.8rem 0.6rem 1rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.logo img {
  height: 40px;
}
.header nav a, .header nav button {
  background: none;
  border: 1px solid #fff;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  margin-left: 1rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.header nav a:hover, .header nav button:hover {
  background: #fff;
  color: var(--color-header);
}

.catalogo {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
  margin-top: 5rem;
}
.buscador {
  display: block;
  margin-bottom: 1rem;
}
.buscador input {
  width: 100%;
  padding: 0.7rem 2.5rem 0.7rem 1rem;
  border-radius: 12px;
  border: 1px solid #ddd;
  font-size: 1rem;
  background: #fff url('data:image/svg+xml;utf8,<svg fill="none" stroke="%2345B9AB" stroke-width="2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>') no-repeat right 1rem center/20px 20px;
}
.productos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}
/* Tarjeta estilo Mercado Libre */
.product-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px #0001;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s;
  cursor: pointer;
  position: relative;
}
.product-card:hover {
  box-shadow: 0 4px 16px #0002;
}
.product-card img {
  width: 100%;
  height: auto;
  max-height: 264px;
  aspect-ratio: 5/6;
  object-fit: cover;
  border-radius: 8px;
  background: #f5f5f5;
  display: block;
  margin: 0 auto;
}
.product-card .precio {
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--color-text);
  margin: 0.5rem 0 0.2rem 0;
}
.product-card .precio-ant {
  text-decoration: line-through;
  color: #888;
  font-size: 1rem;
  margin-right: 0.5rem;
}
.product-card .precio-ant-auto {
  text-decoration: line-through;
  color: #bbb;
  font-size: 1rem;
  margin-bottom: 0.2rem;
  display: block;
}
.product-card .descuento {
  color: var(--color-accent);
  font-weight: bold;
  font-size: 1rem;
}
.product-card .nombre {
  font-size: 1.1rem;
  font-weight: 500;
  margin: 0.5rem 0 0.2rem 0;
}
.product-card .calificacion {
  color: #f5a623;
  font-size: 1rem;
  margin-bottom: 0.3rem;
}
.product-card .etiqueta {
  background: var(--color-accent);
  color: #fff;
  font-size: 0.82rem;
  border-radius: 6px;
  padding: 0.09rem 0.45rem;
  position: absolute;
  top: 0.7rem;
  left: 1rem;
  font-weight: 600;
  line-height: 1.3;
  border: 1px solid #00a65033;
}
.product-card .cuotas, .product-card .envio {
  font-size: 0.95rem;
  color: var(--color-accent);
  margin-bottom: 0.2rem;
}
.product-card .boton-info {
  background: none;
  border: none;
  color: var(--color-primary);
  text-decoration: underline;
  cursor: pointer;
  font-size: 1rem;
  margin-top: 0.5rem;
}

/* Detalle de producto */
.detalle-producto {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  max-width: 1100px;
  margin: 0.7rem auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 8px #0001;
  padding: 2rem;
}

/* Responsive para PC y tablets */
@media (min-width: 768px) {
  .precio-cantidad-container {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
  }
  .cantidad-stock-container {
    flex-direction: row !important;
    align-items: center !important;
    gap: 1rem !important;
  }
  .titulo-movil {
    display: none !important;
  }
  .titulo-pc {
    display: block !important;
  }
  .detalle-producto {
    margin-top: 2rem !important;
  }
}

/* Estilos para móvil */
@media (max-width: 767px) {
  .titulo-pc {
    display: none !important;
  }
  .titulo-movil {
    display: block !important;
  }
}

.detalle-producto .galeria {
  flex: 1 1 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Alineación específica para las miniaturas en PC */
@media (min-width: 768px) {
  .detalle-producto .galeria {
    align-items: center;
  }
  .detalle-producto .galeria img:first-of-type {
    align-self: center;
  }
  .detalle-producto .miniaturas {
    align-self: flex-start !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
  }
}

/* Para móvil mantener centrado */
@media (max-width: 767px) {
  .detalle-producto .galeria {
    align-items: center;
  }
  .detalle-producto .miniaturas {
    align-self: center;
  }
  .detalle-producto .galeria img {
    margin: 0.1rem auto 0 auto !important;
  }
}
.detalle-producto .galeria img {
  width: 100%;
  height: auto;
  max-width: 400px;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 12px;
  background: #f5f5f5;
  display: block;
  margin: 1.5rem auto 0 auto;
}
.detalle-producto .miniaturas {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  width: 100%;
  justify-content: flex-start;
  max-width: 400px;
}
.detalle-producto .miniaturas img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
}
.detalle-producto .miniaturas img.selected {
  border-color: var(--color-primary);
}
.detalle-producto .info {
  flex: 2 1 400px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.detalle-producto .info h1 {
  font-size: 2rem;
  margin: 0;
}
.detalle-producto .info .datos {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  font-size: 1rem;
}
.detalle-producto .info .precio {
  font-size: 2rem;
  font-weight: bold;
  color: var(--color-text);
}
.detalle-producto .info .stock {
  color: #888;
  font-size: 1rem;
}
.detalle-producto .info .cantidad {
  display: flex;
  align-items: center;
  gap: 0;
  background: #f8f9fa;
  border-radius: 25px;
  padding: 4px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.detalle-producto .info .cantidad button {
  background: #fff;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  color: #333;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.detalle-producto .info .cantidad button:hover {
  background: #007bff;
  color: #fff;
  transform: scale(1.05);
}
.detalle-producto .info .cantidad span {
  min-width: 40px;
  text-align: center;
  font-weight: 600;
  font-size: 16px;
  color: #333;
  padding: 0 8px;
}
.detalle-producto .info .btn {
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 0.7rem 2rem;
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  margin-top: 1rem;
  transition: background 0.2s;
}
.detalle-producto .info .btn:hover {
  background: var(--color-secondary);
}
.detalle-producto .info .btn-whatsapp {
  background: #fff;
  color: #25d366;
  border: 2px solid #25d366;
  margin-top: 1rem;
  transition: background 0.2s, color 0.2s;
}
.detalle-producto .info .btn-whatsapp:hover {
  background: #25d366;
  color: #fff;
}

/* Dashboard */
.dashboard-layout {
  display: flex;
  min-height: 80vh;
}
.productos-lista .producto-item,
.productos-lista .producto-info,
.productos-lista .producto-nombre,
.productos-lista .producto-precio,
.productos-lista .producto-stock,
.productos-lista .producto-cat,
.productos-lista .producto-estrellas,
.productos-lista .producto-oferta,
.productos-lista .producto-masvendido {
  font-size: 0.97em;
}
.sidebar {
  width: 220px;
  background: #f5f5f5;
  padding: 2rem 1rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-radius: 16px 0 0 16px;
  box-shadow: 2px 0 8px #0001;
}
.sidebar-btn {
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 0.7rem 1rem;
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 0.5rem;
  transition: background 0.2s;
}
.sidebar-btn.active, .sidebar-btn:hover {
  background: var(--color-secondary);
}
.dashboard-main {
  flex: 1;
  padding: 2rem 1rem;
}
.admin-config, .admin-productos {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 8px #0001;
  padding: 2rem 1.5rem;
  max-width: 900px;
  margin: 2rem auto;
  box-sizing: border-box;
}
.admin-config h2, .admin-productos h2 {
  margin-top: 0;
}
.admin-config form, .admin-productos form {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
}
.admin-config label, .admin-productos label {
  flex: 1 1 250px;
  display: flex;
  flex-direction: column;
  font-size: 1rem;
  gap: 0.3rem;
}
.admin-config button, .admin-productos button {
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 0.7rem 2rem;
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  margin-top: 1rem;
  transition: background 0.2s;
}
.admin-config button:hover, .admin-productos button:hover {
  background: var(--color-secondary);
}
.btn, .btn-add-catalogo {
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.56rem 1.6rem;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  margin-top: 1rem;
  transition: background 0.2s;
  display: block;
  width: 100%;
}
.btn:hover, .btn-add-catalogo:hover {
  background: var(--color-secondary);
}

/* Footer estilo Taurus */
.footer {
  background: var(--color-footer);
  color: #888;
  padding: 2rem 1rem 1rem 1rem;
  margin-top: 3rem;
  border-top: 1px solid #eee;
  font-size: 1rem;
}
.footer .footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto 1rem auto;
}
.footer .footer-col h4 {
  color: var(--color-text);
  margin-bottom: 0.7rem;
}
.footer .footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer .footer-col ul li {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.footer .footer-col ul li i {
  font-size: 1.2rem;
}
.footer .footer-col .mapa {
  width: 100%;
  height: 120px;
  border: none;
  border-radius: 8px;
}
.footer .footer-col .ssl {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.footer .footer-copy {
  text-align: center;
  color: #aaa;
  font-size: 0.95rem;
  margin-top: 1rem;
}

.preview-imgs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}
.preview-imgs img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border 0.2s;
}
.preview-imgs img.selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary33);
}

.form-producto-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem 1rem;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 8px #0001;
  padding: 2rem;
  margin-bottom: 2rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.form-group label {
  margin-bottom: 0;
}
.form-group input,
.form-group textarea {
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  font-size: 1rem;
  margin-top: 0.2rem;
  background: #fafafa;
  transition: border 0.2s;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--color-primary);
  outline: none;
}
.form-actions {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}
.form-actions button {
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 0.7rem 2rem;
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.form-actions button:hover {
  background: var(--color-secondary);
}

.carrito-icon {
  background: none;
  border: none;
  position: relative;
  margin-left: 1rem;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
}
.carrito-cantidad {
  position: absolute;
  top: -7px;
  right: -7px;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: bold;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px #0002;
}
.carrito-panel {
  position: fixed !important;
  right: 2rem;
  bottom: 2rem;
  top: auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 4px 32px #0002;
    min-width: 310px;
    max-width: 98vw;
    z-index: 99999;
    padding: 1.2em 1.2em 1.2em 1.2em;
    display: flex;
    flex-direction: column;
    gap: 0.7em;
    overflow-y: auto;
    min-height: 180px;
}
.carrito-panel.visible {
  display: block;
}
.carrito-panel h3 {
  margin-top: 0;
}
.carrito-panel .carrito-lista {
  max-height: 260px;
  overflow-y: auto;
  overflow-x: hidden;
  margin-bottom: 1rem;
}
.carrito-panel .carrito-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  min-width: 0;
  padding: 0.7em 0.2em;
  border-bottom: 1px solid #eee;
}
.carrito-panel .carrito-item img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
  box-shadow: 0 1px 6px #0001;
}
.carrito-panel .carrito-item .info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.carrito-panel .carrito-item .nombre {
  font-size: 1rem;
  font-weight: 600;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.carrito-panel .carrito-item .precio-container {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 70px;
}
.carrito-panel .carrito-item .precio {
  font-weight: 700;
  color: var(--color-text);
  font-size: 1.08em;
  text-align: right;
}
.carrito-panel .carrito-item .controles {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.carrito-panel .carrito-item .cantidad {
  font-weight: 600;
  font-size: 1.08em;
  min-width: 20px;
  text-align: center;
}
.carrito-panel .carrito-item button {
  background: #eee;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 1.1rem;
  cursor: pointer;
}
.carrito-panel .carrito-total {
  text-align: right;
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 1rem;
}
.carrito-panel .carrito-preparar {
  width: 100%;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 30px;
  padding: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
}

/* Estilos específicos para móviles en el carrito */
@media (max-width: 600px) {
  .carrito-panel {
    position: fixed !important;
    right: 0.5rem;
    bottom: 0.5rem;
    top: auto;
    min-width: 300px;
    max-width: 320px;
    width: 300px;
    padding: 1rem;
  }
  
  .carrito-panel .carrito-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 0.8rem;
    min-width: 0;
    padding: 0.5em 0;
    border-bottom: 1px solid #eee;
  }
  
  .carrito-panel .carrito-item img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
  }
  
  .carrito-panel .carrito-item .info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
  }
  
  .carrito-panel .carrito-item .nombre {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.2;
    min-width: 0;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    max-height: 2.4em;
    word-break: break-word;
  }
  
  .carrito-panel .carrito-item .precio-container {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 60px;
  }
  
  .carrito-panel .carrito-item .precio {
    font-weight: 700;
    color: var(--color-text);
    font-size: 0.9rem;
    text-align: right;
  }
  
  .carrito-panel .carrito-item .controles {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
    margin-top: 0.2rem;
  }
  
  .carrito-panel .carrito-item button {
    background: #f5f5f5;
    border: none;
    border-radius: 6px;
    width: 24px;
    height: 24px;
    font-size: 0.9rem;
    cursor: pointer;
    flex-shrink: 0;
  }
  
  .carrito-panel .carrito-item .cantidad {
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
  }
}
.carrito-panel .carrito-preparar:hover {
  background: var(--color-secondary);
}
.carrito-panel .carrito-vacio {
  text-align: center;
  color: #888;
  margin: 2rem 0 1rem 0;
}
.oculto { display: none; }

@media (max-width: 700px) {
  .detalle-producto {
    flex-direction: column;
    padding: 1rem;
  }
  .admin-config, .admin-productos {
    padding: 1rem;
  }
  .footer .footer-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}
@media (max-width: 900px) {
  .dashboard-layout {
    flex-direction: column;
  }
  .sidebar {
    flex-direction: row;
    width: 100%;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 2px 8px #0001;
    gap: 1rem;
  }
  .dashboard-main {
    padding: 1rem 0.5rem;
  }
  .form-producto-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
}
