/* ============================================
   FOOTER GLOBAL - PUREWELL
   Fondo oscuro con imagotipo blanco
   ============================================ */

.pw-footer {
    background: linear-gradient(135deg, #3D5229 0%, #2a3a1c 100%);
    color: var(--pw-white);
    padding: var(--pw-space-16) 0 0;
    position: relative;
    overflow: hidden;
}

/* Textura sutil de fondo */
.pw-footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grain" x="0" y="0" width="100" height="100" patternUnits="userSpaceOnUse"><rect width="100" height="100" fill="none"/><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.02)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.02)"/><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.02)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.5;
    pointer-events: none;
}

.pw-footer__container {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--pw-space-12);
    padding: 0 var(--pw-space-6);
    margin-bottom: var(--pw-space-12);
}

/* ============================================
   BRAND (Logo + Tagline)
   ============================================ */
.pw-footer__brand {
    text-align: center;
}

.pw-footer__logo {
    display: block;
    width: 100%;
    max-width: 200px !important;
    height: auto;
    margin: 0 auto var(--pw-space-4);
}

.pw-footer__tagline {
    font-family: var(--pw-font-sans);
    font-size: clamp(1rem, 2vw, 1rem);
    font-style: italic;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

/* ============================================
   LINKS
   ============================================ */
.pw-footer__links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--pw-space-12);
    align-items: start;
    justify-items: start;
}

.pw-footer__column {
    display: flex;
    flex-direction: column;
    gap: var(--pw-space-4);
}

.pw-footer__column-title {
    font-family: var(--pw-font-sans);
    font-size: clamp(1rem, 2.5vw, 1.125rem);
    font-weight: var(--pw-font-weight-bold);
    color: var(--pw-white);
    margin: 0 0 var(--pw-space-2);
    text-transform: uppercase;
    letter-spacing: var(--pw-tracking-wide);
}

.pw-footer__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--pw-space-2);
}

.pw-footer__link {
    font-family: var(--pw-font-sans);
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: color 0.3s ease;
    display: inline-block;
}

.pw-footer__link:hover,
.pw-footer__link:focus {
    color: var(--pw-white);
    text-decoration: underline;
}

/* ============================================
   BOTTOM (Copyright)
   ============================================ */
.pw-footer__bottom {
    position: relative;
    z-index: 2;
    padding: var(--pw-space-6) 0;
    border-top: calc(var(--pw-space-1) * 0.25) solid rgba(255, 255, 255, 0.15);
}

.pw-footer__bottom-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--pw-space-4);
}

.pw-footer__copyright {
    font-family: var(--pw-font-sans);
    font-size: clamp(0.875rem, 2vw, 0.9375rem);
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    margin: 0;
}

/* Redes sociales en el copyright */
.pw-footer__social {
    display: flex;
    gap: var(--pw-space-4);
    align-items: center;
}

.pw-footer__social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
    text-decoration: none;
}

.pw-footer__social-link:hover,
.pw-footer__social-link:focus {
    color: var(--pw-white);
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.pw-footer__social-link svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   RESPONSIVE: MOBILE
   ============================================ */
@media (max-width: 768px) {
    .pw-footer {
        padding: var(--pw-space-12) 0 0;
    }

    .pw-footer__container {
        gap: var(--pw-space-10);
        margin-bottom: var(--pw-space-10);
        padding: 0 var(--pw-space-4);
        grid-template-columns: 1fr 1fr; /* Dos columnas en mobile para mejor acomodo */
    }

    .pw-footer__logo {
        max-width: 120px;
        margin: 0 0 var(--pw-space-4); /* Alinear a la izquierda */
    }

    /* El brand (logo + tagline) ocupa toda la fila en mobile */
    .pw-footer__brand {
        grid-column: 1 / -1;
        text-align: left;
    }

    .pw-footer__links {
        grid-column: 1 / -1; /* Ocupar toda la fila del contenedor padre */
        grid-template-columns: repeat(2, minmax(140px, 180px));
        gap: var(--pw-space-4) var(--pw-space-8); /* row-gap menor, column-gap mayor */
        row-gap: var(--pw-space-10); /* Mayor separación entre filas */
        text-align: left;
        justify-content: center; /* Centrar las columnas en el contenedor */
        justify-items: start; /* Alinear contenido a la izquierda dentro de cada columna */
    }

    /* Asegurar que el flujo de la rejilla coloque columnas en filas (izq-der, luego abajo) */
    .pw-footer__links {
        grid-auto-flow: row;
    }

    .pw-footer__column {
        align-items: flex-start;
    }

    .pw-footer__column-title {
        font-size: 1rem;
    }

    .pw-footer__bottom {
        padding: var(--pw-space-5) 0;
    }
}

/* Fallback para pantallas muy pequeñas: una columna para evitar columnas demasiado angostas */
@media (max-width: 360px) {
    .pw-footer__container {
        grid-template-columns: 1fr;
    }

    .pw-footer__links {
        grid-template-columns: 1fr;
    }

    .pw-footer__brand {
        grid-column: auto;
        text-align: center !important;
    }
}

/* ============================================
   RESPONSIVE: TABLET
   ============================================ */
@media (min-width: 769px) and (max-width: 1024px) {
    .pw-footer__container {
        grid-template-columns: 1fr;
        gap: var(--pw-space-10);
    }

    .pw-footer__links {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   RESPONSIVE: DESKTOP
   ============================================ */
@media (min-width: 1025px) {
    .pw-footer__container {
        grid-template-columns: 1fr 3fr; /* 25% para footer__brand y 75% para footer__links */
        gap: var(--pw-space-16);
    }

    .pw-footer__brand {
        text-align: left;
    }

    .pw-footer__links {
        grid-template-columns: repeat(3, 1fr); /* 3 columnas en desktop ya que eliminamos "Síguenos" */
    }

    .pw-footer__logo {
        margin: 0 0 var(--pw-space-4);
        max-width: 140px;
    }

    .pw-footer__column {
        padding-right: var(--pw-space-4);
    }

    /* Copyright y redes sociales en extremos opuestos en desktop */
    .pw-footer__bottom-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .pw-footer__copyright {
        text-align: left;
    }
}

/* ============================================
   ACCESIBILIDAD
   ============================================ */

/* Focus visible para navegación con teclado */
.pw-footer__link:focus-visible {
    outline: calc(var(--pw-space-1) * 0.5) solid rgba(255, 255, 255, 0.8);
    outline-offset: var(--pw-space-1);
    border-radius: calc(var(--pw-space-1) * 0.5);
}

/* Modo de alto contraste */
@media (prefers-contrast: high) {
    .pw-footer {
        background: #2a3a1c;
    }

    .pw-footer__link {
        color: rgba(255, 255, 255, 0.9);
    }

    .pw-footer__bottom {
        border-top: calc(var(--pw-space-1) * 0.5) solid rgba(255, 255, 255, 0.3);
    }
}

/* Reducir movimiento */
@media (prefers-reduced-motion: reduce) {
    .pw-footer__link {
        transition: none;
    }
}

@media (min-width: 769px) {
    .pw-footer__tagline {
        text-align: left; /* Centrar tagline en tablet y desktop */
    }

    .pw-footer__list {
        gap: var(--pw-space-1); /* Reducir espacio entre links en desktop */
    }
}
