:root {
  --color-fondo: #ffffff;
  --color-text: #333333;
  --border-radius: 8px;
  --max-width: 1600px;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --align-content: space-between;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, sans-serif;
  background-color: #f4f6f9;
  margin: 0;
  padding: 10px;
  color: var(--color-text);
}

.main-header{
  background-color: var(--color-fondo);
  border-radius: var(--border-radius);
  max-width: var(--max-width);
  box-shadow: var(--shadow);
  justify-content: var(--align-content);
  align-items: center;
  padding: 20px;
  font-family: sans-serif;
  gap: 30px;
  margin: 0 auto;
}
.abcpublicar img{
  width: 100%;
  border-radius: var(--border-radius);
}

.container {
  background: var(--color-fondo);
  padding: 20px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  max-width: var(--max-width);
  margin: 0 auto;
}

h2 {
  margin-top: 0;
  padding-bottom: 10px;
  border-bottom: 2px solid #e0e0e0;
  font-size: 20px;
  color: #111;
}

.main-title {
  padding-bottom: 10px;
  border-bottom: 2px solid #ddd;
  color: var(--color-text);
  margin-top: 0;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 25px;
  margin-top: 15px;
  margin-bottom: 35px;
}

.product-card {
  background: var(--color-fondo);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  break-inside: avoid !important;
  page-break-inside: avoid !important;
}

.product-card:hover {
  box-shadow: 0 6px 16px rgba(0,0,0,0.1);
  border-color: #cbd5e1;
}

/* Encabezados Temáticos de las Tarjetas */
.card-header {
  background-color: #2c3e50;
  padding: 20px 15px;
  text-align: center;
  color: #ffffff;
}
.header-tablet {
  background-color: #16a085;
}

.product-name {
  font-size: 18px;
  font-weight: bold;
  margin-top: 15px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.img-container {
  min-width: 215px;
  max-width: 100%;
  height: 220px; /* Proporción ideal de altura */
  background: #ffffff;
  border-radius: 6px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
}
.product-img {
  min-width: 215px;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Cuerpo de la Tarjeta */
.card-body {
  padding: 15px;
  flex-grow: 1;
}

/* Filas de Datos */
.data-row {
  display: flex;
  justify-content: var(--align-content);
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed #e2e8f0;
  font-size: 13px;
}
.data-row:last-of-type {
  border-bottom: none;
}

.label {
  font-weight: 600;
  color: #64748b;
}
.value {
  font-weight: 500;
  color: #1e293b;
}

/* Destacados Visuales de Precios */
.iva-highlight { background-color: #fffaf0; padding: 6px 4px; border-radius: 4px; }
.cell-iva-price { font-weight: bold; color: #8B4513; }

.dist-highlight { background-color: #f8fafc; padding: 6px 4px; border-radius: 4px; }
.cell-dist-price { font-weight: bold; color: #2c3e50; }

.csw-highlight { background-color: #f0fdf4; padding: 6px 4px; border-radius: 4px; }
.cell-csw-price { font-weight: bold; color: #27AE60; }

.cell-percentage { color: #475569; font-weight: bold; }

.text-left { text-align: left; }
.text-right { text-align: right; }
.zero-value { color: #cbd5e1; font-style: italic; }
.comp-text { font-size: 11px; line-height: 1.4; color: #475569; text-align: right; max-width: 65%; }

/* Bloque Técnico */
.features-block {
  margin-top: 15px;
  background-color: #f8fafc;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #f1f5f9;
}
.block-title {
  font-size: 1.2em;
  font-weight: bold;
  color: #d35400;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.features-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 1em;
  line-height: 1.4;
}

/* Pie de Tarjeta (Comparativas de Mercado Abierto) */
.card-footer {
  background-color: #113f5c;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid #0d3148;
  padding: 12px 4px;
}
.single-market-footer {
  grid-template-columns: 1fr;
  text-align: center;
}

.market-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-right: 1px solid #1a4d6f;
  color: #ffffff;
  font-size: 1.5em;
}
.market-box:last-child {
  border-right: none;
}
.m-label {
  font-size: 0.8em;
  color: #93c5fd;
  text-transform: uppercase;
  font-weight: bold;
}
.m-value {
  font-weight: bold;
  margin-top: 2px;
}

/* footer */
.main-footer {
    display: flex;
    justify-content: var(--align-content);
    align-items: center;
    padding: 20px;
    background-color: var(--color-fondo);
    font-family: sans-serif;
    gap: 30px;
    margin: 0 auto;
    margin-top: 1.5em;
    max-width: var(--max-width);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

/* Contenedor de la izquierda (Imágenes) */
.footer-images {
    display: flex;
    align-items: center;
    gap: 15px; /* Espacio horizontal entre las dos imágenes */
}

.footer-images img {
    max-height: 50px; /* Controla la altura máxima para que se vean alineadas */
    width: auto;
    object-fit: contain;
}

/* Contenedor de la derecha (Texto) */
.footer-content {
    text-align: right; /* Alinea el texto a la derecha */
}

.footer-content p {
    margin: 5px 0; /* Controla el espaciado vertical entre líneas */
}

.footer-content a {
    margin-left: 10px; /* Espacio entre los dos correos */
    text-decoration: none;
    color: #007bff; /* Color de los enlaces */
}

/* Adaptación para celulares */
@media (max-width: 768px) {
    .main-footer {
        flex-direction: column;
        text-align: center;
    }
    .footer-images {
        justify-content: center;
    }
    .footer-content {
        text-align: center;
    }
    .footer-content a {
        display: block; /* En celulares, un correo abajo del otro */
        margin: 5px 0;
    }
}

/* Media Query para Tablets y Smartphones */
@media screen and (max-width: 1024px) {
    .main-header {
        padding: 15px;
        gap: 15px;
    }
    
    .container {
        padding: 15px;
    }

    /* Si usas estructuras de grillas para teléfonos/tabletas, las forzamos a ser dinámicas */
    .telefono-grid, .tableta-grid, [class*="-grid"] {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
        gap: 15px !important;
    }
}

/* Media Query estricto para Smartphones (Móvil) */
@media screen and (max-width: 480px) {
    .main-header {
        padding: 10px;
    }
    
    .title-dist {
        font-size: 1.5rem !important;
        text-align: center;
        padding-bottom: 8px;
    }

    h2 {
        font-size: 1.4rem;
    }

    /* Transformación completa del Footer a flujo vertical */
    .main-footer {
        flex-direction: column !important;
        text-align: center !important;
        gap: 20px !important;
        padding: 20px 15px !important;
    }

    .footer-images {
        justify-content: center !important;
        flex-wrap: wrap;
    }

    .footer-content {
        text-align: center !important;
    }

    .footer-content a {
        display: block;
        margin-left: 0 !important;
        margin-top: 8px;
    }
}