/* =============================================================
   HOME SECTIONS — mobile collapsible + Bootstrap tabs
   ============================================================= */

/* ── Collapsible wrapper ──────────────────────────────────── */
.mobile-collapsible {
    display: none;
    width: 100%;
}

.mobile-collapsible.is-open {
    display: block;
}

/* ── Toggle button section (mobile only) ─────────────────── */
.section-toggle {
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.25rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.section-toggle.hidden,
.section-toggle.visible {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

/* Hide the sticky toggle when the mobile nav is open so it doesn't
   overlap the nav panel and hide the Productos menu item */
body.emapi-menu-open .section-toggle {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ── Corporate toggle button ──────────────────────────────── */
.corporate-toggle-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 200px;
    padding: 10px 25px !important;
    background: linear-gradient(135deg, #CC0000 0%, #990000 100%);
    border: 2px solid #ffcccc;
    border-radius: 6px !important;
    color: #ecf0f1;
    font-weight: 500 !important;
    font-size: 0.95rem;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(204, 0, 0, 0.12);
    transition: all 0.3s ease;
    cursor: pointer;
    box-sizing: border-box;
}

.corporate-toggle-btn:hover {
    background: linear-gradient(135deg, #990000 0%, #CC0000 100%);
    border-color: #ff6666;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(204, 0, 0, 0.20);
}

.corporate-toggle-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(204, 0, 0, 0.12);
}

/* ── Tab navigation ───────────────────────────────────────── */
.tabs-navigation {
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

#homeTabs {
    border-bottom: 2px solid #e9ecef;
    flex-wrap: nowrap;
}

#homeTabs .nav-link {
    color: #7f8c8d;
    border: 2px solid transparent;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    background: #f8f9fa;
    margin: 0 0.25rem;
    white-space: nowrap;
    transition: all 0.3s ease;
}

#homeTabs .nav-link:hover {
    color: #CC0000;
    background: #fff;
    border-color: #e9ecef;
}

#homeTabs .nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, #CC0000 0%, #990000 100%);
    border-color: #CC0000;
    position: relative;
}

/* Active underline strip (mobile/tab style) */
#homeTabs .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #CC0000;
}

/* ── Tab content ──────────────────────────────────────────── */
.tab-content {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    min-height: 300px;
}

/* ── Shared button consistency ────────────────────────────── */
.btn-outline-danger,
.btn-danger {
    min-width: 140px !important;
    padding: 10px 25px !important;
    font-weight: 500 !important;
    border-radius: 6px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
}

.catalog-card .btn,
.faq-item .btn,
.consejos-home-section .btn {
    min-width: 140px !important;
    width: auto;
    padding: 10px 25px !important;
    font-weight: 500 !important;
}

/* ── Corporate text utilities ─────────────────────────────── */
.corporate-text-primary   { color: #CC0000 !important; }
.corporate-text-secondary { color: #990000 !important; }
.corporate-text-muted     { color: #7f8c8d !important; }
.corporate-text-light     { color: #ff6666 !important; }

/* ══════════════════════════════════════════════════════════
   MOBILE  (max 767px)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 767.98px) {
    .section-toggle {
        padding: 0.75rem 15px;
        transform: translateY(0) !important;
        opacity: 1 !important;
    }

    .corporate-toggle-btn {
        min-width: 180px;
        padding: 10px 25px !important;
        font-size: 0.9rem;
    }

    #homeTabs .nav-link {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        margin: 0 0.125rem;
    }

    .tab-content {
        padding: 1rem;
    }

    .mobile-collapsible {
        width: 100%;
        padding: 0 15px;
    }
}

@media (max-width: 576px) {
    .corporate-toggle-btn {
        min-width: 160px;
        font-size: 0.85rem;
    }

    .btn-outline-danger,
    .btn-danger {
        min-width: 120px !important;
        padding: 8px 18px !important;
    }
}

/* ══════════════════════════════════════════════════════════
   DESKTOP  (min 768px)
   ══════════════════════════════════════════════════════════ */
@media (min-width: 768px) {
    .mobile-collapsible {
        display: block !important;
        padding: 3rem 0;
        margin-top: 1rem;
    }

    .section-toggle {
        display: none !important;
    }

    .mobile-collapsible .container-wrapper {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 15px;
    }

    /* Desktop: pill style tabs */
    #homeTabs {
        border-bottom: none;
        flex-wrap: wrap;
    }

    #homeTabs .nav-link {
        border-radius: 50px;
        margin: 0 0.5rem;
        border: 2px solid #e9ecef;
    }

    #homeTabs .nav-link.active {
        border-radius: 50px;
        border-color: #CC0000;
    }

    /* Remove bottom strip on desktop pills */
    #homeTabs .nav-link.active::after {
        display: none;
    }

    .tab-content {
        min-height: 400px;
    }
}
