/* ==========================================================
   STYLES.CSS - CONECTA AHP IMPORTADORA
   Optimizado para Carga Rápida, Flexbox/Grid y Responsive
   ========================================================== */

:root {
    --primary-green: #009640;
    --dark-green: #0b3d1f;
    --accent-orange: #f26522;
    --bg-main: #eef2f1;
    --card-bg: #ffffff;
    --text-dark: #222222;
    --text-muted: #666666;
    --border-radius: 20px;
    --transition: all 0.25s ease-in-out;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.5;
}

/* Header */
.site-header {
    background-color: var(--card-bg);
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.site-logo {
    max-height: 70px;
    width: auto;
    object-fit: contain;
}

/* Contenedor Principal */
.main-container {
    max-width: 1280px;
    margin: 30px auto;
    padding: 0 15px;
}

.gallery-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 35px 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.section-title {
    text-align: center;
    color: var(--primary-green);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 25px;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--accent-orange);
    margin: 8px auto 0;
    border-radius: 2px;
}

/* Filtros */
.category-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 35px;
}

.filter-btn {
    background-color: #f0f2f1;
    border: none;
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    background-color: #e0e6e3;
    color: var(--text-dark);
}

.filter-btn.active {
    background-color: var(--accent-orange);
    color: #ffffff;
}

.filter-btn img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    filter: brightness(0);
    vertical-align: middle;
}

.filter-btn.active img {
    filter: brightness(0) invert(1);
}

/* Grid de Productos */
.product-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

/* Adaptación Responsive del Grid */
@media (max-width: 1100px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .product-grid { grid-template-columns: 1fr; }
}

.product-item {
    border: 1px solid #e5e8e6;
    border-radius: 16px;
    overflow: hidden;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    transition: var(--transition);
}

.product-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-green);
}

/* Imagen limpia sobre fundo blanco */
.image-wrapper {
    width: 100%;
    height: 180px;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #1a1a1a;
    text-align: center;
    line-height: 1.35;
}

/* Rodapé / Footer */
.localizacao-conecta-ahp {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
}

.localizacao-header {
    margin-bottom: 30px;
}

.localizacao-label {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.localizacao-header h2 {
    margin: 0 0 12px;
    font-size: 36px;
    line-height: 1.2;
}

.localizacao-header p {
    max-width: 650px;
    margin: 0;
    line-height: 1.6;
}

.mapa-wrapper {
    width: 100%;
    overflow: hidden;
    border-radius: 18px;
}

.mapa-wrapper iframe {
    display: block;
    width: 100%;
    min-height: 450px;
}

.localizacao-info {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 30px;
    align-items: center;
    margin-top: 25px;
}

.localizacao-info strong {
    display: block;
    margin-bottom: 5px;
}

.localizacao-info p {
    margin: 0;
}

.localizacao-info a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 22px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .localizacao-conecta-ahp {
        padding: 40px 15px;
    }
    .localizacao-header h2 {
        font-size: 28px;
    }
    .mapa-wrapper iframe {
        min-height: 350px;
    }
    .localizacao-info {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .localizacao-info a {
        width: fit-content;
    }
}

.site-footer {
    background-color: var(--dark-green);
    color: #ffffff;
    margin-top: 50px;
    padding-top: 45px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1.2fr 1fr;
    gap: 30px;
}

@media (max-width: 850px) {
    .footer-container { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
    .footer-container { grid-template-columns: 1fr; }
}

.footer-logo {
    max-height: 50px;
    background: #ffffff;
    padding: 6px 12px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.brand-col p {
    font-size: 0.88rem;
    color: #d1e0d7;
}

.footer-heading {
    font-size: 1.1rem;
    color: #ffffff;
    margin-bottom: 18px;
    position: relative;
}

.footer-heading::after {
    content: '';
    display: block;
    width: 30px;
    height: 2px;
    background-color: var(--accent-orange);
    margin-top: 5px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: #d1e0d7;
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--accent-orange);
}

.footer-address p {
    font-size: 0.9rem;
    color: #d1e0d7;
    margin-bottom: 6px;
    font-style: normal;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.social-link:hover {
    background-color: var(--accent-orange);
}

.footer-bottom {
    background-color: #062412;
    text-align: center;
    padding: 15px 20px;
    font-size: 0.8rem;
    color: #a1b8ab;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ==========================================================
   MODAL DE PRODUCTO
   ========================================================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.65);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: #ffffff;
    border-radius: 20px;
    max-width: 880px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.modal-close-btn {
    position: absolute;
    top: 12px; right: 16px;
    background: #f0f2f1;
    border: none;
    border-radius: 50%;
    width: 36px; height: 36px;
    font-size: 1.4rem;
    color: #444;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    line-height: 1;
}

.modal-close-btn:hover {
    background: #e0e6e3;
    color: #111;
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-green);
    border: none;
    border-radius: 50%;
    width: 44px; height: 44px;
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal-nav:hover { background: var(--dark-green); }
.modal-nav-prev { left: 12px; }
.modal-nav-next { right: 12px; }

.modal-content {
    display: flex;
    flex-direction: row;
    overflow: hidden;
    min-height: 0;
}

.modal-image-panel {
    flex: 0 0 45%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    border-right: 1px solid #e5e8e6;
}

.modal-image-panel img {
    max-width: 100%;
    max-height: 420px;
    object-fit: contain;
}

.modal-details-panel {
    flex: 1;
    padding: 30px 35px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-product-code {
    font-size: 0.82rem;
    color: #888;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin: 0;
}

.modal-product-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0;
    line-height: 1.3;
}

.modal-product-brand {
    font-size: 0.9rem;
    color: var(--primary-green);
    font-weight: 700;
    margin: 0;
}

.modal-whatsapp-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #25D366;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    margin: 8px 0 16px;
    transition: background 0.2s, transform 0.2s;
    align-self: flex-start;
}

.modal-whatsapp-btn:hover {
    background: #1da851;
    transform: translateY(-1px);
}

.modal-specs {
    border-top: 1px solid #e5e8e6;
    padding-top: 16px;
}

.specs-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.specs-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.specs-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    padding: 4px 0;
    border-bottom: 1px dashed #e5e8e6;
}

.specs-item:last-child { border-bottom: none; }

.specs-item dt {
    color: var(--text-muted);
    font-weight: 500;
}

.specs-item dd {
    color: var(--text-dark);
    font-weight: 600;
    margin: 0;
    text-align: right;
}

/* Responsive modal */
@media (max-width: 700px) {
    .modal-overlay { padding: 10px; align-items: flex-end; }
    .modal-container { border-radius: 20px 20px 0 0; max-height: 95vh; }
    .modal-content { flex-direction: column; }
    .modal-image-panel { flex: 0 0 auto; padding: 20px; border-right: none; border-bottom: 1px solid #e5e8e6; max-height: 250px; }
    .modal-image-panel img { max-height: 200px; }
    .modal-details-panel { padding: 20px; }
    .modal-product-name { font-size: 1.15rem; }
    .modal-nav { width: 36px; height: 36px; font-size: 1rem; }
    .modal-nav-prev { left: 8px; }
    .modal-nav-next { right: 8px; }
}

/* Botão Flutuante WhatsApp */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: #25D366;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.whatsapp-float svg {
    display: block;
}