/* Preguntas Frecuentes - Ferretería Omega */
:root {
    --blue-900: #121a77;
    --blue-700: #1E2DBF;
    --orange-500: #EA580C;
    --orange-400: #F97316;
    --gray-50: #f9fafc;
    --gray-200: #e5e7eb;
    --gray-400: #9ca3af;
    --white: #ffffff;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--gray-50);
    margin: 0;
    padding: 0;
}

/*  Sección principal */
.faq-section {
    background-color: var(--gray-50);
    padding: 5rem 1.5rem 3rem;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

.faq-title {
    color: var(--blue-900);
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
}

/* Categorías (responsive real, 2 columnas en móviles) */
.faq-categories {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)) !important;
    gap: 1rem !important;
    justify-content: center !important;
    align-items: center !important;
    justify-items: center !important;
    margin: 0 auto 2rem auto !important;
    text-align: center !important;
    width: 100% !important;
    max-width: none !important;
}

/*  Centrar automáticamente si hay una cantidad impar */
.faq-categories> :last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
}

/* Tablet: dos columnas balanceadas */
@media (max-width: 992px) {
    .faq-categories {
        grid-template-columns: repeat(2, minmax(150px, 1fr)) !important;
        width: 90% !important;
        max-width: 600px !important;
    }
}

/* Móviles medianos: dos columnas compactas */
@media (max-width: 700px) {
    .faq-categories {
        grid-template-columns: repeat(2, minmax(130px, 1fr)) !important;
        width: 95% !important;
        max-width: 500px !important;
    }

    .faq-category {
        max-width: 180px !important;
        padding: 0.8rem 1rem !important;
    }
}

/* Móviles pequeños: dos columnas centradas */
@media (max-width: 480px) {
    .faq-categories {
        grid-template-columns: repeat(2, minmax(120px, 1fr)) !important;
        width: 100% !important;
        gap: 0.7rem !important;
    }

    .faq-category {
        flex: none !important;
        width: 100% !important;
        max-width: 160px !important;
        padding: 0.7rem 0.9rem !important;
        font-size: 0.9rem !important;
    }

    /* Centrar última categoría impar */
    .faq-categories> :last-child:nth-child(odd) {
        grid-column: 1 / -1;
        justify-self: center !important;
    }
}

/* Estilo individual de categoría */
.faq-category {
    border: 2px solid transparent;
    background: var(--white);
    color: var(--gray-400);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    width: 100%;
    max-width: 200px;
}

.faq-category i {
    display: block;
    font-size: 1.6rem;
    margin-bottom: 0.3rem;
}

.faq-category.active {
    color: var(--orange-500);
    border-color: var(--orange-500);
    background-color: #fff6f1;
    box-shadow: 0 4px 8px rgba(234, 88, 12, 0.15);
}

.faq-category:hover {
    transform: translateY(-2px);
}

/* Preguntas y respuestas */
.faq-item {
    background: var(--white);
    border-radius: 10px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: var(--gray-200);
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    color: var(--blue-900);
    font-weight: 600;
    text-align: left;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease, color 0.3s ease;
}

.faq-question:hover {
    background: var(--gray-50);
}

.faq-question.active {
    color: var(--orange-500);
}

.faq-question span {
    font-size: 1.5rem;
    color: var(--orange-500);
    transition: transform 0.3s ease;
}

/*  Respuestas animadas */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.6;
    border-top: 1px solid var(--gray-200);
    background: var(--white);
    padding: 0 1.5rem;
}

.faq-question.active+.faq-answer {
    padding: 1rem 1.5rem;
}

/*  Botones de navegación */
.back-top {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    background: var(--orange-500);
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    text-decoration: none;
    z-index: 10;
}

.back-top:hover {
    background: var(--orange-400);
    transform: translateY(-2px);
}

.back-bottom {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--blue-900);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 10;
}

.back-bottom:hover {
    background: var(--blue-700);
    transform: translateY(-2px);
}

/* Responsive - botón Home y sección */
@media (max-width: 600px) {
    .faq-section {
        padding-top: 6rem;
    }

    .back-top {
        width: 40px;
        height: 40px;
        top: 1rem;
        left: 1rem;
    }

    .back-bottom {
        bottom: 1.5rem;
        right: 1.5rem;
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }
}